summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2007-11-19 16:54:44 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2007-11-19 16:54:44 +0000
commitd66aca6eb24b89052e7e2ab05ade9fcd5398bb95 (patch)
treeb576cec8a33157707585a5ca63b730765276ef69
parent96420dfa6bb12a4b9fce082d50e49910e3dc8779 (diff)
downloadqpid-python-d66aca6eb24b89052e7e2ab05ade9fcd5398bb95.tar.gz
Undoing the accidental move instead of a copy
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/tags/M2@596363 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--Final/KEYS32
-rwxr-xr-xFinal/bin/set_svn_properties.sh133
-rw-r--r--Final/cpp/DESIGN79
-rw-r--r--Final/cpp/LICENSE203
-rw-r--r--Final/cpp/Makefile.am45
-rw-r--r--Final/cpp/NOTICE25
-rw-r--r--Final/cpp/README272
-rw-r--r--Final/cpp/RELEASE_NOTES41
-rwxr-xr-xFinal/cpp/bootstrap55
-rwxr-xr-xFinal/cpp/build-aux/compile142
-rwxr-xr-xFinal/cpp/build-aux/config.guess1501
-rwxr-xr-xFinal/cpp/build-aux/config.rpath614
-rwxr-xr-xFinal/cpp/build-aux/config.sub1619
-rwxr-xr-xFinal/cpp/build-aux/depcomp584
-rwxr-xr-xFinal/cpp/build-aux/install-sh507
-rwxr-xr-xFinal/cpp/build-aux/ltmain.sh6871
-rwxr-xr-xFinal/cpp/build-aux/mdate-sh201
-rwxr-xr-xFinal/cpp/build-aux/missing367
-rw-r--r--Final/cpp/configure.ac152
-rw-r--r--Final/cpp/docs/api/Makefile.am40
-rw-r--r--Final/cpp/docs/api/user.doxygen1244
-rw-r--r--Final/cpp/docs/man/Makefile.am38
-rw-r--r--Final/cpp/docs/man/qpidd.x16
-rwxr-xr-xFinal/cpp/etc/qpidd84
-rw-r--r--Final/cpp/gen/Makefile.am50
-rwxr-xr-xFinal/cpp/gen/make-gen-src-mk.sh48
-rw-r--r--Final/cpp/lib/Makefile.am19
-rw-r--r--Final/cpp/lib/broker/AccumulatedAck.cpp49
-rw-r--r--Final/cpp/lib/broker/AccumulatedAck.h57
-rw-r--r--Final/cpp/lib/broker/AutoDelete.cpp86
-rw-r--r--Final/cpp/lib/broker/AutoDelete.h55
-rw-r--r--Final/cpp/lib/broker/Binding.h38
-rw-r--r--Final/cpp/lib/broker/Broker.cpp84
-rw-r--r--Final/cpp/lib/broker/Broker.h91
-rw-r--r--Final/cpp/lib/broker/BrokerChannel.cpp272
-rw-r--r--Final/cpp/lib/broker/BrokerChannel.h130
-rw-r--r--Final/cpp/lib/broker/BrokerExchange.h50
-rw-r--r--Final/cpp/lib/broker/BrokerMessage.cpp223
-rw-r--r--Final/cpp/lib/broker/BrokerMessage.h145
-rw-r--r--Final/cpp/lib/broker/BrokerQueue.cpp247
-rw-r--r--Final/cpp/lib/broker/BrokerQueue.h146
-rw-r--r--Final/cpp/lib/broker/ConnectionToken.h38
-rw-r--r--Final/cpp/lib/broker/Consumer.h37
-rw-r--r--Final/cpp/lib/broker/Content.h44
-rw-r--r--Final/cpp/lib/broker/Daemon.cpp182
-rw-r--r--Final/cpp/lib/broker/Daemon.h84
-rw-r--r--Final/cpp/lib/broker/DeletingTxOp.cpp45
-rw-r--r--Final/cpp/lib/broker/DeletingTxOp.h45
-rw-r--r--Final/cpp/lib/broker/Deliverable.h37
-rw-r--r--Final/cpp/lib/broker/DeliverableMessage.cpp33
-rw-r--r--Final/cpp/lib/broker/DeliverableMessage.h41
-rw-r--r--Final/cpp/lib/broker/DeliveryRecord.cpp91
-rw-r--r--Final/cpp/lib/broker/DeliveryRecord.h64
-rw-r--r--Final/cpp/lib/broker/DirectExchange.cpp73
-rw-r--r--Final/cpp/lib/broker/DirectExchange.h57
-rw-r--r--Final/cpp/lib/broker/ExchangeBinding.cpp35
-rw-r--r--Final/cpp/lib/broker/ExchangeBinding.h48
-rw-r--r--Final/cpp/lib/broker/ExchangeRegistry.cpp73
-rw-r--r--Final/cpp/lib/broker/ExchangeRegistry.h46
-rw-r--r--Final/cpp/lib/broker/FanOutExchange.cpp60
-rw-r--r--Final/cpp/lib/broker/FanOutExchange.h60
-rw-r--r--Final/cpp/lib/broker/HeadersExchange.cpp121
-rw-r--r--Final/cpp/lib/broker/HeadersExchange.h65
-rw-r--r--Final/cpp/lib/broker/InMemoryContent.cpp72
-rw-r--r--Final/cpp/lib/broker/InMemoryContent.h47
-rw-r--r--Final/cpp/lib/broker/LazyLoadedContent.cpp63
-rw-r--r--Final/cpp/lib/broker/LazyLoadedContent.h46
-rw-r--r--Final/cpp/lib/broker/Makefile.am107
-rw-r--r--Final/cpp/lib/broker/MessageBuilder.cpp71
-rw-r--r--Final/cpp/lib/broker/MessageBuilder.h58
-rw-r--r--Final/cpp/lib/broker/MessageStore.h140
-rw-r--r--Final/cpp/lib/broker/MessageStoreModule.cpp104
-rw-r--r--Final/cpp/lib/broker/MessageStoreModule.h60
-rw-r--r--Final/cpp/lib/broker/NameGenerator.cpp32
-rw-r--r--Final/cpp/lib/broker/NameGenerator.h39
-rw-r--r--Final/cpp/lib/broker/NullMessageStore.cpp104
-rw-r--r--Final/cpp/lib/broker/NullMessageStore.h59
-rw-r--r--Final/cpp/lib/broker/Prefetch.h42
-rw-r--r--Final/cpp/lib/broker/QueuePolicy.cpp69
-rw-r--r--Final/cpp/lib/broker/QueuePolicy.h54
-rw-r--r--Final/cpp/lib/broker/QueueRegistry.cpp81
-rw-r--r--Final/cpp/lib/broker/QueueRegistry.h96
-rw-r--r--Final/cpp/lib/broker/RecoveryManager.cpp42
-rw-r--r--Final/cpp/lib/broker/RecoveryManager.h45
-rw-r--r--Final/cpp/lib/broker/SessionHandlerFactoryImpl.cpp69
-rw-r--r--Final/cpp/lib/broker/SessionHandlerFactoryImpl.h57
-rw-r--r--Final/cpp/lib/broker/SessionHandlerImpl.cpp468
-rw-r--r--Final/cpp/lib/broker/SessionHandlerImpl.h270
-rw-r--r--Final/cpp/lib/broker/TopicExchange.cpp156
-rw-r--r--Final/cpp/lib/broker/TopicExchange.h100
-rw-r--r--Final/cpp/lib/broker/TransactionalStore.h47
-rw-r--r--Final/cpp/lib/broker/TxAck.cpp54
-rw-r--r--Final/cpp/lib/broker/TxAck.h58
-rw-r--r--Final/cpp/lib/broker/TxBuffer.cpp55
-rw-r--r--Final/cpp/lib/broker/TxBuffer.h107
-rw-r--r--Final/cpp/lib/broker/TxOp.h39
-rw-r--r--Final/cpp/lib/broker/TxPublish.cpp60
-rw-r--r--Final/cpp/lib/broker/TxPublish.h80
-rw-r--r--Final/cpp/lib/client/ClientChannel.cpp434
-rw-r--r--Final/cpp/lib/client/ClientChannel.h321
-rw-r--r--Final/cpp/lib/client/ClientExchange.cpp34
-rw-r--r--Final/cpp/lib/client/ClientExchange.h106
-rw-r--r--Final/cpp/lib/client/ClientMessage.cpp150
-rw-r--r--Final/cpp/lib/client/ClientMessage.h114
-rw-r--r--Final/cpp/lib/client/ClientQueue.cpp58
-rw-r--r--Final/cpp/lib/client/ClientQueue.h104
-rw-r--r--Final/cpp/lib/client/Connection.cpp250
-rw-r--r--Final/cpp/lib/client/Connection.h182
-rw-r--r--Final/cpp/lib/client/Connector.cpp195
-rw-r--r--Final/cpp/lib/client/Connector.h97
-rw-r--r--Final/cpp/lib/client/IncomingMessage.cpp88
-rw-r--r--Final/cpp/lib/client/IncomingMessage.h63
-rw-r--r--Final/cpp/lib/client/Makefile.am52
-rw-r--r--Final/cpp/lib/client/MessageListener.cpp24
-rw-r--r--Final/cpp/lib/client/MessageListener.h49
-rw-r--r--Final/cpp/lib/client/MethodBodyInstances.h100
-rw-r--r--Final/cpp/lib/client/ResponseHandler.cpp61
-rw-r--r--Final/cpp/lib/client/ResponseHandler.h52
-rw-r--r--Final/cpp/lib/client/ReturnedMessageHandler.cpp24
-rw-r--r--Final/cpp/lib/client/ReturnedMessageHandler.h49
-rw-r--r--Final/cpp/lib/common/CommonOptions.cpp59
-rw-r--r--Final/cpp/lib/common/CommonOptions.h101
-rw-r--r--Final/cpp/lib/common/Exception.cpp48
-rw-r--r--Final/cpp/lib/common/Exception.h65
-rw-r--r--Final/cpp/lib/common/ExceptionHolder.cpp35
-rw-r--r--Final/cpp/lib/common/ExceptionHolder.h65
-rw-r--r--Final/cpp/lib/common/Makefile.am151
-rw-r--r--Final/cpp/lib/common/QpidError.cpp44
-rw-r--r--Final/cpp/lib/common/QpidError.h67
-rw-r--r--Final/cpp/lib/common/SharedObject.h55
-rw-r--r--Final/cpp/lib/common/doxygen_mainpage.h65
-rw-r--r--Final/cpp/lib/common/framing/AMQBody.cpp36
-rw-r--r--Final/cpp/lib/common/framing/AMQBody.h51
-rw-r--r--Final/cpp/lib/common/framing/AMQContentBody.cpp43
-rw-r--r--Final/cpp/lib/common/framing/AMQContentBody.h53
-rw-r--r--Final/cpp/lib/common/framing/AMQDataBlock.h42
-rw-r--r--Final/cpp/lib/common/framing/AMQFrame.cpp132
-rw-r--r--Final/cpp/lib/common/framing/AMQFrame.h71
-rw-r--r--Final/cpp/lib/common/framing/AMQHeaderBody.cpp75
-rw-r--r--Final/cpp/lib/common/framing/AMQHeaderBody.h60
-rw-r--r--Final/cpp/lib/common/framing/AMQHeartbeatBody.cpp29
-rw-r--r--Final/cpp/lib/common/framing/AMQHeartbeatBody.h47
-rw-r--r--Final/cpp/lib/common/framing/AMQMethodBody.cpp46
-rw-r--r--Final/cpp/lib/common/framing/AMQMethodBody.h62
-rw-r--r--Final/cpp/lib/common/framing/BasicHeaderProperties.cpp103
-rw-r--r--Final/cpp/lib/common/framing/BasicHeaderProperties.h97
-rw-r--r--Final/cpp/lib/common/framing/BodyHandler.cpp54
-rw-r--r--Final/cpp/lib/common/framing/BodyHandler.h54
-rw-r--r--Final/cpp/lib/common/framing/Buffer.cpp183
-rw-r--r--Final/cpp/lib/common/framing/Buffer.h87
-rw-r--r--Final/cpp/lib/common/framing/FieldTable.cpp150
-rw-r--r--Final/cpp/lib/common/framing/FieldTable.h90
-rw-r--r--Final/cpp/lib/common/framing/FramingContent.cpp41
-rw-r--r--Final/cpp/lib/common/framing/FramingContent.h47
-rw-r--r--Final/cpp/lib/common/framing/HeaderProperties.h46
-rw-r--r--Final/cpp/lib/common/framing/InitiationHandler.cpp24
-rw-r--r--Final/cpp/lib/common/framing/InitiationHandler.h41
-rw-r--r--Final/cpp/lib/common/framing/InputHandler.h39
-rw-r--r--Final/cpp/lib/common/framing/OutputHandler.h39
-rw-r--r--Final/cpp/lib/common/framing/ProtocolInitiation.cpp58
-rw-r--r--Final/cpp/lib/common/framing/ProtocolInitiation.h54
-rw-r--r--Final/cpp/lib/common/framing/ProtocolVersion.cpp64
-rw-r--r--Final/cpp/lib/common/framing/ProtocolVersion.h57
-rw-r--r--Final/cpp/lib/common/framing/ProtocolVersionException.cpp66
-rw-r--r--Final/cpp/lib/common/framing/ProtocolVersionException.h55
-rw-r--r--Final/cpp/lib/common/framing/Value.cpp122
-rw-r--r--Final/cpp/lib/common/framing/Value.h171
-rw-r--r--Final/cpp/lib/common/framing/amqp_framing.h36
-rw-r--r--Final/cpp/lib/common/framing/amqp_types.h45
-rw-r--r--Final/cpp/lib/common/sys/Acceptor.h47
-rw-r--r--Final/cpp/lib/common/sys/AtomicCount.h74
-rw-r--r--Final/cpp/lib/common/sys/Module.h163
-rw-r--r--Final/cpp/lib/common/sys/Monitor.h129
-rw-r--r--Final/cpp/lib/common/sys/Mutex.h158
-rw-r--r--Final/cpp/lib/common/sys/Runnable.cpp35
-rw-r--r--Final/cpp/lib/common/sys/Runnable.h50
-rw-r--r--Final/cpp/lib/common/sys/SessionContext.h41
-rw-r--r--Final/cpp/lib/common/sys/SessionHandler.h45
-rw-r--r--Final/cpp/lib/common/sys/SessionHandlerFactory.h46
-rw-r--r--Final/cpp/lib/common/sys/ShutdownHandler.h37
-rw-r--r--Final/cpp/lib/common/sys/Socket.h89
-rw-r--r--Final/cpp/lib/common/sys/Thread.h150
-rw-r--r--Final/cpp/lib/common/sys/Time.cpp60
-rw-r--r--Final/cpp/lib/common/sys/Time.h58
-rw-r--r--Final/cpp/lib/common/sys/TimeoutHandler.h39
-rw-r--r--Final/cpp/lib/common/sys/apr/APRAcceptor.cpp130
-rw-r--r--Final/cpp/lib/common/sys/apr/APRBase.cpp90
-rw-r--r--Final/cpp/lib/common/sys/apr/APRBase.h78
-rw-r--r--Final/cpp/lib/common/sys/apr/APRPool.cpp78
-rw-r--r--Final/cpp/lib/common/sys/apr/APRPool.h61
-rw-r--r--Final/cpp/lib/common/sys/apr/APRSocket.cpp77
-rw-r--r--Final/cpp/lib/common/sys/apr/APRSocket.h48
-rw-r--r--Final/cpp/lib/common/sys/apr/LFProcessor.cpp181
-rw-r--r--Final/cpp/lib/common/sys/apr/LFProcessor.h122
-rw-r--r--Final/cpp/lib/common/sys/apr/LFSessionContext.cpp181
-rw-r--r--Final/cpp/lib/common/sys/apr/LFSessionContext.h90
-rw-r--r--Final/cpp/lib/common/sys/apr/Socket.cpp94
-rw-r--r--Final/cpp/lib/common/sys/apr/Thread.cpp37
-rw-r--r--Final/cpp/lib/common/sys/posix/EventChannel.cpp328
-rw-r--r--Final/cpp/lib/common/sys/posix/EventChannel.h179
-rw-r--r--Final/cpp/lib/common/sys/posix/EventChannelAcceptor.cpp149
-rw-r--r--Final/cpp/lib/common/sys/posix/EventChannelConnection.cpp232
-rw-r--r--Final/cpp/lib/common/sys/posix/EventChannelConnection.h105
-rw-r--r--Final/cpp/lib/common/sys/posix/EventChannelThreads.cpp122
-rw-r--r--Final/cpp/lib/common/sys/posix/EventChannelThreads.h95
-rw-r--r--Final/cpp/lib/common/sys/posix/PosixAcceptor.cpp48
-rw-r--r--Final/cpp/lib/common/sys/posix/Socket.cpp120
-rw-r--r--Final/cpp/lib/common/sys/posix/Thread.cpp31
-rw-r--r--Final/cpp/lib/common/sys/posix/check.cpp39
-rw-r--r--Final/cpp/lib/common/sys/posix/check.h62
-rw-r--r--Final/cpp/m4/clock_time.m430
-rw-r--r--Final/cpp/m4/compiler-flags.m423
-rw-r--r--Final/cpp/m4/cppunit.m489
-rw-r--r--Final/cpp/m4/extensions.m458
-rwxr-xr-xFinal/cpp/make-dist101
-rwxr-xr-xFinal/cpp/qpid-autotools-install223
-rw-r--r--Final/cpp/qpidc.spec.in167
-rw-r--r--Final/cpp/rpm/Makefile.am46
-rw-r--r--Final/cpp/src/Makefile.am37
-rw-r--r--Final/cpp/src/qpidd.cpp184
-rw-r--r--Final/cpp/tests/.vg-supp2481
-rw-r--r--Final/cpp/tests/APRBaseTest.cpp47
-rw-r--r--Final/cpp/tests/AcceptorTest.cpp95
-rw-r--r--Final/cpp/tests/AccumulatedAckTest.cpp83
-rw-r--r--Final/cpp/tests/BasicP2PTest.cpp66
-rw-r--r--Final/cpp/tests/BasicP2PTest.h46
-rw-r--r--Final/cpp/tests/BasicPubSubTest.cpp121
-rw-r--r--Final/cpp/tests/BasicPubSubTest.h51
-rw-r--r--Final/cpp/tests/BodyHandlerTest.cpp110
-rw-r--r--Final/cpp/tests/ChannelTest.cpp357
-rw-r--r--Final/cpp/tests/EventChannelConnectionTest.cpp109
-rw-r--r--Final/cpp/tests/EventChannelTest.cpp187
-rw-r--r--Final/cpp/tests/EventChannelThreadsTest.cpp247
-rw-r--r--Final/cpp/tests/ExceptionTest.cpp61
-rw-r--r--Final/cpp/tests/ExchangeTest.cpp67
-rw-r--r--Final/cpp/tests/FieldTableTest.cpp55
-rw-r--r--Final/cpp/tests/FramingTest.cpp150
-rw-r--r--Final/cpp/tests/HeaderTest.cpp141
-rw-r--r--Final/cpp/tests/HeadersExchangeTest.cpp115
-rw-r--r--Final/cpp/tests/InMemoryContentTest.cpp98
-rw-r--r--Final/cpp/tests/LazyLoadedContentTest.cpp123
-rw-r--r--Final/cpp/tests/Makefile.am143
-rw-r--r--Final/cpp/tests/MessageBuilderTest.cpp213
-rw-r--r--Final/cpp/tests/MessageTest.cpp91
-rw-r--r--Final/cpp/tests/MockSessionHandler.h116
-rw-r--r--Final/cpp/tests/P2PMessageSizeTest.cpp114
-rw-r--r--Final/cpp/tests/P2PMessageSizeTest.h58
-rw-r--r--Final/cpp/tests/PubSubMessageSizeTest.cpp125
-rw-r--r--Final/cpp/tests/PubSubMessageSizeTest.h51
-rw-r--r--Final/cpp/tests/QueuePolicyTest.cpp89
-rw-r--r--Final/cpp/tests/QueueRegistryTest.cpp95
-rw-r--r--Final/cpp/tests/QueueTest.cpp179
-rw-r--r--Final/cpp/tests/SimpleTestCaseBase.cpp135
-rw-r--r--Final/cpp/tests/SimpleTestCaseBase.h187
-rw-r--r--Final/cpp/tests/TestCase.h75
-rw-r--r--Final/cpp/tests/TestOptions.h69
-rw-r--r--Final/cpp/tests/TestUtils.cpp53
-rw-r--r--Final/cpp/tests/TestUtils.h32
-rw-r--r--Final/cpp/tests/TopicExchangeTest.cpp200
-rw-r--r--Final/cpp/tests/TxAckTest.cpp122
-rw-r--r--Final/cpp/tests/TxBufferTest.cpp266
-rw-r--r--Final/cpp/tests/TxPublishTest.cpp122
-rw-r--r--Final/cpp/tests/ValueTest.cpp102
-rw-r--r--Final/cpp/tests/client_test.cpp136
-rwxr-xr-xFinal/cpp/tests/daemon_test37
-rw-r--r--Final/cpp/tests/echo_service.cpp230
-rwxr-xr-xFinal/cpp/tests/env41
-rw-r--r--Final/cpp/tests/examples.Makefile84
-rw-r--r--Final/cpp/tests/examples.README18
-rw-r--r--Final/cpp/tests/interop_runner.cpp261
-rw-r--r--Final/cpp/tests/qpid_test_plugin.h43
-rwxr-xr-xFinal/cpp/tests/run-python-tests58
-rwxr-xr-xFinal/cpp/tests/run-system-tests56
-rwxr-xr-xFinal/cpp/tests/run-unit-tests27
-rw-r--r--Final/cpp/tests/setup92
-rw-r--r--Final/cpp/tests/topic_listener.cpp212
-rw-r--r--Final/cpp/tests/topic_publisher.cpp282
-rwxr-xr-xFinal/cpp/tests/topicall43
-rwxr-xr-xFinal/cpp/tests/topictest60
-rwxr-xr-xFinal/cpp/versions30
-rw-r--r--Final/dotnet/LICENSE.txt203
-rw-r--r--Final/dotnet/NOTICE.txt26
-rw-r--r--Final/dotnet/Qpid.Buffer.Tests/Properties/AssemblyInfo.cs35
-rw-r--r--Final/dotnet/Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj59
-rw-r--r--Final/dotnet/Qpid.Buffer.Tests/SimpleByteBufferTests.cs333
-rw-r--r--Final/dotnet/Qpid.Buffer.Tests/SlicedByteBufferTests.cs133
-rw-r--r--Final/dotnet/Qpid.Buffer.Tests/default.build27
-rw-r--r--Final/dotnet/Qpid.Buffer/BufferOverflowException.cs41
-rw-r--r--Final/dotnet/Qpid.Buffer/BufferUnderflowException.cs42
-rw-r--r--Final/dotnet/Qpid.Buffer/ByteBuffer.cs982
-rw-r--r--Final/dotnet/Qpid.Buffer/ByteBufferHexDumper.cs79
-rw-r--r--Final/dotnet/Qpid.Buffer/IByteBufferAllocator.cs50
-rw-r--r--Final/dotnet/Qpid.Buffer/Properties/AssemblyInfo.cs53
-rw-r--r--Final/dotnet/Qpid.Buffer/Qpid.Buffer.csproj59
-rw-r--r--Final/dotnet/Qpid.Buffer/SimpleByteBuffer.cs120
-rw-r--r--Final/dotnet/Qpid.Buffer/SimpleByteBufferAllocator.cs58
-rw-r--r--Final/dotnet/Qpid.Buffer/SlicedByteBuffer.cs86
-rw-r--r--Final/dotnet/Qpid.Buffer/default.build25
-rw-r--r--Final/dotnet/Qpid.Client.Tests/App.config13
-rw-r--r--Final/dotnet/Qpid.Client.Tests/BrokerDetails/BrokerDetailsTest.cs65
-rw-r--r--Final/dotnet/Qpid.Client.Tests/Channel/ChannelMessageCreationTests.cs79
-rw-r--r--Final/dotnet/Qpid.Client.Tests/Channel/ChannelQueueTest.cs237
-rw-r--r--Final/dotnet/Qpid.Client.Tests/Common/BaseMessagingTestFixture.cs85
-rw-r--r--Final/dotnet/Qpid.Client.Tests/HeadersExchange/HeadersExchangeTest.cs268
-rw-r--r--Final/dotnet/Qpid.Client.Tests/Messages/MessageFactoryRegistryTests.cs114
-rw-r--r--Final/dotnet/Qpid.Client.Tests/MultiConsumer/ProducerMultiConsumer.cs127
-rw-r--r--Final/dotnet/Qpid.Client.Tests/Properties/AssemblyInfo.cs53
-rw-r--r--Final/dotnet/Qpid.Client.Tests/Qpid.Client.Tests.csproj113
-rw-r--r--Final/dotnet/Qpid.Client.Tests/Qpid.Common.DLL.config5
-rw-r--r--Final/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs66
-rw-r--r--Final/dotnet/Qpid.Client.Tests/SimpleConsumer/TestSyncConsumer.cs127
-rw-r--r--Final/dotnet/Qpid.Client.Tests/connection/ConnectionTest.cs72
-rw-r--r--Final/dotnet/Qpid.Client.Tests/connection/SslConnectionTest.cs63
-rw-r--r--Final/dotnet/Qpid.Client.Tests/default.build49
-rw-r--r--Final/dotnet/Qpid.Client.Tests/failover/FailoverTest.cs319
-rw-r--r--Final/dotnet/Qpid.Client.Tests/interop/InteropClientTestCase.cs67
-rw-r--r--Final/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase1DummyRun.cs69
-rw-r--r--Final/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase2BasicP2P.cs185
-rw-r--r--Final/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase3BasicPubSub.cs224
-rw-r--r--Final/dotnet/Qpid.Client.Tests/interop/TestClient.cs358
-rw-r--r--Final/dotnet/Qpid.Client.Tests/interop/TopicListener.cs211
-rw-r--r--Final/dotnet/Qpid.Client.Tests/interop/TopicPublisher.cs188
-rw-r--r--Final/dotnet/Qpid.Client.Tests/lib/nunit/nunit-licence.txt23
-rw-r--r--Final/dotnet/Qpid.Client.Tests/lib/nunit/nunit.framework.dllbin45056 -> 0 bytes
-rw-r--r--Final/dotnet/Qpid.Client.Tests/log4net.config48
-rw-r--r--Final/dotnet/Qpid.Client.Tests/requestreply1/ServiceProvidingClient.cs150
-rw-r--r--Final/dotnet/Qpid.Client.Tests/requestreply1/ServiceRequestingClient.cs182
-rw-r--r--Final/dotnet/Qpid.Client.Tests/undeliverable/UndeliverableTest.cs128
-rw-r--r--Final/dotnet/Qpid.Client.Tests/url/ConnectionUrlTest.cs446
-rw-r--r--Final/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketProcessor.cs117
-rw-r--r--Final/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketTransport.cs121
-rw-r--r--Final/dotnet/Qpid.Client.Transport.Socket.Blocking/ByteChannel.cs63
-rw-r--r--Final/dotnet/Qpid.Client.Transport.Socket.Blocking/Properties/AssemblyInfo.cs53
-rw-r--r--Final/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.csproj71
-rw-r--r--Final/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.mdp30
-rw-r--r--Final/dotnet/Qpid.Client/Client/AMQAuthenticationException.cs39
-rw-r--r--Final/dotnet/Qpid.Client/Client/AMQConnection.cs889
-rw-r--r--Final/dotnet/Qpid.Client/Client/AMQConnectionException.cs38
-rw-r--r--Final/dotnet/Qpid.Client/Client/AMQDestination.cs234
-rw-r--r--Final/dotnet/Qpid.Client/Client/AMQNoConsumersException.cs45
-rw-r--r--Final/dotnet/Qpid.Client/Client/AMQNoRouteException.cs46
-rw-r--r--Final/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs322
-rw-r--r--Final/dotnet/Qpid.Client/Client/AmqChannel.cs1009
-rw-r--r--Final/dotnet/Qpid.Client/Client/BasicMessageConsumer.cs453
-rw-r--r--Final/dotnet/Qpid.Client/Client/BasicMessageProducer.cs402
-rw-r--r--Final/dotnet/Qpid.Client/Client/Closeable.cs71
-rw-r--r--Final/dotnet/Qpid.Client/Client/Configuration/AuthenticationConfigurationSectionHandler.cs84
-rw-r--r--Final/dotnet/Qpid.Client/Client/ConnectionTuneParameters.cs83
-rw-r--r--Final/dotnet/Qpid.Client/Client/Failover/FailoverException.cs42
-rw-r--r--Final/dotnet/Qpid.Client/Client/Failover/FailoverHandler.cs175
-rw-r--r--Final/dotnet/Qpid.Client/Client/Failover/FailoverState.cs31
-rw-r--r--Final/dotnet/Qpid.Client/Client/Failover/FailoverSupport.cs55
-rw-r--r--Final/dotnet/Qpid.Client/Client/Handler/BasicDeliverMethodHandler.cs42
-rw-r--r--Final/dotnet/Qpid.Client/Client/Handler/BasicReturnMethodHandler.cs44
-rw-r--r--Final/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs68
-rw-r--r--Final/dotnet/Qpid.Client/Client/Handler/ConnectionCloseMethodHandler.cs68
-rw-r--r--Final/dotnet/Qpid.Client/Client/Handler/ConnectionCloseOkHandler.cs41
-rw-r--r--Final/dotnet/Qpid.Client/Client/Handler/ConnectionOpenOkMethodHandler.cs35
-rw-r--r--Final/dotnet/Qpid.Client/Client/Handler/ConnectionRedirectMethodHandler.cs68
-rw-r--r--Final/dotnet/Qpid.Client/Client/Handler/ConnectionSecureMethodHandler.cs60
-rw-r--r--Final/dotnet/Qpid.Client/Client/Handler/ConnectionStartMethodHandler.cs143
-rw-r--r--Final/dotnet/Qpid.Client/Client/Handler/ConnectionTuneMethodHandler.cs63
-rw-r--r--Final/dotnet/Qpid.Client/Client/Handler/QueueDeleteOkMethodHandler.cs44
-rw-r--r--Final/dotnet/Qpid.Client/Client/Handler/QueuePurgeOkMethodHandler.cs44
-rw-r--r--Final/dotnet/Qpid.Client/Client/Message/AMQMessage.cs58
-rw-r--r--Final/dotnet/Qpid.Client/Client/Message/AMQMessageFactory.cs73
-rw-r--r--Final/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs694
-rw-r--r--Final/dotnet/Qpid.Client/Client/Message/IMessageFactory.cs52
-rw-r--r--Final/dotnet/Qpid.Client/Client/Message/MessageFactoryRegistry.cs129
-rw-r--r--Final/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs353
-rw-r--r--Final/dotnet/Qpid.Client/Client/Message/QpidBytesMessageFactory.cs75
-rw-r--r--Final/dotnet/Qpid.Client/Client/Message/QpidHeaders.cs213
-rw-r--r--Final/dotnet/Qpid.Client/Client/Message/QpidTextMessage.cs115
-rw-r--r--Final/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs40
-rw-r--r--Final/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs57
-rw-r--r--Final/dotnet/Qpid.Client/Client/Message/UnprocessedMessage.cs57
-rw-r--r--Final/dotnet/Qpid.Client/Client/Protocol/AMQMethodEvent.cs76
-rw-r--r--Final/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs318
-rw-r--r--Final/dotnet/Qpid.Client/Client/Protocol/AMQProtocolSession.cs277
-rw-r--r--Final/dotnet/Qpid.Client/Client/Protocol/DefaultTimeouts.cs47
-rw-r--r--Final/dotnet/Qpid.Client/Client/Protocol/IConnectionCloser.cs27
-rw-r--r--Final/dotnet/Qpid.Client/Client/Protocol/IProtocolListener.cs36
-rw-r--r--Final/dotnet/Qpid.Client/Client/Protocol/Listener/BlockingMethodFrameListener.cs110
-rw-r--r--Final/dotnet/Qpid.Client/Client/Protocol/Listener/IAMQMethodListener.cs46
-rw-r--r--Final/dotnet/Qpid.Client/Client/Protocol/Listener/SpecificMethodFrameListener.cs42
-rw-r--r--Final/dotnet/Qpid.Client/Client/Protocol/ProtocolWriter.cs107
-rw-r--r--Final/dotnet/Qpid.Client/Client/QpidConnectionInfo.cs504
-rw-r--r--Final/dotnet/Qpid.Client/Client/Security/CallbackHandlerRegistry.cs127
-rw-r--r--Final/dotnet/Qpid.Client/Client/Security/IAMQCallbackHandler.cs35
-rw-r--r--Final/dotnet/Qpid.Client/Client/Security/UsernamePasswordCallbackHandler.cs56
-rw-r--r--Final/dotnet/Qpid.Client/Client/SslOptions.cs81
-rw-r--r--Final/dotnet/Qpid.Client/Client/State/AMQState.cs35
-rw-r--r--Final/dotnet/Qpid.Client/Client/State/AMQStateChangedEvent.cs52
-rw-r--r--Final/dotnet/Qpid.Client/Client/State/AMQStateManager.cs251
-rw-r--r--Final/dotnet/Qpid.Client/Client/State/IAMQStateListener.cs29
-rw-r--r--Final/dotnet/Qpid.Client/Client/State/IStateAwareMethodListener.cs31
-rw-r--r--Final/dotnet/Qpid.Client/Client/State/IStateListener.cs33
-rw-r--r--Final/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs74
-rw-r--r--Final/dotnet/Qpid.Client/Client/State/StateWaiter.cs121
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/AMQProtocolProvider.cs47
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/AmqpChannel.cs111
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/IByteChannel.cs71
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/IProtocolChannel.cs32
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/IProtocolWriter.cs29
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/IStreamFilter.cs38
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/ITransport.cs32
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/IoHandler.cs322
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/ProtocolDecoderOutput.cs60
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/SingleProtocolEncoderOutput.cs40
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/BlockingSocketTransport.cs150
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ByteChannel.cs92
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ISocketConnector.cs34
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SocketConnector.cs71
-rw-r--r--Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SslSocketConnector.cs107
-rw-r--r--Final/dotnet/Qpid.Client/Client/Util/FlowControlQueue.cs98
-rw-r--r--Final/dotnet/Qpid.Client/Properties/AssemblyInfo.cs52
-rw-r--r--Final/dotnet/Qpid.Client/Qpid.Client.csproj163
-rw-r--r--Final/dotnet/Qpid.Client/default.build31
-rw-r--r--Final/dotnet/Qpid.Client/qms/BrokerInfo.cs55
-rw-r--r--Final/dotnet/Qpid.Client/qms/ConnectionInfo.cs63
-rw-r--r--Final/dotnet/Qpid.Client/qms/FailoverPolicy.cs315
-rw-r--r--Final/dotnet/Qpid.Client/qms/UrlSyntaxException.cs134
-rw-r--r--Final/dotnet/Qpid.Client/qms/failover/FailoverMethod.cs78
-rw-r--r--Final/dotnet/Qpid.Client/qms/failover/FailoverRoundRobin.cs255
-rw-r--r--Final/dotnet/Qpid.Client/qms/failover/FailoverSingleServer.cs147
-rw-r--r--Final/dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs152
-rw-r--r--Final/dotnet/Qpid.Codec/Demux/DemuxingProtocolCodecFactory.cs387
-rw-r--r--Final/dotnet/Qpid.Codec/Demux/IMessageDecoder.cs56
-rw-r--r--Final/dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs32
-rw-r--r--Final/dotnet/Qpid.Codec/Demux/IMessageEncoder.cs48
-rw-r--r--Final/dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs32
-rw-r--r--Final/dotnet/Qpid.Codec/Demux/MessageDecoderResult.cs29
-rw-r--r--Final/dotnet/Qpid.Codec/IProtocolCodecFactory.cs37
-rw-r--r--Final/dotnet/Qpid.Codec/IProtocolDecoder.cs41
-rw-r--r--Final/dotnet/Qpid.Codec/IProtocolDecoderOutput.cs35
-rw-r--r--Final/dotnet/Qpid.Codec/IProtocolEncoder.cs41
-rw-r--r--Final/dotnet/Qpid.Codec/IProtocolEncoderOutput.cs37
-rw-r--r--Final/dotnet/Qpid.Codec/Properties/AssemblyInfo.cs53
-rw-r--r--Final/dotnet/Qpid.Codec/ProtocolCodecException.cs49
-rw-r--r--Final/dotnet/Qpid.Codec/ProtocolDecoderException.cs70
-rw-r--r--Final/dotnet/Qpid.Codec/ProtocolEncoderException.cs49
-rw-r--r--Final/dotnet/Qpid.Codec/Qpid.Codec.csproj73
-rw-r--r--Final/dotnet/Qpid.Codec/Support/SimpleProtocolDecoderOutput.cs44
-rw-r--r--Final/dotnet/Qpid.Codec/Support/SimpleProtocolEncoderOutput.cs43
-rw-r--r--Final/dotnet/Qpid.Codec/default.build26
-rw-r--r--Final/dotnet/Qpid.Common.Tests/Properties/AssemblyInfo.cs33
-rw-r--r--Final/dotnet/Qpid.Common.Tests/Qpid.Common.Tests.csproj65
-rw-r--r--Final/dotnet/Qpid.Common.Tests/Qpid/Collections/TestConsumerProducerQueue.cs85
-rw-r--r--Final/dotnet/Qpid.Common.Tests/Qpid/Collections/TestLinkedHashtable.cs83
-rw-r--r--Final/dotnet/Qpid.Common.Tests/Qpid/Framing/TestAMQType.cs270
-rw-r--r--Final/dotnet/Qpid.Common.Tests/Qpid/Framing/TestEncodingUtils.cs60
-rw-r--r--Final/dotnet/Qpid.Common.Tests/default.build31
-rw-r--r--Final/dotnet/Qpid.Common/AMQChannelClosedException.cs40
-rw-r--r--Final/dotnet/Qpid.Common/AMQConnectionClosedException.cs51
-rw-r--r--Final/dotnet/Qpid.Common/AMQDisconnectedException.cs45
-rw-r--r--Final/dotnet/Qpid.Common/AMQException.cs149
-rw-r--r--Final/dotnet/Qpid.Common/AMQInvalidArgumentException.cs46
-rw-r--r--Final/dotnet/Qpid.Common/AMQInvalidRoutingKeyException.cs46
-rw-r--r--Final/dotnet/Qpid.Common/AMQUndeliveredException.cs59
-rw-r--r--Final/dotnet/Qpid.Common/AssemblySettings.cs160
-rw-r--r--Final/dotnet/Qpid.Common/Collections/BlockingQueue.cs95
-rw-r--r--Final/dotnet/Qpid.Common/Collections/ConsumerProducerQueue.cs113
-rw-r--r--Final/dotnet/Qpid.Common/Collections/LinkedBlockingQueue.cs384
-rw-r--r--Final/dotnet/Qpid.Common/Collections/LinkedHashtable.cs327
-rw-r--r--Final/dotnet/Qpid.Common/Collections/SynchronousQueue.cs375
-rw-r--r--Final/dotnet/Qpid.Common/Framing/AMQDataBlockDecoder.cs155
-rw-r--r--Final/dotnet/Qpid.Common/Framing/AMQDataBlockEncoder.cs65
-rw-r--r--Final/dotnet/Qpid.Common/Framing/AMQFrame.cs107
-rw-r--r--Final/dotnet/Qpid.Common/Framing/AMQFrameDecodingException.cs59
-rw-r--r--Final/dotnet/Qpid.Common/Framing/AMQMethodBody.cs93
-rw-r--r--Final/dotnet/Qpid.Common/Framing/AMQMethodBodyFactory.cs45
-rw-r--r--Final/dotnet/Qpid.Common/Framing/AMQProtocolHeaderException.cs39
-rw-r--r--Final/dotnet/Qpid.Common/Framing/AMQType.cs700
-rw-r--r--Final/dotnet/Qpid.Common/Framing/AMQTypeMap.cs75
-rw-r--r--Final/dotnet/Qpid.Common/Framing/AMQTypedValue.cs76
-rw-r--r--Final/dotnet/Qpid.Common/Framing/BasicContentHeaderProperties.cs290
-rw-r--r--Final/dotnet/Qpid.Common/Framing/CompositeAMQDataBlock.cs85
-rw-r--r--Final/dotnet/Qpid.Common/Framing/ContentBody.cs100
-rw-r--r--Final/dotnet/Qpid.Common/Framing/ContentBodyFactory.cs53
-rw-r--r--Final/dotnet/Qpid.Common/Framing/ContentHeaderBody.cs118
-rw-r--r--Final/dotnet/Qpid.Common/Framing/ContentHeaderBodyFactory.cs53
-rw-r--r--Final/dotnet/Qpid.Common/Framing/ContentHeaderPropertiesFactory.cs63
-rw-r--r--Final/dotnet/Qpid.Common/Framing/EncodingUtils.cs460
-rw-r--r--Final/dotnet/Qpid.Common/Framing/FieldTable.cs633
-rw-r--r--Final/dotnet/Qpid.Common/Framing/HeartbeatBody.cs64
-rw-r--r--Final/dotnet/Qpid.Common/Framing/HeartbeatBodyFactory.cs32
-rw-r--r--Final/dotnet/Qpid.Common/Framing/IBody.cs63
-rw-r--r--Final/dotnet/Qpid.Common/Framing/IBodyFactory.cs38
-rw-r--r--Final/dotnet/Qpid.Common/Framing/IContentHeaderProperties.cs65
-rw-r--r--Final/dotnet/Qpid.Common/Framing/IDataBlock.cs47
-rw-r--r--Final/dotnet/Qpid.Common/Framing/IEncodableAMQDataBlock.cs31
-rw-r--r--Final/dotnet/Qpid.Common/Framing/ProtocolInitiation.cs155
-rw-r--r--Final/dotnet/Qpid.Common/Properties/AssemblyInfo.cs52
-rw-r--r--Final/dotnet/Qpid.Common/Protocol/AMQConstant.cs100
-rw-r--r--Final/dotnet/Qpid.Common/Qpid.Common.csproj213
-rw-r--r--Final/dotnet/Qpid.Common/amqp.xml3908
-rw-r--r--Final/dotnet/Qpid.Common/build.xml73
-rw-r--r--Final/dotnet/Qpid.Common/default.build28
-rw-r--r--Final/dotnet/Qpid.Common/lib/log4net/log4net-licence.txt201
-rw-r--r--Final/dotnet/Qpid.Common/lib/log4net/log4net.dllbin266240 -> 0 bytes
-rw-r--r--Final/dotnet/Qpid.Common/lib/log4net/log4net.xml28655
-rw-r--r--Final/dotnet/Qpid.Common/lib/saxon/saxon-licence.txt471
-rw-r--r--Final/dotnet/Qpid.Common/lib/saxon/saxon8.jarbin3118502 -> 0 bytes
-rw-r--r--Final/dotnet/Qpid.Common/lib/seclib-1.0.0/Org.Mentalis.Security.dllbin184320 -> 0 bytes
-rw-r--r--Final/dotnet/Qpid.Common/lib/seclib-1.0.0/seclib-license.txt13
-rw-r--r--Final/dotnet/Qpid.Common/resources/registry.template4
-rw-r--r--Final/dotnet/Qpid.Common/stylesheets/csharp.xsl230
-rw-r--r--Final/dotnet/Qpid.Common/stylesheets/framing.xsl44
-rw-r--r--Final/dotnet/Qpid.Common/stylesheets/java.xsl209
-rw-r--r--Final/dotnet/Qpid.Common/stylesheets/prepare1.xsl88
-rw-r--r--Final/dotnet/Qpid.Common/stylesheets/prepare2.xsl47
-rw-r--r--Final/dotnet/Qpid.Common/stylesheets/prepare3.xsl43
-rw-r--r--Final/dotnet/Qpid.Common/stylesheets/readme.txt52
-rw-r--r--Final/dotnet/Qpid.Common/stylesheets/registry.xsl12
-rw-r--r--Final/dotnet/Qpid.Common/stylesheets/utils.xsl164
-rw-r--r--Final/dotnet/Qpid.Messaging/AcknowledgeMode.cs42
-rw-r--r--Final/dotnet/Qpid.Messaging/ChannelLimitReachedException.cs60
-rw-r--r--Final/dotnet/Qpid.Messaging/DeliveryMode.cs28
-rw-r--r--Final/dotnet/Qpid.Messaging/ExchangeClassConstants.cs29
-rw-r--r--Final/dotnet/Qpid.Messaging/ExchangeNameDefaults.cs42
-rw-r--r--Final/dotnet/Qpid.Messaging/IBytesMessage.cs63
-rw-r--r--Final/dotnet/Qpid.Messaging/IChannel.cs231
-rw-r--r--Final/dotnet/Qpid.Messaging/IConnection.cs55
-rw-r--r--Final/dotnet/Qpid.Messaging/IConnectionFactory.cs28
-rw-r--r--Final/dotnet/Qpid.Messaging/IConnectionListener.cs59
-rw-r--r--Final/dotnet/Qpid.Messaging/IFieldTable.cs42
-rw-r--r--Final/dotnet/Qpid.Messaging/IHeaders.cs67
-rw-r--r--Final/dotnet/Qpid.Messaging/IMessage.cs97
-rw-r--r--Final/dotnet/Qpid.Messaging/IMessageConsumer.cs77
-rw-r--r--Final/dotnet/Qpid.Messaging/IMessagePublisher.cs92
-rw-r--r--Final/dotnet/Qpid.Messaging/ITextMessage.cs27
-rw-r--r--Final/dotnet/Qpid.Messaging/MessageConsumerBuilder.cs83
-rw-r--r--Final/dotnet/Qpid.Messaging/MessageNotReadableException.cs39
-rw-r--r--Final/dotnet/Qpid.Messaging/MessageNotWritableException.cs38
-rw-r--r--Final/dotnet/Qpid.Messaging/MessagePublisherBuilder.cs91
-rw-r--r--Final/dotnet/Qpid.Messaging/Properties/AssemblyInfo.cs56
-rw-r--r--Final/dotnet/Qpid.Messaging/Qpid.Messaging.csproj69
-rw-r--r--Final/dotnet/Qpid.Messaging/QpidException.cs43
-rw-r--r--Final/dotnet/Qpid.Messaging/ResourceAllocationException.cs39
-rw-r--r--Final/dotnet/Qpid.Messaging/default.build24
-rw-r--r--Final/dotnet/Qpid.NET.FxCop16755
-rw-r--r--Final/dotnet/Qpid.NET.sln87
-rw-r--r--Final/dotnet/Qpid.Sasl.Tests/App.config12
-rw-r--r--Final/dotnet/Qpid.Sasl.Tests/Mechanisms/AnonymousSaslClientTests.cs72
-rw-r--r--Final/dotnet/Qpid.Sasl.Tests/Mechanisms/CramMD5SaslClientTests.cs90
-rw-r--r--Final/dotnet/Qpid.Sasl.Tests/Mechanisms/DigestSaslClientTests.cs249
-rw-r--r--Final/dotnet/Qpid.Sasl.Tests/Mechanisms/ExternalSaslClientTests.cs71
-rw-r--r--Final/dotnet/Qpid.Sasl.Tests/Mechanisms/PlainSaslClientTests.cs88
-rw-r--r--Final/dotnet/Qpid.Sasl.Tests/Properties/AssemblyInfo.cs35
-rw-r--r--Final/dotnet/Qpid.Sasl.Tests/Qpid.Sasl.Tests.csproj67
-rw-r--r--Final/dotnet/Qpid.Sasl.Tests/SaslTests.cs133
-rw-r--r--Final/dotnet/Qpid.Sasl.Tests/TestClientFactory.cs75
-rw-r--r--Final/dotnet/Qpid.Sasl.Tests/default.build31
-rw-r--r--Final/dotnet/Qpid.Sasl/Callbacks.cs106
-rw-r--r--Final/dotnet/Qpid.Sasl/Configuration/SaslConfiguration.cs90
-rw-r--r--Final/dotnet/Qpid.Sasl/Configuration/SaslConfigurationSectionHandler.cs84
-rw-r--r--Final/dotnet/Qpid.Sasl/DefaultClientFactory.cs95
-rw-r--r--Final/dotnet/Qpid.Sasl/ISaslCallbackHandler.cs35
-rw-r--r--Final/dotnet/Qpid.Sasl/ISaslClient.cs42
-rw-r--r--Final/dotnet/Qpid.Sasl/ISaslClientFactory.cs40
-rw-r--r--Final/dotnet/Qpid.Sasl/MD5HMAC.cs115
-rw-r--r--Final/dotnet/Qpid.Sasl/Mechanisms/AnonymousSaslClient.cs69
-rw-r--r--Final/dotnet/Qpid.Sasl/Mechanisms/CramMD5SaslClient.cs91
-rw-r--r--Final/dotnet/Qpid.Sasl/Mechanisms/DigestSaslClient.cs576
-rw-r--r--Final/dotnet/Qpid.Sasl/Mechanisms/ExternalSaslClient.cs69
-rw-r--r--Final/dotnet/Qpid.Sasl/Mechanisms/PlainSaslClient.cs81
-rw-r--r--Final/dotnet/Qpid.Sasl/Properties/AssemblyInfo.cs37
-rw-r--r--Final/dotnet/Qpid.Sasl/Qpid.Sasl.csproj64
-rw-r--r--Final/dotnet/Qpid.Sasl/Sasl.cs115
-rw-r--r--Final/dotnet/Qpid.Sasl/SaslClient.cs145
-rw-r--r--Final/dotnet/Qpid.Sasl/SaslException.cs56
-rw-r--r--Final/dotnet/Qpid.Sasl/SaslProperties.cs42
-rw-r--r--Final/dotnet/Qpid.Sasl/default.build24
-rw-r--r--Final/dotnet/README.txt71
-rw-r--r--Final/dotnet/RELEASE_NOTES.txt67
-rw-r--r--Final/dotnet/TODO.txt6
-rw-r--r--Final/dotnet/TestClient/Program.cs10
-rw-r--r--Final/dotnet/TestClient/Properties/AssemblyInfo.cs33
-rw-r--r--Final/dotnet/TestClient/TestClient.csproj89
-rw-r--r--Final/dotnet/TestClient/default.build26
-rw-r--r--Final/dotnet/TopicListener/Program.cs10
-rw-r--r--Final/dotnet/TopicListener/Properties/AssemblyInfo.cs33
-rw-r--r--Final/dotnet/TopicListener/TopicListener.csproj89
-rw-r--r--Final/dotnet/TopicListener/default.build26
-rw-r--r--Final/dotnet/TopicPublisher/Program.cs10
-rw-r--r--Final/dotnet/TopicPublisher/Properties/AssemblyInfo.cs33
-rw-r--r--Final/dotnet/TopicPublisher/TopicPublisher.csproj85
-rw-r--r--Final/dotnet/TopicPublisher/default.build26
-rw-r--r--Final/dotnet/build-dotnet111
-rw-r--r--Final/dotnet/build-dotnet11.bat1
-rw-r--r--Final/dotnet/build-dotnet203
-rw-r--r--Final/dotnet/build-framing2
-rw-r--r--Final/dotnet/build-framing.bat2
-rwxr-xr-xFinal/dotnet/build-mono1
-rw-r--r--Final/dotnet/default.build135
-rwxr-xr-xFinal/dotnet/release13
-rw-r--r--Final/etc/svn-auto-props77
-rw-r--r--Final/gentools/README61
-rwxr-xr-xFinal/gentools/build15
-rw-r--r--Final/gentools/build.xml34
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpClass.java148
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpClassMap.java29
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpConstant.java205
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java133
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpDomain.java78
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java119
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java58
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpField.java156
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.java348
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.java71
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpMethod.java202
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpMethodMap.java36
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpModel.java80
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpOrdinalFieldMap.java89
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.java72
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpOverloadedParameterMap.java29
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpParseException.java30
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpTemplateException.java30
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpTypeMappingException.java30
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpVersion.java68
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.java74
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/CppGenerator.java1628
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/DotnetGenerator.java340
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/Generator.java429
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/JavaGenerator.java1694
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/LanguageConverter.java39
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/Main.java353
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/NodeAware.java46
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/Printable.java28
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/TargetDirectoryException.java30
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/Utils.java146
-rw-r--r--Final/gentools/src/org/apache/qpid/gentools/VersionConsistencyCheck.java26
-rw-r--r--Final/gentools/templ.cpp/AMQP_ClientOperations.h.tmpl82
-rw-r--r--Final/gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl52
-rw-r--r--Final/gentools/templ.cpp/AMQP_ClientProxy.h.tmpl75
-rw-r--r--Final/gentools/templ.cpp/AMQP_Constants.h.tmpl34
-rw-r--r--Final/gentools/templ.cpp/AMQP_HighestVersion.h.tmpl42
-rw-r--r--Final/gentools/templ.cpp/AMQP_MethodVersionMap.cpp.tmpl62
-rw-r--r--Final/gentools/templ.cpp/AMQP_MethodVersionMap.h.tmpl57
-rw-r--r--Final/gentools/templ.cpp/AMQP_ServerOperations.h.tmpl83
-rw-r--r--Final/gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl51
-rw-r--r--Final/gentools/templ.cpp/AMQP_ServerProxy.h.tmpl74
-rw-r--r--Final/gentools/templ.cpp/MethodBodyClass.h.tmpl112
-rw-r--r--Final/gentools/templ.java/AmqpConstantsClass.tmpl37
-rw-r--r--Final/gentools/templ.java/MethodBodyClass.tmpl183
-rw-r--r--Final/gentools/templ.java/MethodRegistryClass.tmpl159
-rw-r--r--Final/gentools/templ.java/PropertyContentHeaderClass.tmpl208
-rw-r--r--Final/gentools/templ.java/ProtocolVersionListClass.tmpl127
-rw-r--r--Final/gentools/xml-src/amqp-0.10.test.xml4241
-rw-r--r--Final/gentools/xml-src/amqp-0.8.test.xml3959
-rw-r--r--Final/gentools/xml-src/amqp-0.9.test.xml4282
-rw-r--r--Final/gentools/xml-src/cluster-0.9.test.xml59
-rwxr-xr-xFinal/java/broker/bin/msTool.sh60
-rw-r--r--Final/java/broker/bin/qpid-passwd30
-rw-r--r--Final/java/broker/bin/qpid-server31
-rw-r--r--Final/java/broker/bin/qpid-server-bdb.bat22
-rw-r--r--Final/java/broker/bin/qpid-server.bat70
-rw-r--r--Final/java/broker/bin/qpid.start21
-rw-r--r--Final/java/broker/bin/qpid.stop137
-rw-r--r--Final/java/broker/bin/qpid.stopall74
-rwxr-xr-xFinal/java/broker/bin/run.bat31
-rwxr-xr-xFinal/java/broker/bin/run.sh44
-rw-r--r--Final/java/broker/bin/runAll37
-rw-r--r--Final/java/broker/distribution/pom.xml153
-rw-r--r--Final/java/broker/distribution/src/main/assembly/broker-bin-tests.xml116
-rw-r--r--Final/java/broker/distribution/src/main/assembly/broker-bin.xml183
-rw-r--r--Final/java/broker/distribution/src/main/assembly/broker-src.xml78
-rw-r--r--Final/java/broker/etc/access19
-rw-r--r--Final/java/broker/etc/config.xml175
-rw-r--r--Final/java/broker/etc/debug.log4j.xml114
-rw-r--r--Final/java/broker/etc/jmxremote.access23
-rw-r--r--Final/java/broker/etc/log4j.xml112
-rw-r--r--Final/java/broker/etc/md5passwd21
-rw-r--r--Final/java/broker/etc/mstool-log4j.xml54
-rw-r--r--Final/java/broker/etc/passwd19
-rw-r--r--Final/java/broker/etc/passwdVhost19
-rw-r--r--Final/java/broker/etc/persistent_config.xml132
-rw-r--r--Final/java/broker/etc/qpid-server.conf25
-rw-r--r--Final/java/broker/etc/qpid-server.conf.jpp49
-rw-r--r--Final/java/broker/etc/qpid.passwd22
-rw-r--r--Final/java/broker/etc/transient_config.xml128
-rw-r--r--Final/java/broker/etc/virtualhosts.xml123
-rw-r--r--Final/java/broker/pom.xml256
-rwxr-xr-xFinal/java/broker/python-test.xml56
-rw-r--r--Final/java/broker/src/main/grammar/SelectorParser.jj604
-rw-r--r--Final/java/broker/src/main/java/log4j.properties24
-rw-r--r--Final/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java1007
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/configuration/Configuration.java188
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java244
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java989
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/ConsumerTagNotUniqueException.java25
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/Main.java521
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/ManagedChannel.java68
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.java68
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/ack/TxAck.java139
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessage.java79
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMap.java80
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java235
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/configuration/Configurator.java118
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java269
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java217
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java75
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java138
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DestNameExchange.java229
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java426
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java97
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java32
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java45
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java51
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java209
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java219
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java323
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.java90
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java98
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/MessageRouter.java40
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.java48
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java275
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java106
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java40
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java595
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/ConstantExpression.java210
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java37
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManager.java37
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java77
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java68
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java110
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/MessageFilter.java29
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java42
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java322
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java76
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.java337
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/XPathExpression.java126
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/XQueryExpression.java57
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/filter/XalanXPathEvaluator.java102
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicAckMethodHandler.java67
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicCancelMethodHandler.java79
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java173
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.java95
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java105
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicQosHandler.java58
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverMethodHandler.java64
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.java130
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseHandler.java78
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseOkHandler.java53
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelFlowHandler.java72
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelOpenHandler.java61
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseMethodHandler.java71
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseOkMethodHandler.java63
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java118
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionSecureOkMethodHandler.java141
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java173
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionTuneOkMethodHandler.java54
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java205
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeclareHandler.java114
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeleteHandler.java70
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/OnCurrentThreadExecutor.java34
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java135
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java206
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java122
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueuePurgeHandler.java115
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/TxCommitHandler.java77
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/TxRollbackHandler.java73
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/handler/TxSelectHandler.java63
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/jms/JmsConsumer.java110
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/AMQManagedObject.java97
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java191
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java283
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanAttribute.java41
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanConstructor.java39
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanDescription.java38
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanIntrospector.java388
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java239
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperation.java43
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperationParameter.java37
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/Managable.java34
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java98
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObject.java58
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObjectRegistry.java48
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/ManagementConfiguration.java30
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/management/NoopManagedObjectRegistry.java60
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverter.java57
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverterRegistry.java62
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.java282
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java773
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQNoMethodHandlerException.java46
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java240
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPProtocolProvider.java52
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java175
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java305
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.java49
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/protocol/HeartbeatConfig.java67
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java135
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/protocol/UnknnownMessageTypeException.java46
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java1000
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessageHandle.java79
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java940
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java471
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/AsyncDeliveryConfig.java56
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/ConcurrentSelectorDeliveryManager.java1049
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java71
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/DeliveryManager.java100
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java137
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java50
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/InMemoryMessageHandle.java143
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java245
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java52
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/MessageHandleFactory.java46
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/MessageMetaData.java92
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/NoConsumersException.java47
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java138
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/QueueNotificationListener.java27
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java43
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/Subscription.java63
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionFactory.java43
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java680
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionManager.java34
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionSet.java229
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java121
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.java227
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/queue/WeightedSubscriptionManager.java26
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java213
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java176
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java71
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AMQUserManagementMBean.java467
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessManager.java34
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessManagerImpl.java155
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessResult.java66
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessRights.java63
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/access/Accessable.java27
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AllowAll.java42
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/access/DenyAll.java41
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/access/FileAccessManager.java183
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/access/PrincipalDatabaseAccessManager.java108
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/access/UserManagement.java118
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/access/VirtualHostAccess.java68
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java43
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java599
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java236
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java240
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordVhostFilePrincipalDatabase.java130
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java100
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java34
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabase.java160
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java48
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java37
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java249
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java76
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/JCAProvider.java47
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java123
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePrincipal.java44
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java38
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java129
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java60
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java50
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java105
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java61
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java71
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java38
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java149
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java60
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/state/AMQState.java36
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java284
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/state/IllegalStateTransitionException.java52
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/state/StateAwareMethodListener.java35
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/state/StateListener.java30
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java209
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java261
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/store/StoreContext.java68
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/transport/ConnectorConfiguration.java97
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java705
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/txn/CleanupMessageOperation.java77
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/txn/LocalTransactionalContext.java262
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/txn/NonTransactionalContext.java227
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/txn/StoreMessageOperation.java58
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/txn/TransactionalContext.java171
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/txn/TxnBuffer.java109
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/txn/TxnOp.java55
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/util/CircularBuffer.java131
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/util/ConcurrentLinkedQueueNoSize.java38
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/util/LoggingProxy.java105
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java122
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java44
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java259
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java70
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/MessageStoreTool.java652
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/AbstractCommand.java66
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Clear.java85
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Command.java36
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Copy.java55
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Dump.java299
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Help.java98
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/List.java314
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Load.java94
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Move.java205
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Purge.java68
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Quit.java54
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Select.java233
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Show.java513
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/security/Passwd.java81
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/utils/CommandParser.java51
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/utils/Console.java90
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleCommandParser.java121
-rw-r--r--Final/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleConsole.java363
-rw-r--r--Final/java/broker/src/test/java/org/apache/qpid/server/RunBrokerWithCommand.java130
-rw-r--r--Final/java/broker/src/test/java/org/apache/qpid/server/configuration/TestPropertyUtils.java50
-rw-r--r--Final/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java607
-rw-r--r--Final/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java138
-rw-r--r--Final/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java199
-rw-r--r--Final/java/broker/src/test/java/org/apache/qpid/server/protocol/TestIoSession.java295
-rw-r--r--Final/java/broker/src/test/java/org/apache/qpid/server/protocol/TestMinaProtocolSession.java52
-rw-r--r--Final/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java301
-rw-r--r--Final/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java300
-rw-r--r--Final/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java73
-rw-r--r--Final/java/broker/src/test/java/org/apache/qpid/server/util/LoggingProxyTest.java88
-rw-r--r--Final/java/client-java14/README.txt33
-rw-r--r--Final/java/client-java14/etc/sasl.properties20
-rw-r--r--Final/java/client-java14/pom.xml224
-rw-r--r--Final/java/client-java14/src/main/assembly/client-java14-bin.xml74
-rw-r--r--Final/java/client-java14/src/main/assembly/jar-with-dependencies.xml104
-rw-r--r--Final/java/client-java14/src/main/java/org/apache/qpid/sasl/ClientFactoryImpl.java343
-rw-r--r--Final/java/client-java14/src/main/java/org/apache/qpid/sasl/CramMD5Client.java347
-rw-r--r--Final/java/client-java14/src/main/java/org/apache/qpid/sasl/PlainClient.java275
-rw-r--r--Final/java/client-java14/src/main/java/org/apache/qpid/sasl/Provider.java61
-rw-r--r--Final/java/client-java14/src/test/java/org/apache/qpid/test/integration/client/ConnectionTest.java66
-rw-r--r--Final/java/client/distribution/pom.xml156
-rw-r--r--Final/java/client/distribution/src/main/assembly/client-bin-tests.xml107
-rw-r--r--Final/java/client/distribution/src/main/assembly/client-bin.xml78
-rw-r--r--Final/java/client/distribution/src/main/assembly/client-java1.4-bin.xml74
-rw-r--r--Final/java/client/distribution/src/main/assembly/client-src.xml62
-rw-r--r--Final/java/client/example/bin/set_classpath.bat50
-rwxr-xr-xFinal/java/client/example/bin/set_classpath.sh83
-rw-r--r--Final/java/client/example/pom.xml152
-rw-r--r--Final/java/client/example/source-jar.xml35
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/log4j.xml45
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageDispatcher.java162
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageFactory.java136
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.java54
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorMessageDispatcher.java141
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorPublisher.java104
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java181
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.java57
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Client.java72
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/pubsub/ConnectionSetup.java123
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Publisher.java81
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Subscriber.java98
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.java54
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.java54
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/shared/FileUtils.java168
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.java80
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/shared/Statics.java57
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/shared/example.properties39
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java139
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriptionWrapper.java51
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java181
-rw-r--r--Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/SubscriptionWrapper.java51
-rw-r--r--Final/java/client/pom.xml249
-rw-r--r--Final/java/client/src/main/java/client.log4j28
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java42
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java353
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java1289
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java409
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQConnectionURL.java455
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java451
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java59
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQNoConsumersException.java40
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQNoRouteException.java40
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQQueue.java149
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java136
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQQueueSessionAdaptor.java204
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQSession.java2800
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQSessionAdapter.java26
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java69
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryTopic.java72
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java115
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQTopicSessionAdaptor.java226
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/AMQUndefinedDestination.java45
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java996
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java691
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/Closeable.java83
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/ConnectionTuneParameters.java72
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.java65
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/DispatcherCallback.java36
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/JMSAMQException.java65
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/JmsNotImplementedException.java31
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/MessageConsumerPair.java43
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/QpidConnectionMetaData.java97
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/QueueReceiverAdaptor.java115
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/QueueSenderAdapter.java230
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/SSLConfiguration.java61
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/TemporaryDestination.java38
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/TopicPublisherAdapter.java205
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/TopicSubscriberAdaptor.java126
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverException.java49
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java240
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverNoopSupport.java75
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverProtectedOperation.java49
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.java128
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverState.java64
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverSupport.java47
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/BasicCancelOkMethodHandler.java59
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/BasicDeliverMethodHandler.java52
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/BasicReturnMethodHandler.java53
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java105
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseOkMethodHandler.java50
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/ChannelFlowOkMethodHandler.java52
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionCloseMethodHandler.java102
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.java48
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionRedirectMethodHandler.java73
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionSecureMethodHandler.java73
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java239
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java97
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/ExchangeBoundOkMethodHandler.java59
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/handler/QueueDeleteOkMethodHandler.java58
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/AMQMessage.java135
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java151
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesTypedMessage.java801
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.java685
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java103
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessage.java388
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessageFactory.java43
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/JMSHeaderAdapter.java552
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java507
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessageFactory.java43
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java197
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessageFactory.java43
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java204
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessageFactory.java43
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessage.java201
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessageFactory.java46
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/MessageConverter.java202
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/MessageFactory.java41
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java127
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/UnexpectedBodyReceivedException.java45
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.java131
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java732
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java459
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.java311
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatConfig.java61
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatDiagnostics.java121
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/protocol/ProtocolBufferMonitorFilter.java115
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/security/AMQCallbackHandler.java30
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.java231
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.properties21
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.java198
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.properties20
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/security/JCAProvider.java71
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/security/UsernameHashedPasswordCallbackHandler.java102
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/security/UsernamePasswordCallbackHandler.java60
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClient.java105
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClientFactory.java63
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/security/crammd5hashed/CRAMMD5HashedSaslClientFactory.java72
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/state/AMQState.java56
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/state/AMQStateChangedEvent.java48
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/state/AMQStateListener.java26
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java276
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/state/IllegalStateTransitionException.java53
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/state/StateAwareMethodListener.java36
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/state/StateListener.java30
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/state/StateWaiter.java122
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/state/listener/SpecificMethodFrameListener.java57
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.java62
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.java41
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/transport/ITransportConnection.java32
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/transport/SocketTransportConnection.java101
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/transport/TransportConnection.java318
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/transport/VmPipeTransportConnection.java65
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java109
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.java58
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/BrokerDetails.java74
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/ChannelLimitReachedException.java46
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/Connection.java69
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/ConnectionListener.java58
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/ConnectionURL.java86
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.java324
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/Message.java28
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/MessageConsumer.java27
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/MessageProducer.java53
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/Session.java101
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverMethod.java76
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java261
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java147
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jndi/Example.properties39
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jndi/NameParserImpl.java37
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java337
-rw-r--r--Final/java/client/src/main/java/org/apache/qpid/jndi/ReadOnlyContext.java527
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindConnectionFactory.java185
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindQueue.java213
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindTopic.java212
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/README.txt11
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/cluster/Client.java129
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/codec/BasicDeliverTest.java277
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/codec/Client.java133
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/codec/Server.java103
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java35
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/config/AbstractConfig.java69
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java29
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/config/Connector.java40
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/config/ConnectorConfig.java28
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java111
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/flow/ChannelFlowTest.java112
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargePublisher.java196
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargeSubscriber.java167
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/headers/Listener.java117
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/headers/MessageFactory.java175
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/headers/Publisher.java133
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Bind.java273
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Lookup.java196
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Unbind.java166
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/latency/LatencyTest.java153
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/mina/AcceptorTest.java102
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/mina/BlockingAcceptorTest.java93
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/mina/WriterTest.java271
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/multiconsumer/AMQTest.java269
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestPublisher.java176
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestSubscriber.java122
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/test/unit/client/connection/TestManyConnections.java95
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/PropertiesFileInitialContextFactoryTest.java153
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/example.properties38
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/topic/Config.java243
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/topic/Listener.java141
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/topic/MessageFactory.java155
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/topic/Publisher.java175
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/transacted/Config.java110
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/transacted/Ping.java45
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/transacted/Pong.java45
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/transacted/Relay.java127
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/transacted/Start.java44
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceProvider.java151
-rw-r--r--Final/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceRequestingClient.java185
-rw-r--r--Final/java/client/src/test/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java125
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java152
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/client/DispatcherTest.java252
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/client/MessageListenerMultiConsumerImmediatePrefetch.java44
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.java252
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/client/MessageListenerTest.java195
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/client/ResetMessageListenerTest.java277
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/client/SpecificMethodFrameListenerTest.java71
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/client/message/NonQpidObjectMessage.java234
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/client/message/TestMessageHelper.java46
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/ack/RecoverTest.java335
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/BytesMessageTest.java288
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableKeyEnumeratorTest.java96
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableMessageTest.java176
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTablePropertyTest.java62
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.java130
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java194
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java1277
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java231
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/ObjectMessageTest.java276
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java369
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/PubSubTwoConnectionTest.java77
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/ReceiveTest.java115
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/SelectorTest.java140
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/SessionStartTest.java122
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/TextMessageTest.java257
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/close/CloseTests.java80
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java205
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/AMQSessionTest.java115
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java94
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java100
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java235
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java412
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java87
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/NoCloseOKStateManager.java107
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java175
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java194
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java481
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java145
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Client.java123
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java68
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Service.java84
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/ServiceCreator.java112
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/SpecialQueue.java46
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/BytesMessageTest.java569
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/MapMessageTest.java383
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java345
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/StreamMessageTest.java623
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/TextMessageTest.java300
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/protocol/TestIoSession.java104
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java232
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.java147
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java389
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.java72
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java94
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java108
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/message/MessageConverterTest.java138
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/message/NonQpidMessage.java411
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.java160
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java192
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.java80
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java375
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java532
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java313
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/testutil/Config.java199
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java287
-rw-r--r--Final/java/client/src/test/java/org/apache/qpid/testutil/VMBrokerSetup.java52
-rw-r--r--Final/java/client/test/bin/IBM-JNDI-Setup.bat69
-rwxr-xr-xFinal/java/client/test/bin/IBM-JNDI-Setup.sh27
-rw-r--r--Final/java/client/test/bin/IBM-Publisher.bat62
-rwxr-xr-xFinal/java/client/test/bin/IBM-Publisher.sh22
-rw-r--r--Final/java/client/test/bin/IBM-PutGet.bat62
-rwxr-xr-xFinal/java/client/test/bin/IBM-PutGet.sh21
-rw-r--r--Final/java/client/test/bin/IBM-README.txt19
-rw-r--r--Final/java/client/test/bin/IBM-Receiver.bat62
-rwxr-xr-xFinal/java/client/test/bin/IBM-Receiver.sh22
-rw-r--r--Final/java/client/test/bin/IBM-Sender.bat62
-rwxr-xr-xFinal/java/client/test/bin/IBM-Sender.sh22
-rw-r--r--Final/java/client/test/bin/IBM-Subscriber.bat62
-rwxr-xr-xFinal/java/client/test/bin/IBM-Subscriber.sh22
-rwxr-xr-xFinal/java/client/test/bin/headersListener.sh22
-rwxr-xr-xFinal/java/client/test/bin/headersListenerGroup.sh25
-rwxr-xr-xFinal/java/client/test/bin/headersPublisher.sh22
-rwxr-xr-xFinal/java/client/test/bin/run_many.sh30
-rwxr-xr-xFinal/java/client/test/bin/serviceProvidingClient.sh24
-rwxr-xr-xFinal/java/client/test/bin/serviceRequestingClient.sh27
-rwxr-xr-xFinal/java/client/test/bin/testService.sh22
-rwxr-xr-xFinal/java/client/test/bin/topicListener.sh23
-rwxr-xr-xFinal/java/client/test/bin/topicPublisher.sh22
-rw-r--r--Final/java/client/test/etc/ApacheDS.properties24
-rw-r--r--Final/java/client/test/example_build.xml104
-rw-r--r--Final/java/cluster/doc/design.docbin70144 -> 0 bytes
-rw-r--r--Final/java/cluster/pom.xml69
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java42
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java46
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java45
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BlockingHandler.java91
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BroadcastPolicy.java26
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Broker.java247
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BrokerFactory.java26
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BrokerGroup.java368
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientAdapter.java73
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java130
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusterBuilder.java63
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusterCapability.java60
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusteredProtocolHandler.java190
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusteredProtocolSession.java133
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ConnectionStatusMonitor.java80
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/DefaultGroupManager.java396
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/GroupManager.java72
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/GroupRequest.java107
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/GroupResponseHandler.java31
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/InductionBuffer.java90
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/JoinState.java26
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/LoadTable.java107
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Main.java117
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Member.java31
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MemberFailureListener.java26
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MemberHandle.java36
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MembershipChangeListener.java28
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MethodHandler.java29
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MethodHandlerFactory.java28
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MethodHandlerRegistry.java44
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MinaBrokerProxy.java272
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MinaBrokerProxyFactory.java36
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ResponseHandler.java30
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Sendable.java28
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java98
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleBodySendable.java48
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleMemberHandle.java166
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleSendable.java55
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ChainedClusterMethodHandler.java73
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ChannelQueueManager.java136
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ClusterMethodHandler.java51
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ClusterMethodHandlerFactory.java239
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ExtendedHandler.java55
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/HandlerUtils.java25
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/LocalQueueDeclareHandler.java79
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/NullListener.java38
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/PeerHandler.java60
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/QueueNameGenerator.java62
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/RemoteCancelHandler.java59
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/RemoteConsumeHandler.java69
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ReplicatingConsumeHandler.java90
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ReplicatingHandler.java125
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappedListener.java56
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappingMethodHandlerFactory.java85
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/AsynchBroadcastPolicy.java31
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/MajorityResponseBroadcastPolicy.java31
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/OneResponseBroadcastPolicy.java31
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/StandardPolicies.java29
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/SynchBroadcastPolicy.java31
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ChainedMethodRecorder.java48
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.java83
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/MethodRecorder.java32
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/RecordingMethodHandlerFactory.java77
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayManager.java37
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.java311
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/Bindings.java83
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/InvokeMultiple.java72
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/LogMessage.java53
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/MultiValuedMap.java61
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredQueue.java175
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredSubscriptionManager.java102
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/queue/NestedSubscriptionManager.java116
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/queue/PrivateQueue.java64
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/queue/ProxiedQueueCleanup.java60
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/queue/RemoteQueueProxy.java91
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/queue/RemoteSubscriptionImpl.java176
-rw-r--r--Final/java/cluster/src/main/java/org/apache/qpid/server/queue/SubscriberCleanup.java56
-rw-r--r--Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerGroupTest.java270
-rw-r--r--Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerTest.java237
-rw-r--r--Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/ClusterCapabilityTest.java43
-rw-r--r--Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/InductionBufferTest.java106
-rw-r--r--Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/RecordingBroker.java53
-rw-r--r--Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/RecordingBrokerFactory.java29
-rw-r--r--Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/SimpleClusterTest.java45
-rw-r--r--Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/SimpleMemberHandleTest.java57
-rw-r--r--Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestBroker.java70
-rw-r--r--Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestBrokerFactory.java29
-rw-r--r--Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestReplayManager.java47
-rw-r--r--Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestSession.java269
-rw-r--r--Final/java/common/bin/qpid-run238
-rw-r--r--Final/java/common/etc/qpid-run.conf25
-rw-r--r--Final/java/common/etc/qpid-run.conf.dev26
-rw-r--r--Final/java/common/pom.xml144
-rw-r--r--Final/java/common/protocol-version.xml60
-rw-r--r--Final/java/common/readme.txt4
-rw-r--r--Final/java/common/src/main/java/log4j.properties28
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQChannelClosedException.java41
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQChannelException.java68
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQConnectionClosedException.java44
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java73
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java40
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQDisconnectedException.java39
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQException.java101
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.java39
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQInvalidRoutingKeyException.java39
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQPInvalidClassException.java39
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java39
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.java48
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQUnknownExchangeType.java43
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/AMQUnresolvedAddressException.java50
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/codec/AMQCodecFactory.java77
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java163
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/codec/AMQEncoder.java66
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/common/AMQPFilterTypes.java61
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/common/ClientProperties.java37
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java190
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/configuration/Configured.java44
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java60
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/configuration/PropertyUtils.java164
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java65
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java39
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlock.java53
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java120
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockEncoder.java61
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java75
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java41
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java132
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java46
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java31
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolClassException.java39
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolHeaderException.java41
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolInstanceException.java39
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolVersionException.java39
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java436
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQType.java701
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQTypeMap.java48
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/AMQTypedValue.java80
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java799
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/BodyFactory.java31
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/CommonContentHeaderProperties.java81
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/CompositeAMQDataBlock.java103
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/Content.java26
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java106
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java48
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java123
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java50
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java58
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java57
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/EncodableAMQDataBlock.java35
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java1028
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java1017
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/FieldTableFactory.java38
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java71
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBodyFactory.java31
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/MethodConverter_8_0.java125
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java194
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/SmallCompositeAMQDataBlock.java98
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java198
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/AbstractMethodConverter.java47
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/ContentChunk.java32
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfo.java36
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java32
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java32
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/pool/Event.java155
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/pool/Job.java162
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java471
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/pool/ReadWriteThreadModel.java102
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/pool/ReferenceCountingExecutorService.java145
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java227
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java95
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java69
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/protocol/AMQProtocolWriter.java43
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java46
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java47
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/ssl/SSLContextFactory.java157
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java294
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/url/BindingURL.java56
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/url/URLHelper.java172
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/url/URLSyntaxException.java97
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java689
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedMessageQueueAtomicSize.java250
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueAtomicSize.java70
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueNoSize.java38
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/util/FileUtils.java195
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/util/MessageQueue.java43
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/util/PrettyPrintingUtils.java75
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/util/PropertiesUtils.java200
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/util/ReflectionUtils.java228
-rw-r--r--Final/java/common/src/main/java/org/apache/qpid/util/ReflectionUtilsException.java44
-rw-r--r--Final/java/common/src/main/resources/org/apache/qpid/ssl/qpid.certbin756 -> 0 bytes
-rw-r--r--Final/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java188
-rw-r--r--Final/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java906
-rw-r--r--Final/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java111
-rw-r--r--Final/java/common/src/test/java/org/apache/qpid/session/TestSession.java277
-rw-r--r--Final/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java554
-rw-r--r--Final/java/distribution/pom.xml210
-rw-r--r--Final/java/distribution/src/main/assembly/bin-test.xml120
-rw-r--r--Final/java/distribution/src/main/assembly/bin.xml127
-rw-r--r--Final/java/distribution/src/main/assembly/management-eclipse-plugin-unix.xml131
-rw-r--r--Final/java/distribution/src/main/assembly/management-eclipse-plugin.xml162
-rw-r--r--Final/java/distribution/src/main/assembly/src.xml106
-rw-r--r--Final/java/doc/AMQBlazeDetailedDesign.vsdbin120320 -> 0 bytes
-rw-r--r--Final/java/doc/FramingClassDiagram.vsdbin206848 -> 0 bytes
-rw-r--r--Final/java/etc/coding_standards.xml118
-rw-r--r--Final/java/etc/license_header.txt20
-rw-r--r--Final/java/etc/log4j.xml61
-rw-r--r--Final/java/integrationtests/README.txt13
-rw-r--r--Final/java/integrationtests/docs/RunningSustainedTests.txt17
-rw-r--r--Final/java/integrationtests/jar-with-dependencies.xml47
-rw-r--r--Final/java/integrationtests/pom.xml146
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java135
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java209
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java239
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase4P2PMessageSize.java214
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase5PubSubMessageSize.java243
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java84
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java90
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java88
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase4P2PMessageSize.java193
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase5PubSubMessageSize.java193
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedClientTestCase.java906
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedTestCase.java126
-rw-r--r--Final/java/integrationtests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java463
-rw-r--r--Final/java/integrationtests/src/resources/sustained-log4j.xml69
-rw-r--r--Final/java/management/eclipse-plugin/META-INF/MANIFEST.MF13
-rw-r--r--Final/java/management/eclipse-plugin/README.txt21
-rw-r--r--Final/java/management/eclipse-plugin/bin/qpidmc.bat55
-rwxr-xr-xFinal/java/management/eclipse-plugin/bin/qpidmc.sh64
-rwxr-xr-xFinal/java/management/eclipse-plugin/bin/qpidmc_gtk.sh24
-rwxr-xr-xFinal/java/management/eclipse-plugin/bin/qpidmc_motif.sh24
-rw-r--r--Final/java/management/eclipse-plugin/icons/Thumbs.dbbin97280 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/add.gifbin318 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/delete.gifbin143 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/icon_ClosedFolder.gifbin160 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/icon_OpenFolder.gifbin152 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/mbean_view.pngbin2046 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/notifications.gifbin104 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/qpidConnections.gifbin168 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/qpidmc.gifbin1225 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/qpidmc16.gifbin928 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/qpidmc32.bmpbin1139 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/qpidmc32.gifbin1139 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/reconnect.gifbin327 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/refresh.gifbin182 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/splash.bmpbin207078 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/icons/stop.gifbin215 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/plugin.properties20
-rw-r--r--Final/java/management/eclipse-plugin/plugin.xml223
-rw-r--r--Final/java/management/eclipse-plugin/pom.xml252
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Activator.java84
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Application.java63
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationActionBarAdvisor.java96
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java147
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchAdvisor.java46
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchWindowAdvisor.java65
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java140
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java132
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedObject.java40
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedServer.java103
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Perspective.java46
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java172
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java136
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java274
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/CloseConnection.java56
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/EditAttribute.java51
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java209
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java53
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/RemoveServer.java50
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/VersionAction.java89
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/InfoRequiredException.java36
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/ManagementConsoleException.java31
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java77
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientNotificationListener.java41
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXManagedObject.java48
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java628
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java466
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/AttributeData.java96
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java118
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationInfoModel.java51
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java101
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java110
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationDataModel.java72
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ParameterData.java95
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/CRAMMD5HashedSaslClientFactory.java60
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/ClientSaslFactory.java54
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/JCAProvider.java56
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/PlainSaslClient.java203
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/SaslProvider.java35
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UserPasswordCallbackHandler.java73
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UsernameHashedPasswordCallbackHandler.java82
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java936
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ConnectionTypeTabControl.java59
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ExchangeTypeTabControl.java60
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/INotificationViewer.java32
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java336
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java545
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java1253
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java427
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NumberVerifyListener.java46
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java899
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/QueueTypeTabControl.java296
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java102
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java126
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java483
-rw-r--r--Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java641
-rw-r--r--Final/java/management/eclipse-plugin/src/main/resources/.eclipseproduct23
-rw-r--r--Final/java/management/eclipse-plugin/src/main/resources/eclipse.exebin180224 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/src/main/resources/eclipse.ini4
-rw-r--r--Final/java/management/eclipse-plugin/src/main/resources/license.eclipse.txt88
-rw-r--r--Final/java/management/eclipse-plugin/src/main/resources/sasl/MANIFEST.MF8
-rw-r--r--Final/java/management/eclipse-plugin/src/main/resources/startup.jarbin33049 -> 0 bytes
-rw-r--r--Final/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini27
-rw-r--r--Final/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini26
-rw-r--r--Final/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ManagementConsoleTest.java118
-rw-r--r--Final/java/perftests/RunningPerformanceTests.txt141
-rwxr-xr-xFinal/java/perftests/bin/run_many.sh30
-rwxr-xr-xFinal/java/perftests/bin/topicListener.sh33
-rwxr-xr-xFinal/java/perftests/bin/topicPublisher.sh32
-rw-r--r--Final/java/perftests/dist-zip.xml45
-rw-r--r--Final/java/perftests/distribution/pom.xml131
-rw-r--r--Final/java/perftests/distribution/src/main/assembly/performance.xml103
-rwxr-xr-xFinal/java/perftests/etc/scripts/CTQ-Qpid-1.sh21
-rwxr-xr-xFinal/java/perftests/etc/scripts/CTQ-Qpid-2.sh21
-rwxr-xr-xFinal/java/perftests/etc/scripts/CTQ-Qpid-3.sh21
-rwxr-xr-xFinal/java/perftests/etc/scripts/CTQ-Qpid-4.sh21
-rwxr-xr-xFinal/java/perftests/etc/scripts/CTQ-Qpid-5.sh21
-rwxr-xr-xFinal/java/perftests/etc/scripts/CTQ-Qpid-6.sh21
-rwxr-xr-xFinal/java/perftests/etc/scripts/PT-Qpid-13.sh42
-rwxr-xr-xFinal/java/perftests/etc/scripts/PT-Qpid-14.sh41
-rwxr-xr-xFinal/java/perftests/etc/scripts/sendAndWaitClient.sh22
-rw-r--r--Final/java/perftests/jar-with-dependencies.xml82
-rw-r--r--Final/java/perftests/pom.xml714
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java121
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java35
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java69
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java29
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/config/Connector.java40
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java28
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java112
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/oldtopic/Config.java243
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/oldtopic/Listener.java141
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/oldtopic/MessageFactory.java153
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/oldtopic/Publisher.java175
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/perftests/QpidTestThroughputPerf.java170
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/ping/PingAsyncTestPerf.java292
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java107
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java452
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/ping/PingLatencyTestPerf.java314
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java93
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/ping/PingTestPerf.java196
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongBouncer.java453
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java1688
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongTestPerf.java251
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/topic/Config.java326
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java303
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java157
-rw-r--r--Final/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java186
-rw-r--r--Final/java/perftests/src/main/java/perftests.log4j45
-rw-r--r--Final/java/pom.xml773
-rw-r--r--Final/java/release-docs/RELEASE_NOTES.txt160
-rw-r--r--Final/java/resources/DISCLAIMER5
-rw-r--r--Final/java/resources/LICENSE203
-rw-r--r--Final/java/resources/META-INF/DISCLAIMER10
-rw-r--r--Final/java/resources/META-INF/LICENSE203
-rw-r--r--Final/java/resources/META-INF/NOTICE105
-rw-r--r--Final/java/resources/NOTICE93
-rw-r--r--Final/java/resources/README40
-rw-r--r--Final/java/systests/distribution/pom.xml112
-rw-r--r--Final/java/systests/distribution/src/main/assembly/systests.xml91
-rw-r--r--Final/java/systests/etc/bin/testclients.sh23
-rw-r--r--Final/java/systests/pom.xml111
-rw-r--r--Final/java/systests/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java125
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java92
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java232
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java336
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java101
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.java296
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.java308
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java305
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/failure/DeadlockTest.java211
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java230
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java122
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/protocol/MaxChannelsTest.java78
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/protocol/MockIoSession.java297
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java374
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrencyTestDisabled.java265
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/queue/DeliveryManagerTest.java177
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/queue/MessageReturnTest.java315
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java93
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java205
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java279
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java214
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionManagerTest.java102
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionSetTest.java144
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java160
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/queue/TimeToLiveTest.java166
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java147
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java146
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java73
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java307
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/txn/TxnTest.java188
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/util/AveragedRun.java66
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/util/RunStats.java57
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/util/TestApplicationRegistry.java149
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/server/util/TimedRun.java52
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/VMBrokerSetup.java52
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java128
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTest.java152
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/Assertion.java39
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/AssertionBase.java66
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/Circuit.java109
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEnd.java91
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEndBase.java149
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/DropInTest.java51
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java158
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java280
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkClientBaseCase.java11
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/MessageMonitor.java105
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/MessagingTestConfigProperties.java485
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/Publisher.java56
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/Receiver.java48
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/TestClientDetails.java86
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/TestUtils.java189
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchFailureException.java45
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchThread.java123
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchronizer.java69
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/LocalClockSynchronizer.java73
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockReference.java166
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockSynchronizer.java464
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedCircuitImpl.java469
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedPublisherImpl.java63
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedReceiverImpl.java53
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/TestClientCircuitEnd.java315
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.java532
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestDecorator.java166
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.java245
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.java208
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/OptOutTestCase.java69
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClientControlledTest.java108
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/listeners/XMLTestListener.java399
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalCircuitImpl.java452
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalPublisherImpl.java180
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalReceiverImpl.java100
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/package.html22
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.java128
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.java111
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.java201
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.java145
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnectionHelper.java296
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/util/ClasspathScanner.java234
-rw-r--r--Final/java/systests/src/main/java/org/apache/qpid/util/ConversationFactory.java479
-rw-r--r--Final/java/systests/src/main/java/systests.log4j28
-rw-r--r--Final/java/systests/src/old_test/java/org/apache/qpid/server/exchange/HeadersExchangePerformanceTest.java184
-rw-r--r--Final/java/systests/src/old_test/java/org/apache/qpid/server/protocol/TestProtocolInitiation.java266
-rw-r--r--Final/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueueConcurrentPerfTest.java49
-rw-r--r--Final/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueuePerfTest.java258
-rw-r--r--Final/java/systests/src/old_test/java/org/apache/qpid/server/queue/SendPerfTest.java181
-rw-r--r--Final/java/systests/src/old_test/java/org/apache/qpid/server/util/ConcurrentTest.java79
-rw-r--r--Final/java/systests/src/old_test/java/org/apache/qpid/test/unit/ack/DisconnectAndRedeliverTest.java215
-rwxr-xr-xFinal/python/LICENSE.txt203
-rw-r--r--Final/python/NOTICE.txt20
-rw-r--r--Final/python/README.txt24
-rw-r--r--Final/python/RELEASE_NOTES25
-rwxr-xr-xFinal/python/amqp-doc78
-rw-r--r--Final/python/cpp_failing.txt0
-rw-r--r--Final/python/doc/test-requirements.txt10
-rw-r--r--Final/python/java_failing.txt0
-rwxr-xr-xFinal/python/pal2py274
-rw-r--r--Final/python/qpid/__init__.py20
-rw-r--r--Final/python/qpid/client.py114
-rw-r--r--Final/python/qpid/codec.py224
-rw-r--r--Final/python/qpid/connection.py270
-rw-r--r--Final/python/qpid/content.py50
-rw-r--r--Final/python/qpid/delegate.py54
-rw-r--r--Final/python/qpid/message.py84
-rw-r--r--Final/python/qpid/peer.py210
-rw-r--r--Final/python/qpid/queue.py45
-rw-r--r--Final/python/qpid/spec.py358
-rw-r--r--Final/python/qpid/testlib.py237
-rw-r--r--Final/python/qpid/xmlutil.py119
-rwxr-xr-xFinal/python/rule2test108
-rwxr-xr-xFinal/python/run-tests27
-rw-r--r--Final/python/setup.py25
-rw-r--r--Final/python/tests/__init__.py20
-rw-r--r--Final/python/tests/basic.py431
-rw-r--r--Final/python/tests/broker.py122
-rw-r--r--Final/python/tests/example.py94
-rw-r--r--Final/python/tests/exchange.py327
-rw-r--r--Final/python/tests/queue.py255
-rw-r--r--Final/python/tests/testlib.py66
-rw-r--r--Final/python/tests/tx.py209
-rwxr-xr-xFinal/ruby/LICENSE.txt203
-rw-r--r--Final/ruby/NOTICE.txt19
-rw-r--r--Final/ruby/RELEASE_NOTES19
-rw-r--r--Final/ruby/qpid.rb25
-rw-r--r--Final/ruby/qpid/client.rb135
-rw-r--r--Final/ruby/qpid/codec.rb257
-rw-r--r--Final/ruby/qpid/connection.rb254
-rw-r--r--Final/ruby/qpid/fields.rb49
-rw-r--r--Final/ruby/qpid/peer.rb287
-rw-r--r--Final/ruby/qpid/queue.rb52
-rw-r--r--Final/ruby/qpid/spec.rb289
-rw-r--r--Final/ruby/qpid/test.rb38
-rw-r--r--Final/ruby/qpid/traverse.rb64
-rwxr-xr-xFinal/ruby/run-tests4
-rw-r--r--Final/ruby/tests/basic.rb69
-rw-r--r--Final/ruby/tests/channel.rb48
-rw-r--r--Final/specs/amqp.0-8.xml3996
-rw-r--r--Final/specs/amqp.0-9.xml5185
-rw-r--r--Final/specs/cluster.0-8.xml59
-rw-r--r--Final/specs/cluster.0-9.xml59
1733 files changed, 0 insertions, 313708 deletions
diff --git a/Final/KEYS b/Final/KEYS
deleted file mode 100644
index fabfa79997..0000000000
--- a/Final/KEYS
+++ /dev/null
@@ -1,32 +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-----
diff --git a/Final/bin/set_svn_properties.sh b/Final/bin/set_svn_properties.sh
deleted file mode 100755
index cc29490eea..0000000000
--- a/Final/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/Final/cpp/DESIGN b/Final/cpp/DESIGN
deleted file mode 100644
index 7e9ba6755c..0000000000
--- a/Final/cpp/DESIGN
+++ /dev/null
@@ -1,79 +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/concurrent: concurrecy
- * src/qpid/framing: wire encoding/decoding
- * src/qpid/io: reading/writing
- * 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/Final/cpp/LICENSE b/Final/cpp/LICENSE
deleted file mode 100644
index 6b0b1270ff..0000000000
--- a/Final/cpp/LICENSE
+++ /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/Final/cpp/Makefile.am b/Final/cpp/Makefile.am
deleted file mode 100644
index ffeec27f97..0000000000
--- a/Final/cpp/Makefile.am
+++ /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.
-#
-AUTOMAKE_OPTIONS = 1.9.2 foreign
-ACLOCAL_AMFLAGS = -I m4
-
-EXTRA_DIST = \
- LICENSE NOTICE README RELEASE_NOTES\
- etc/qpidd \
- $(PACKAGE).spec \
- $(PACKAGE).spec.in
-
-SUBDIRS = gen lib tests src docs/api docs/man rpm
-
-# Update libtool, if needed.
-libtool: $(LIBTOOL_DEPS)
- $(SHELL) ./config.status --recheck
-
-# This cannot be done by AC_CONFIG_FILES, because automake's
-# make distcheck target does not like auto-generated files
-# being included in the distributed archive.
-qpidc.spec: %: %.in
- sed 's/@''PACKAGE@/@PACKAGE@/;s/@''VERSION@/@VERSION@/' $< > $@-tmp
- mv $@-tmp $@
-MAINTAINERCLEANFILES = $(PACKAGE).spec
-
-.PHONY: rpm srpm rpmbuild
-rpm srpm:
- cd rpm && $(MAKE) $(MAKEFLAGS_AM) $@
-rpmbuild: rpm
diff --git a/Final/cpp/NOTICE b/Final/cpp/NOTICE
deleted file mode 100644
index cae69a873a..0000000000
--- a/Final/cpp/NOTICE
+++ /dev/null
@@ -1,25 +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:
- * apr version 1.2.7 or later under the Apache Software License, Version 2.0,
- and can be downloded from http://apr.apache.org
-
- * 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 platfroms by defualt.
-
diff --git a/Final/cpp/README b/Final/cpp/README
deleted file mode 100644
index 2f3f2d81d3..0000000000
--- a/Final/cpp/README
+++ /dev/null
@@ -1,272 +0,0 @@
-Qpid C++ is a C++ implementation of the AMQP protcol described at
- http://amqp.org/
-
-The Qpid project also provides Java, Ruby and Python implementations.
-
-For additional software or information on the Qpid project go to:
- http://incubator.apache.org/qpid/index.html
-
-
-Available documentation:
- qpidd(1) man page - how to run the broker daemon.
- html/index.html - C++ client API.
-
-Note the daemon and client API can be installed separately.
-
-This README describes how to build the Qpid C++ broker and client, either
-from a checkout of the source or from a source distribution.
-
-== 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.
-
-Qpid can be built using the gcc compiler:
-
- # gcc <http://gcc.gnu.org/> (3.2.3)
-
-Qpid is compiled against libraries:
-
- * apr <http://apr.apache.org> (1.2.7)
- * boost <http://www.boost.org> (1.33.1)
- * cppunit <http://cppunit.sourceforge.net> (1.11.4)
-
-Using tools:
-
- * boost-jam <http://boost.sourceforge.net/> (3.1.13)
- * 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)
- * pkgconfig <http://pkgconfig.freedesktop.org/wiki/> (0.21)
- * doxygen <ftp://ftp.stack.nl/pub/users/dimitri/> (1.5.1)
- * graphviz <http://www.graphviz.org/> (2.12)
- * JDK 5.0 <http://java.sun.com/j2se/1.5.0/> (1.5.0.11)
-
-=== Optional tools ===
-
-Building from a source distribution does not require:
-
- * autoconf
- * automake
- * JDK 5.0
-
-Building without testing does not require:
-
- * cppunit
-
-Building without documentaion does not require:
-
- * help2man
- * doxygen
- * graphviz
-
-=== Installing as root ===
-
-On linux most packages can be installed using your distribution's package
-management tool. For example on Fedora:
-
- # yum install apr-devel boost-devel cppunit-devel
- # yum install pkgconfig doxygen graphviz help2man
-
-
-Follow the manual installation instruction below for any packages not
-available through yum.
-
-=== Building and installing packages manually or as non-root user ===
-
-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 to this are boost and JDK 5.0.
- To build the boost library:
-
- 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 -sTOOLS=gcc --prefix=~/qpid-tools
-
-To install JDK 5.0 download and run its install script, or whatever
-alternative instructions may be on the sun website.
-
-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
-
-Ensure that JDK 5.0 has its home location set up correctly and is added to
-the path. For example:
-
- # export PATH=~/jdk1.5.0_11/bin:$PATH
-
-== 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)
-
-
-== For Qpid developers: building a repository working copy ==
-
-=== Installing the latest autotools ===
-
-If you don't have sufficiently up-to-date autotools you can get the
-latest by running run 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.
-
-=== Building a checkout ===
-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.
-
-=== 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.
-
-=== Unit tests ===
-
-Unit tests are built as .so files containing CppUnit plugins.
-
-DllPlugInTester is provided as part of cppunit. You can use it to run
-any subset of the unit tests. See Makefile for examples.
-
-NOTE: If foobar.so is a test plugin in the current directory then
-surprisingly this will fail with "can't load plugin":
- # DllPluginTester foobar.so
-
-Instead you need to say:
- # DllPluginTester ./foobar.so
-
-Reason: DllPluginTester uses dlopen() which only searches for shlibs
-in the standard places unless the filename contains a "/". In that
-case it just tries to open the filename.
-
-=== System tests ===
-
-The Python test suite ../python/run_tests is the main set of broker
-system tests.
-
-There are some C++ client test executables built under client/test.
-
-== 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
-This README describes how to build the Qpid C++ broker and client, either
-from a checkout of the source or from a source distribution.
diff --git a/Final/cpp/RELEASE_NOTES b/Final/cpp/RELEASE_NOTES
deleted file mode 100644
index 819539b1ec..0000000000
--- a/Final/cpp/RELEASE_NOTES
+++ /dev/null
@@ -1,41 +0,0 @@
-Apache Incubator Qpid C++ M2 Release Notes
--------------------------------------------
-
-The Qpid M2 release contains support the for AMQP 0-8 specification.
-You can access the 0-8 specification using the following link.
-http://www.amqp.org/tikiwiki/tiki-index.php?page=Download
-
-For full details of Qpid capabilities, as they currently stand, see our
-detailed 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.
-
-
-Known Issues
-------------
-
-You can view the outstanding task list for Qpid by visiting our JIRA:
-http://issues.apache.org/jira/browse/QPID
-
-Bug QPID-437 c++ broker doesn't obey the mandatory flag
-
-
-M2 Tasks Completed
--------------------
-
-Test QPID-412 Implement initial C++ interop tests
-Task QPID-124 Connect AMQP version from ProtocolInitiation object to all version-aware objects
-
-New Feature QPID-154 Logging/tracing for C++.
-New Feature QPID-98 implement durable exchanges
-New Feature QPID-41 Persistent storage for messages & durable queues
-
-Improvement QPID-450 C++ demos
-Improvement QPID-64 C++ cluster design.
-Improvement QPID-62 C++ event queue design.
-
-Bug QPID-481 c++ broker dosen't implement channel.flow
-Bug QPID-467 Complete Interop Testing
-Bug QPID-123 Sporadic failure on Python tests
diff --git a/Final/cpp/bootstrap b/Final/cpp/bootstrap
deleted file mode 100755
index f5dc3b19c3..0000000000
--- a/Final/cpp/bootstrap
+++ /dev/null
@@ -1,55 +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 -e
-aclocal -I m4
-autoheader
-libtoolize --automake
-
-# These are needed only if you don't already have the gen/*.{h,cpp} files.
-: ${JAVA=java}
-: ${JAVAC=javac}
-export JAVA JAVAC
-
-# If we're building in the qpid tree, we can generate
-# some Makefile snippets:
-
-if test -d ../gentools && test -d ../specs; then
- # Transform gen/Makefile.am, removing automake-constructs and the
- # contents of the sole automake-else clause (the warning), then
- # use the result to run the rules that create gen-src.mk, a file
- # that must be created before we run automake.
- (cd gen && rm -f gen-src.mk
- perl -ne '/warning:|^(if|else|endif|include)\b/ or print' Makefile.am \
- | make -f - srcdir=. gen-src.mk > /dev/null )
-fi
-
-# Generate (for automake) lots of repetitive parts of tests/Makefile.am.
-(cd tests && rm -f gen.mk
- perl -ne '/^include / or print' Makefile.am \
- | make -f - abs_srcdir=`dirname $(pwd)` gen.mk > /dev/null )
-
-automake
-autoconf
-
-if [ "$1" = "-build" -o "$1" = "--build" ] ; then
- ./configure
- make
- make check
-fi
diff --git a/Final/cpp/build-aux/compile b/Final/cpp/build-aux/compile
deleted file mode 100755
index 1b1d232169..0000000000
--- a/Final/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/Final/cpp/build-aux/config.guess b/Final/cpp/build-aux/config.guess
deleted file mode 100755
index c93201a4d2..0000000000
--- a/Final/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/Final/cpp/build-aux/config.rpath b/Final/cpp/build-aux/config.rpath
deleted file mode 100755
index c492a93b66..0000000000
--- a/Final/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/Final/cpp/build-aux/config.sub b/Final/cpp/build-aux/config.sub
deleted file mode 100755
index 7ccee73057..0000000000
--- a/Final/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/Final/cpp/build-aux/depcomp b/Final/cpp/build-aux/depcomp
deleted file mode 100755
index ca5ea4e1ef..0000000000
--- a/Final/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/Final/cpp/build-aux/install-sh b/Final/cpp/build-aux/install-sh
deleted file mode 100755
index 4fbbae7b7f..0000000000
--- a/Final/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/Final/cpp/build-aux/ltmain.sh b/Final/cpp/build-aux/ltmain.sh
deleted file mode 100755
index c715b59412..0000000000
--- a/Final/cpp/build-aux/ltmain.sh
+++ /dev/null
@@ -1,6871 +0,0 @@
-# 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/Final/cpp/build-aux/mdate-sh b/Final/cpp/build-aux/mdate-sh
deleted file mode 100755
index cd916c0a34..0000000000
--- a/Final/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/Final/cpp/build-aux/missing b/Final/cpp/build-aux/missing
deleted file mode 100755
index 1c8ff7049d..0000000000
--- a/Final/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/Final/cpp/configure.ac b/Final/cpp/configure.ac
deleted file mode 100644
index 2e7ea22607..0000000000
--- a/Final/cpp/configure.ac
+++ /dev/null
@@ -1,152 +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.
-
-AC_INIT([qpidc], [0.1], [qpid-dev@incubator.apache.org])
-AC_CONFIG_AUX_DIR([build-aux])
-AM_INIT_AUTOMAKE([dist-bzip2])
-
-# Minimum Autoconf version required.
-AC_PREREQ(2.59)
-
-AC_CONFIG_HEADERS([config.h:config.in])
-AC_CONFIG_SRCDIR([lib/broker/ExchangeBinding.cpp])
-
-AC_PROG_CC_STDC
-AM_PROG_CC_C_O
-AC_PROG_CXX
-AC_USE_SYSTEM_EXTENSIONS
-
-AM_MISSING_PROG([HELP2MAN], [help2man])
-
-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])
-
-# Turn on this automake conditional if we are in a qpid
-# hierarchy (i.e. with gentools/ and specs/ sibling directories),
-# and if we have working java + javac.
-AC_CHECK_PROGS([JAVA], [java], [no])
-AC_CHECK_PROGS([JAVAC], [javac], [no])
-build=yes
-test x$JAVA = xno && build=no
-test x$JAVAC = xno && build=no
-test -d $srcdir/../gentools || build=no
-test -d $srcdir/../specs || build=no
-AM_CONDITIONAL([CAN_GENERATE_CODE], [test x$build = xyes])
-
-# 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)
- AC_SUBST([WARNING_CFLAGS], [$COMPILER_FLAGS])
- AC_DEFINE([lint], 1, [Define to 1 if the compiler is checking for lint.])
- COMPILER_FLAGS=
-fi
-
-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
-
-# Check for cppunit support.
-CPPUNIT_MINIMUM_VERSION=1.10.2
-AM_PATH_CPPUNIT([$CPPUNIT_MINIMUM_VERSION], , [CPPUNIT_LIBS=-lcppunit])
-CPPUNIT_CXXFLAGS=$CPPUNIT_CFLAGS
-AC_SUBST(CPPUNIT_LIBS)
-AC_SUBST(CPPUNIT_CXXFLAGS)
-
-AC_ARG_ENABLE(apr,
-[ --enable-apr use the Apache Portable Runtime library (default)
- --disable-apr do not use the Apache Portable Runtime library],
-[case $enableval in
- yes|no) ;;
- *) AC_MSG_ERROR([invalid APR enable/disable value: $enableval]) ;;
- esac],
-[enableval=yes])
-
-APR_MINIMUM_VERSION=1.2.2
-AC_SUBST(APR_MINIMUM_VERSION)
-AC_SUBST(APR_CXXFLAGS)
-AC_SUBST(USE_APR)
-
-if test "$enableval" = yes; then
- PKG_CHECK_MODULES([APR], [apr-1 >= $APR_MINIMUM_VERSION])
- APR_CXXFLAGS="$APR_CFLAGS -DUSE_APR=1"
- USE_APR=1
-fi
-
-AC_ARG_ENABLE(valgrind,
- [ --enable-valgrind enable testing via valgrind, if available (recommended)
- --disable-valgrind do not use valgrind],
- [case $enableval in
- yes|no) enable_VALGRIND=$enableval;;
- *) AC_MSG_ERROR([invalid valgrind enable/disable value: $enableval]);;
- esac],
- [enable_VALGRIND=no] # no option given, default
- )
-
-# 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=
-
-AC_CONFIG_FILES([
- Makefile
- gen/Makefile
- lib/Makefile
- lib/common/Makefile
- lib/client/Makefile
- lib/broker/Makefile
- src/Makefile
- tests/Makefile
- docs/man/Makefile
- docs/api/Makefile
- rpm/Makefile
- ])
-
-AC_OUTPUT
diff --git a/Final/cpp/docs/api/Makefile.am b/Final/cpp/docs/api/Makefile.am
deleted file mode 100644
index 4c910c971c..0000000000
--- a/Final/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.
-#
-html: doxygen.tstamp
-
-dist-hook: html
-
-EXTRA_DIST = \
- html \
- user.doxygen \
- doxygen.tstamp
-
-SOURCES = \
- $(wildcard $(top_srcdir)/gen/*.h) \
- $(wildcard $(top_srcdir)/lib/common/*.h) \
- $(wildcard $(top_srcdir)/lib/common/sys/*.h) \
- $(wildcard $(top_srcdir)/lib/common/framing/*.h) \
- $(wildcard $(top_srcdir)/lib/client/*.h)
-
-doxygen.tstamp: user.doxygen $(SOURCES)
- doxygen $(srcdir)/user.doxygen
- touch $@
-
-clean-local:
- rm -rf docs.tstamp html man latex doxygen.tstamp xml
diff --git a/Final/cpp/docs/api/user.doxygen b/Final/cpp/docs/api/user.doxygen
deleted file mode 100644
index 0d92dc283b..0000000000
--- a/Final/cpp/docs/api/user.doxygen
+++ /dev/null
@@ -1,1244 +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
-
-# 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 = NO
-
-# 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 =
-
-# 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 = NO
-
-# 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 = 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 = YES
-
-# 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 = YES
-
-# 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 =
-
-#---------------------------------------------------------------------------
-# 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 = ../../lib/common ../../lib/client ../../gen
-
-# 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 = 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 =
-
-# 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 = NO
-
-# 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
-
-# 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 = 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_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/Final/cpp/docs/man/Makefile.am b/Final/cpp/docs/man/Makefile.am
deleted file mode 100644
index ad4e76c8fe..0000000000
--- a/Final/cpp/docs/man/Makefile.am
+++ /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.
-#
-dist_man_MANS = qpidd.1
-
-man_aux = $(dist_man_MANS:.1=.x) $(optional_mans:.1=.x)
-EXTRA_DIST = $(man_aux) $(optional_mans)
-MAINTAINERCLEANFILES = $(dist_man_MANS)
-
-dist-hook: $(man_aux)
-
-qpidd.1: $(srcdir)/qpidd.x $(top_srcdir)/src/qpidd
-
-# Depend on configure.ac to get version number changes.
-$(dist_man_MANS): $(top_srcdir)/configure.ac
-
-SUFFIXES = .x .1
-.x.1:
- @rm -f $@
- @echo "Updating man page $@"
- $(HELP2MAN) --no-info --include=$(srcdir)/$*.x --output=$@-t ../../src/$*
- @chmod a-w $@-t
- @mv $@-t $@
diff --git a/Final/cpp/docs/man/qpidd.x b/Final/cpp/docs/man/qpidd.x
deleted file mode 100644
index 91d3c3a969..0000000000
--- a/Final/cpp/docs/man/qpidd.x
+++ /dev/null
@@ -1,16 +0,0 @@
-[NAME]
-qpidd \- the Qpid AMQP broker daemon
-
-[DESCRIPTION]
-
-Start the AMQP broker. The broker options can be specified on the command line (e.g. --worker-threads 10), in an environment variable (e.g. export QPID_WORKER_THREADS=10), or as a line in a configuration file (e.g. worker-threads=10).
-
-Command line options take precedence over environment variables, which
-take precedence over the config file.
-
-
-
-
-
-
-
diff --git a/Final/cpp/etc/qpidd b/Final/cpp/etc/qpidd
deleted file mode 100755
index 11cc03e0af..0000000000
--- a/Final/cpp/etc/qpidd
+++ /dev/null
@@ -1,84 +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.
-#
-# 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
-
-# Source function library.
-. /etc/rc.d/init.d/functions
-
-RETVAL=0
-
-start() {
- echo -n $"Starting Qpid AMQP daemon: "
- daemon $prog --daemon
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && touch ${lockfile}
- return $RETVAL
-}
-
-stop() {
- echo -n $"Stopping Qpid AMQP daemon: "
- killproc $prog
- RETVAL=$?
- echo
- [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
-}
-
-restart() {
- stop
- start
-}
-
-# See how we were called.
-case "$1" in
- start)
- start
- ;;
- stop)
- stop
- ;;
- status)
- status $prog
- RETVAL=$?
- ;;
- restart|reload)
- restart
- ;;
- condrestart)
- if [ -e $lockfile ] ; then restart ; fi
- ;;
- reload)
- reload
- ;;
- *)
- echo $"Usage: $0 {start|stop|restart|condrestart|reload|status}"
- exit 1
-esac
-
-exit $RETVAL
diff --git a/Final/cpp/gen/Makefile.am b/Final/cpp/gen/Makefile.am
deleted file mode 100644
index 3398f01330..0000000000
--- a/Final/cpp/gen/Makefile.am
+++ /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 gen-src.mk
-
-BUILT_SOURCES = $(generated_sources) $(generated_headers)
-pkginclude_HEADERS=$(generated_headers)
-
-# Distribute the generated sources, at least for now, since
-# the generator code is in java.
-EXTRA_DIST = $(BUILT_SOURCES)
-DISTCLEANFILES = $(BUILT_SOURCES) timestamp gen-src.mk
-
-# Don't attempt to run the code generator unless configure has set
-# CAN_GENERATE_CODE, indicating that the amqp.xml and tools needed
-# to run the code generator are available.
-#
-if CAN_GENERATE_CODE
-
-gentools_dir = $(srcdir)/../../gentools
-spec_dir = $(srcdir)/../../specs
-spec = $(spec_dir)/amqp.0-8.xml
-gentools_srcdir = $(gentools_dir)/src/org/apache/qpid/gentools
-
-$(BUILT_SOURCES) timestamp: $(spec) $(java_sources) $(cxx_templates)
- rm -f $(generated_sources)
- cd $(gentools_srcdir) && rm -f *.class && $(JAVAC) *.java
- $(JAVA) -cp $(gentools_dir)/src org.apache.qpid.gentools.Main \
- -c -o . -t $(gentools_dir)/templ.cpp $(spec)
- touch timestamp
-
-gen-src.mk: timestamp
- ./make-gen-src-mk.sh $(gentools_dir) $(gentools_srcdir) > $@-t
- mv $@-t $@
-endif
diff --git a/Final/cpp/gen/make-gen-src-mk.sh b/Final/cpp/gen/make-gen-src-mk.sh
deleted file mode 100755
index fdaa848001..0000000000
--- a/Final/cpp/gen/make-gen-src-mk.sh
+++ /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.
-#
-# Generate the gen-src.mk makefile fragment, to stdout.
-# Usage: <gentools_dir> <gentools_srcdir>
-
-gentools_dir=$1
-gentools_srcdir=$2
-
-wildcard() { echo `ls $* 2>/dev/null` ; }
-
-cat <<EOF
-generated_sources = `wildcard *.cpp`
-
-generated_headers = `wildcard *.h`
-
-if CAN_GENERATE_CODE
-
-java_sources = `wildcard $gentools_srcdir/*.java`
-
-cxx_templates = `wildcard $gentools_dir/templ.cpp/*.tmpl`
-
-# Empty rules in case one of these files is removed,
-# renamed or no longer generated.
-\$(spec):
-\$(java_sources):
-\$(cxx_templates):
-endif
-
-EOF
-
-
diff --git a/Final/cpp/lib/Makefile.am b/Final/cpp/lib/Makefile.am
deleted file mode 100644
index 9a3e117623..0000000000
--- a/Final/cpp/lib/Makefile.am
+++ /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.
-#
-SUBDIRS = common broker client
diff --git a/Final/cpp/lib/broker/AccumulatedAck.cpp b/Final/cpp/lib/broker/AccumulatedAck.cpp
deleted file mode 100644
index a9826ba5ea..0000000000
--- a/Final/cpp/lib/broker/AccumulatedAck.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 <AccumulatedAck.h>
-
-using std::less_equal;
-using std::bind2nd;
-using namespace qpid::broker;
-
-void AccumulatedAck::update(u_int64_t tag, bool multiple){
- if(multiple){
- if(tag > range) range = tag;
- //else don't care, it is already counted
- }else if(tag > range){
- individual.push_back(tag);
- }
-}
-
-void AccumulatedAck::consolidate(){
- individual.sort();
- //remove any individual tags that are covered by range
- individual.remove_if(bind2nd(less_equal<u_int64_t>(), range));
-}
-
-void AccumulatedAck::clear(){
- range = 0;
- individual.clear();
-}
-
-bool AccumulatedAck::covers(u_int64_t tag) const{
- return tag <= range || find(individual.begin(), individual.end(), tag) != individual.end();
-}
diff --git a/Final/cpp/lib/broker/AccumulatedAck.h b/Final/cpp/lib/broker/AccumulatedAck.h
deleted file mode 100644
index c472f7f3ea..0000000000
--- a/Final/cpp/lib/broker/AccumulatedAck.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 _AccumulatedAck_
-#define _AccumulatedAck_
-
-#include <algorithm>
-#include <functional>
-#include <list>
-
-namespace qpid {
- namespace broker {
- /**
- * Keeps an accumulated record of acked messages (by delivery
- * tag).
- */
- class AccumulatedAck {
- public:
- /**
- * If not zero, then everything up to this value has been
- * acked.
- */
- u_int64_t range;
- /**
- * List of individually acked messages that are not
- * included in the range marked by 'range'.
- */
- std::list<u_int64_t> individual;
-
- AccumulatedAck(u_int64_t r) : range(r) {}
- void update(u_int64_t tag, bool multiple);
- void consolidate();
- void clear();
- bool covers(u_int64_t tag) const;
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/AutoDelete.cpp b/Final/cpp/lib/broker/AutoDelete.cpp
deleted file mode 100644
index ae48d10505..0000000000
--- a/Final/cpp/lib/broker/AutoDelete.cpp
+++ /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.
- *
- */
-#include <AutoDelete.h>
-#include <sys/Time.h>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-
-AutoDelete::AutoDelete(QueueRegistry* const _registry, u_int32_t _period)
- : registry(_registry), period(_period), stopped(true) { }
-
-void AutoDelete::add(Queue::shared_ptr const queue){
- Mutex::ScopedLock l(lock);
- queues.push(queue);
-}
-
-Queue::shared_ptr const AutoDelete::pop(){
- Queue::shared_ptr next;
- Mutex::ScopedLock l(lock);
- if(!queues.empty()){
- next = queues.front();
- queues.pop();
- }
- return next;
-}
-
-void AutoDelete::process(){
- Queue::shared_ptr seen;
- for(Queue::shared_ptr q = pop(); q; q = pop()){
- if(seen == q){
- add(q);
- break;
- }else if(q->canAutoDelete()){
- std::string name(q->getName());
- registry->destroy(name);
- std::cout << "INFO: Auto-deleted queue named " << name << std::endl;
- }else{
- add(q);
- if(!seen) seen = q;
- }
- }
-}
-
-void AutoDelete::run(){
- Monitor::ScopedLock l(monitor);
- while(!stopped){
- process();
- monitor.wait(period*TIME_MSEC);
- }
-}
-
-void AutoDelete::start(){
- Monitor::ScopedLock l(monitor);
- if(stopped){
- stopped = false;
- runner = Thread(this);
- }
-}
-
-void AutoDelete::stop(){
- {
- Monitor::ScopedLock l(monitor);
- if(stopped) return;
- stopped = true;
- }
- monitor.notify();
- runner.join();
-}
diff --git a/Final/cpp/lib/broker/AutoDelete.h b/Final/cpp/lib/broker/AutoDelete.h
deleted file mode 100644
index 19a5938df1..0000000000
--- a/Final/cpp/lib/broker/AutoDelete.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#ifndef _AutoDelete_
-#define _AutoDelete_
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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 <queue>
-#include <sys/Monitor.h>
-#include <BrokerQueue.h>
-#include <QueueRegistry.h>
-#include <sys/Thread.h>
-
-namespace qpid {
- namespace broker{
- class AutoDelete : private qpid::sys::Runnable {
- qpid::sys::Mutex lock;
- qpid::sys::Monitor monitor;
- std::queue<Queue::shared_ptr> queues;
- QueueRegistry* const registry;
- u_int32_t period;
- volatile bool stopped;
- qpid::sys::Thread runner;
-
- Queue::shared_ptr const pop();
- void process();
- virtual void run();
-
- public:
- AutoDelete(QueueRegistry* const registry, u_int32_t period);
- void add(Queue::shared_ptr const);
- void start();
- void stop();
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/Binding.h b/Final/cpp/lib/broker/Binding.h
deleted file mode 100644
index 16ca223208..0000000000
--- a/Final/cpp/lib/broker/Binding.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 _Binding_
-#define _Binding_
-
-#include <FieldTable.h>
-
-namespace qpid {
- namespace broker {
- class Binding{
- public:
- virtual void cancel() = 0;
- virtual ~Binding(){}
- };
- }
-}
-
-
-#endif
-
diff --git a/Final/cpp/lib/broker/Broker.cpp b/Final/cpp/lib/broker/Broker.cpp
deleted file mode 100644
index 806127bf43..0000000000
--- a/Final/cpp/lib/broker/Broker.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 <iostream>
-#include <memory>
-#include <Broker.h>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-
-Broker::Options::Options() :
- workerThreads(5),
- maxConnections(500),
- connectionBacklog(10),
- store(),
- stagingThreshold(5000000)
-{}
-
-void Broker::Options::addTo(po::options_description& desc)
-{
- using namespace po;
- CommonOptions::addTo(desc);
- desc.add_options()
- ("worker-threads", optValue(workerThreads, "N"),
- "Broker thread pool size")
- ("max-connections", optValue(maxConnections, "N"),
- "Maximum allowed connections")
- ("connection-backlog", optValue(connectionBacklog, "N"),
- "Connection backlog limit for server socket.")
- ("staging-threshold", optValue(stagingThreshold, "N"),
- "Messages over N bytes are staged to disk.")
- ("store", optValue(store,"LIBNAME"),
- "Name of message store shared library.");
-}
-
-
-Broker::Broker(const Options& config) :
- acceptor(Acceptor::create(config.port,
- config.connectionBacklog,
- config.workerThreads,
- config.trace)),
- factory(config.store)
-{ }
-
-
-Broker::shared_ptr Broker::create(int16_t port)
-{
- Options config;
- config.port=port;
- return create(config);
-}
-
-Broker::shared_ptr Broker::create(const Options& config) {
- return Broker::shared_ptr(new Broker(config));
-}
-
-void Broker::run() {
- acceptor->run(&factory);
-}
-
-void Broker::shutdown() {
- if (acceptor)
- acceptor->shutdown();
-}
-
-Broker::~Broker() { }
-
diff --git a/Final/cpp/lib/broker/Broker.h b/Final/cpp/lib/broker/Broker.h
deleted file mode 100644
index 8b54bd592b..0000000000
--- a/Final/cpp/lib/broker/Broker.h
+++ /dev/null
@@ -1,91 +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 <CommonOptions.h>
-#include <SessionHandlerFactoryImpl.h>
-#include <sys/Runnable.h>
-#include <sys/Acceptor.h>
-#include <SharedObject.h>
-
-namespace qpid {
-namespace broker {
-/**
- * A broker instance.
- */
-class Broker : public qpid::sys::Runnable,
- public qpid::SharedObject<Broker>
-{
- public:
- struct Options : public CommonOptions {
- Options();
- void addTo(po::options_description&);
- int workerThreads;
- int maxConnections;
- int connectionBacklog;
- std::string store;
- long stagingThreshold;
- };
-
- virtual ~Broker();
-
- /**
- * Create a broker.
- * @param port Port to listen on or 0 to pick a port dynamically.
- */
- static shared_ptr create(int16_t port = Options::DEFAULT_PORT);
-
- /**
- * Create a broker using a Configuration.
- */
- static shared_ptr create(const Options& config);
-
- /**
- * 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 int16_t getPort() const { return acceptor->getPort(); }
-
- /**
- * 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();
-
- private:
- Broker(const Options& config);
- Options config;
- qpid::sys::Acceptor::shared_ptr acceptor;
- SessionHandlerFactoryImpl factory;
-};
-}
-}
-
-
-
-#endif /*!_Broker_*/
diff --git a/Final/cpp/lib/broker/BrokerChannel.cpp b/Final/cpp/lib/broker/BrokerChannel.cpp
deleted file mode 100644
index d8fbdc467c..0000000000
--- a/Final/cpp/lib/broker/BrokerChannel.cpp
+++ /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.
- *
- */
-#include <BrokerChannel.h>
-#include <QpidError.h>
-#include <iostream>
-#include <sstream>
-#include <assert.h>
-
-using std::mem_fun_ref;
-using std::bind2nd;
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-
-Channel::Channel(qpid::framing::ProtocolVersion& _version, OutputHandler* _out, int _id, u_int32_t _framesize, MessageStore* const _store, u_int64_t _stagingThreshold) :
- id(_id),
- out(_out),
- currentDeliveryTag(1),
- transactional(false),
- prefetchSize(0),
- prefetchCount(0),
- framesize(_framesize),
- tagGenerator("sgen"),
- accumulatedAck(0),
- store(_store),
- messageBuilder(this, _store, _stagingThreshold),
- version(_version),
- flowActive(true){
-
- outstanding.reset();
-}
-
-Channel::~Channel(){
-}
-
-bool Channel::exists(const string& consumerTag){
- return consumers.find(consumerTag) != consumers.end();
-}
-
-void Channel::consume(string& tag, Queue::shared_ptr queue, bool acks, bool exclusive, ConnectionToken* const connection, const FieldTable*){
- if(tag.empty()) tag = tagGenerator.generate();
- ConsumerImpl* c(new ConsumerImpl(this, tag, queue, connection, acks));
- try{
- queue->consume(c, exclusive);//may throw exception
- consumers[tag] = c;
- }catch(ExclusiveAccessException& e){
- delete c;
- throw e;
- }
-}
-
-void Channel::cancel(consumer_iterator i){
- ConsumerImpl* c = i->second;
- consumers.erase(i);
- if(c){
- c->cancel();
- delete c;
- }
-}
-
-void Channel::cancel(const string& tag){
- consumer_iterator i = consumers.find(tag);
- if(i != consumers.end()){
- cancel(i);
- }
-}
-
-void Channel::close(){
- //cancel all consumers
- for(consumer_iterator i = consumers.begin(); i != consumers.end(); i = consumers.begin() ){
- cancel(i);
- }
- //requeue:
- recover(true);
-}
-
-void Channel::begin(){
- transactional = true;
-}
-
-void Channel::commit(){
- TxAck txAck(accumulatedAck, unacked);
- txBuffer.enlist(&txAck);
- if(txBuffer.prepare(store)){
- txBuffer.commit();
- }
- accumulatedAck.clear();
-}
-
-void Channel::rollback(){
- txBuffer.rollback();
- accumulatedAck.clear();
-}
-
-void Channel::deliver(Message::shared_ptr& msg, const string& consumerTag, Queue::shared_ptr& queue, bool ackExpected){
- Mutex::ScopedLock locker(deliveryLock);
-
- u_int64_t deliveryTag = currentDeliveryTag++;
- if(ackExpected){
- unacked.push_back(DeliveryRecord(msg, queue, consumerTag, deliveryTag));
- outstanding.size += msg->contentSize();
- outstanding.count++;
- }
- //send deliver method, header and content(s)
- msg->deliver(out, id, consumerTag, deliveryTag, framesize, &version);
-}
-
-bool Channel::checkPrefetch(Message::shared_ptr& msg){
- Mutex::ScopedLock locker(deliveryLock);
- bool countOk = !prefetchCount || prefetchCount > unacked.size();
- bool sizeOk = !prefetchSize || prefetchSize > msg->contentSize() + outstanding.size || unacked.empty();
- return countOk && sizeOk;
-}
-
-Channel::ConsumerImpl::ConsumerImpl(Channel* _parent, const string& _tag,
- Queue::shared_ptr _queue,
- ConnectionToken* const _connection, bool ack) : parent(_parent),
- tag(_tag),
- queue(_queue),
- connection(_connection),
- ackExpected(ack),
- blocked(false){
-}
-
-bool Channel::ConsumerImpl::deliver(Message::shared_ptr& msg){
- if(!connection || connection != msg->getPublisher()){//check for no_local
- if(!parent->flowActive || (ackExpected && !parent->checkPrefetch(msg))){
- blocked = true;
- }else{
- blocked = false;
- parent->deliver(msg, tag, queue, ackExpected);
- return true;
- }
- }
- return false;
-}
-
-void Channel::ConsumerImpl::cancel(){
- if(queue) queue->cancel(this);
-}
-
-void Channel::ConsumerImpl::requestDispatch(){
- if(blocked) queue->dispatch();
-}
-
-void Channel::handlePublish(Message* _message, Exchange::shared_ptr _exchange){
- Message::shared_ptr message(_message);
- exchange = _exchange;
- messageBuilder.initialise(message);
-}
-
-void Channel::handleHeader(AMQHeaderBody::shared_ptr header){
- messageBuilder.setHeader(header);
- //at this point, decide based on the size of the message whether we want
- //to stage it by saving content directly to disk as it arrives
-}
-
-void Channel::handleContent(AMQContentBody::shared_ptr content){
- messageBuilder.addContent(content);
-}
-
-void Channel::complete(Message::shared_ptr& msg){
- if(exchange){
- if(transactional){
- TxPublish* deliverable = new TxPublish(msg);
- exchange->route(*deliverable, msg->getRoutingKey(), &(msg->getHeaderProperties()->getHeaders()));
- txBuffer.enlist(new DeletingTxOp(deliverable));
- }else{
- DeliverableMessage deliverable(msg);
- exchange->route(deliverable, msg->getRoutingKey(), &(msg->getHeaderProperties()->getHeaders()));
- }
- exchange.reset();
- }else{
- std::cout << "Exchange not known in Channel::complete(Message::shared_ptr&)" << std::endl;
- }
-}
-
-void Channel::ack(u_int64_t deliveryTag, bool multiple){
- if(transactional){
- accumulatedAck.update(deliveryTag, multiple);
- //TODO: I think the outstanding prefetch size & count should be updated at this point...
- //TODO: ...this may then necessitate dispatching to consumers
- }else{
- Mutex::ScopedLock locker(deliveryLock);//need to synchronize with possible concurrent delivery
-
- ack_iterator i = find_if(unacked.begin(), unacked.end(), bind2nd(mem_fun_ref(&DeliveryRecord::matches), deliveryTag));
- if(i == unacked.end()){
- throw InvalidAckException();
- }else if(multiple){
- ack_iterator end = ++i;
- for_each(unacked.begin(), end, mem_fun_ref(&DeliveryRecord::discard));
- unacked.erase(unacked.begin(), end);
-
- //recalculate the prefetch:
- outstanding.reset();
- for_each(unacked.begin(), unacked.end(), bind2nd(mem_fun_ref(&DeliveryRecord::addTo), &outstanding));
- }else{
- i->discard();
- i->subtractFrom(&outstanding);
- unacked.erase(i);
- }
-
- //if the prefetch limit had previously been reached, there may
- //be messages that can be now be delivered
- for(consumer_iterator j = consumers.begin(); j != consumers.end(); j++){
- j->second->requestDispatch();
- }
- }
-}
-
-void Channel::recover(bool requeue){
- Mutex::ScopedLock locker(deliveryLock);//need to synchronize with possible concurrent delivery
-
- if(requeue){
- outstanding.reset();
- std::list<DeliveryRecord> copy = unacked;
- unacked.clear();
- for_each(copy.begin(), copy.end(), mem_fun_ref(&DeliveryRecord::requeue));
- }else{
- for_each(unacked.begin(), unacked.end(), bind2nd(mem_fun_ref(&DeliveryRecord::redeliver), this));
- }
-}
-
-bool Channel::get(Queue::shared_ptr queue, bool ackExpected){
- Message::shared_ptr msg = queue->dequeue();
- if(msg){
- Mutex::ScopedLock locker(deliveryLock);
- u_int64_t myDeliveryTag = currentDeliveryTag++;
- msg->sendGetOk(out, id, queue->getMessageCount() + 1, myDeliveryTag, framesize, &version);
- if(ackExpected){
- unacked.push_back(DeliveryRecord(msg, queue, myDeliveryTag));
- }
- return true;
- }else{
- return false;
- }
-}
-
-void Channel::deliver(Message::shared_ptr& msg, const string& consumerTag, u_int64_t deliveryTag){
- msg->deliver(out, id, consumerTag, deliveryTag, framesize, &version);
-}
-
-void Channel::flow(bool active){
- Mutex::ScopedLock locker(deliveryLock);
- bool requestDelivery(!flowActive && active);
- flowActive = active;
- if (requestDelivery) {
- //there may be messages that can be now be delivered
- for(consumer_iterator j = consumers.begin(); j != consumers.end(); j++){
- j->second->requestDispatch();
- }
- }
-}
diff --git a/Final/cpp/lib/broker/BrokerChannel.h b/Final/cpp/lib/broker/BrokerChannel.h
deleted file mode 100644
index be40a25013..0000000000
--- a/Final/cpp/lib/broker/BrokerChannel.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 _Channel_
-#define _Channel_
-
-#include <algorithm>
-#include <functional>
-#include <list>
-#include <map>
-#include <AccumulatedAck.h>
-#include <Binding.h>
-#include <Consumer.h>
-#include <DeletingTxOp.h>
-#include <DeliverableMessage.h>
-#include <DeliveryRecord.h>
-#include <BrokerMessage.h>
-#include <MessageBuilder.h>
-#include <NameGenerator.h>
-#include <Prefetch.h>
-#include <BrokerQueue.h>
-#include <MessageStore.h>
-#include <TxAck.h>
-#include <TxBuffer.h>
-#include <TxPublish.h>
-#include <sys/Monitor.h>
-#include <OutputHandler.h>
-#include <AMQContentBody.h>
-#include <AMQHeaderBody.h>
-#include <BasicPublishBody.h>
-
-namespace qpid {
- namespace broker {
- using qpid::framing::string;
-
- /**
- * Maintains state for an AMQP channel. Handles incoming and
- * outgoing messages for that channel.
- */
- class Channel : private MessageBuilder::CompletionHandler{
- class ConsumerImpl : public virtual Consumer{
- Channel* parent;
- const string tag;
- Queue::shared_ptr queue;
- ConnectionToken* const connection;
- const bool ackExpected;
- bool blocked;
- public:
- ConsumerImpl(Channel* parent, const string& tag, Queue::shared_ptr queue, ConnectionToken* const connection, bool ack);
- virtual bool deliver(Message::shared_ptr& msg);
- void cancel();
- void requestDispatch();
- };
-
- typedef std::map<string,ConsumerImpl*>::iterator consumer_iterator;
- const int id;
- qpid::framing::OutputHandler* out;
- u_int64_t currentDeliveryTag;
- Queue::shared_ptr defaultQueue;
- bool transactional;
- std::map<string, ConsumerImpl*> consumers;
- u_int32_t prefetchSize;
- u_int16_t prefetchCount;
- Prefetch outstanding;
- u_int32_t framesize;
- NameGenerator tagGenerator;
- std::list<DeliveryRecord> unacked;
- qpid::sys::Mutex deliveryLock;
- TxBuffer txBuffer;
- AccumulatedAck accumulatedAck;
- MessageStore* const store;
- MessageBuilder messageBuilder;//builder for in-progress message
- Exchange::shared_ptr exchange;//exchange to which any in-progress message was published to
- qpid::framing::ProtocolVersion version; // version used for this channel
- bool flowActive;
-
- virtual void complete(Message::shared_ptr& msg);
- void deliver(Message::shared_ptr& msg, const string& tag, Queue::shared_ptr& queue, bool ackExpected);
- void cancel(consumer_iterator consumer);
- bool checkPrefetch(Message::shared_ptr& msg);
-
- public:
- Channel(qpid::framing::ProtocolVersion& _version, qpid::framing::OutputHandler* out, int id, u_int32_t framesize,
- MessageStore* const _store = 0, u_int64_t stagingThreshold = 0);
- ~Channel();
- inline void setDefaultQueue(Queue::shared_ptr queue){ defaultQueue = queue; }
- inline Queue::shared_ptr getDefaultQueue(){ return defaultQueue; }
- inline u_int32_t setPrefetchSize(u_int32_t size){ return prefetchSize = size; }
- inline u_int16_t setPrefetchCount(u_int16_t count){ return prefetchCount = count; }
- bool exists(const string& consumerTag);
- void consume(string& tag, Queue::shared_ptr queue, bool acks, bool exclusive,
- ConnectionToken* const connection = 0, const qpid::framing::FieldTable* = 0);
- void cancel(const string& tag);
- bool get(Queue::shared_ptr queue, bool ackExpected);
- void begin();
- void close();
- void commit();
- void rollback();
- void ack(u_int64_t deliveryTag, bool multiple);
- void recover(bool requeue);
- void deliver(Message::shared_ptr& msg, const string& consumerTag, u_int64_t deliveryTag);
- void handlePublish(Message* msg, Exchange::shared_ptr exchange);
- void handleHeader(qpid::framing::AMQHeaderBody::shared_ptr header);
- void handleContent(qpid::framing::AMQContentBody::shared_ptr content);
- void flow(bool active);
- };
-
- struct InvalidAckException{};
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/BrokerExchange.h b/Final/cpp/lib/broker/BrokerExchange.h
deleted file mode 100644
index f5e4d9cb28..0000000000
--- a/Final/cpp/lib/broker/BrokerExchange.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 _Exchange_
-#define _Exchange_
-
-#include <boost/shared_ptr.hpp>
-#include <Deliverable.h>
-#include <BrokerQueue.h>
-#include <FieldTable.h>
-
-namespace qpid {
- namespace broker {
- using std::string;
-
- class Exchange{
- const string name;
- public:
- typedef boost::shared_ptr<Exchange> shared_ptr;
-
- explicit Exchange(const string& _name) : name(_name){}
- virtual ~Exchange(){}
- string getName() { return name; }
- virtual string getType() = 0;
- virtual void bind(Queue::shared_ptr queue, const string& routingKey, const qpid::framing::FieldTable* args) = 0;
- virtual void unbind(Queue::shared_ptr queue, const string& routingKey, const qpid::framing::FieldTable* args) = 0;
- virtual void route(Deliverable& msg, const string& routingKey, const qpid::framing::FieldTable* args) = 0;
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/BrokerMessage.cpp b/Final/cpp/lib/broker/BrokerMessage.cpp
deleted file mode 100644
index 6ba2131a74..0000000000
--- a/Final/cpp/lib/broker/BrokerMessage.cpp
+++ /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.
- *
- */
-#include <BrokerMessage.h>
-#include <iostream>
-
-#include <InMemoryContent.h>
-#include <LazyLoadedContent.h>
-#include <MessageStore.h>
-#include <BasicDeliverBody.h>
-#include <BasicGetOkBody.h>
-
-using namespace boost;
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-Message::Message(const ConnectionToken* const _publisher,
- const string& _exchange, const string& _routingKey,
- bool _mandatory, bool _immediate) : publisher(_publisher),
- exchange(_exchange),
- routingKey(_routingKey),
- mandatory(_mandatory),
- immediate(_immediate),
- redelivered(false),
- size(0),
- persistenceId(0) {}
-
-Message::Message(Buffer& buffer, bool headersOnly, u_int32_t contentChunkSize) :
- publisher(0), mandatory(false), immediate(false), redelivered(false), size(0), persistenceId(0){
-
- decode(buffer, headersOnly, contentChunkSize);
-}
-
-Message::Message() : publisher(0), mandatory(false), immediate(false), redelivered(false), size(0), persistenceId(0){}
-
-Message::~Message(){
- if (content.get()) content->destroy();
-}
-
-void Message::setHeader(AMQHeaderBody::shared_ptr _header){
- this->header = _header;
-}
-
-void Message::addContent(AMQContentBody::shared_ptr data){
- if (!content.get()) {
- content = std::auto_ptr<Content>(new InMemoryContent());
- }
- content->add(data);
- size += data->size();
-}
-
-bool Message::isComplete(){
- return header.get() && (header->getContentSize() == contentSize());
-}
-
-void Message::redeliver(){
- redelivered = true;
-}
-
-void Message::deliver(OutputHandler* out, int channel,
- const string& consumerTag, u_int64_t deliveryTag,
- u_int32_t framesize,
- ProtocolVersion* version){
- // CCT -- TODO - Update code generator to take pointer/ not instance to avoid extra contruction
- out->send(new AMQFrame(*version, channel, new BasicDeliverBody(*version, consumerTag, deliveryTag, redelivered, exchange, routingKey)));
- sendContent(out, channel, framesize, version);
-}
-
-void Message::sendGetOk(OutputHandler* out,
- int channel,
- u_int32_t messageCount,
- u_int64_t deliveryTag,
- u_int32_t framesize,
- ProtocolVersion* version){
- // CCT -- TODO - Update code generator to take pointer/ not instance to avoid extra contruction
- out->send(new AMQFrame(*version, channel, new BasicGetOkBody(*version, deliveryTag, redelivered, exchange, routingKey, messageCount)));
- sendContent(out, channel, framesize, version);
-}
-
-void Message::sendContent(OutputHandler* out, int channel, u_int32_t framesize, ProtocolVersion* version){
- AMQBody::shared_ptr headerBody = static_pointer_cast<AMQBody, AMQHeaderBody>(header);
- out->send(new AMQFrame(*version, channel, headerBody));
-
- Mutex::ScopedLock locker(contentLock);
- if (content.get()) content->send(*version, out, channel, framesize);
-}
-
-BasicHeaderProperties* Message::getHeaderProperties(){
- return dynamic_cast<BasicHeaderProperties*>(header->getProperties());
-}
-
-const ConnectionToken* const Message::getPublisher(){
- return publisher;
-}
-
-bool Message::isPersistent()
-{
- if(!header) return false;
- BasicHeaderProperties* props = getHeaderProperties();
- return props && props->getDeliveryMode() == PERSISTENT;
-}
-
-void Message::decode(Buffer& buffer, bool headersOnly, u_int32_t contentChunkSize)
-{
- decodeHeader(buffer);
- if (!headersOnly) decodeContent(buffer, contentChunkSize);
-}
-
-void Message::decodeHeader(Buffer& buffer)
-{
- buffer.getShortString(exchange);
- buffer.getShortString(routingKey);
-
- u_int32_t headerSize = buffer.getLong();
- AMQHeaderBody::shared_ptr headerBody(new AMQHeaderBody());
- headerBody->decode(buffer, headerSize);
- setHeader(headerBody);
-}
-
-void Message::decodeContent(Buffer& buffer, u_int32_t chunkSize)
-{
- u_int64_t expected = expectedContentSize();
- if (expected != buffer.available()) {
- std::cout << "WARN: Expected " << expectedContentSize() << " bytes, got " << buffer.available() << std::endl;
- throw Exception("Cannot decode content, buffer not large enough.");
- }
-
- if (!chunkSize || chunkSize > expected) {
- chunkSize = expected;
- }
-
- u_int64_t total = 0;
- while (total < expectedContentSize()) {
- u_int64_t remaining = expected - total;
- AMQContentBody::shared_ptr contentBody(new AMQContentBody());
- contentBody->decode(buffer, remaining < chunkSize ? remaining : chunkSize);
- addContent(contentBody);
- total += chunkSize;
- }
-}
-
-void Message::encode(Buffer& buffer)
-{
- encodeHeader(buffer);
- encodeContent(buffer);
-}
-
-void Message::encodeHeader(Buffer& buffer)
-{
- buffer.putShortString(exchange);
- buffer.putShortString(routingKey);
- buffer.putLong(header->size());
- header->encode(buffer);
-}
-
-void Message::encodeContent(Buffer& buffer)
-{
- Mutex::ScopedLock locker(contentLock);
- if (content.get()) content->encode(buffer);
-}
-
-u_int32_t Message::encodedSize()
-{
- return encodedHeaderSize() + encodedContentSize();
-}
-
-u_int32_t Message::encodedContentSize()
-{
- Mutex::ScopedLock locker(contentLock);
- return content.get() ? content->size() : 0;
-}
-
-u_int32_t Message::encodedHeaderSize()
-{
- return exchange.size() + 1
- + routingKey.size() + 1
- + header->size() + 4;//4 extra bytes for size
-}
-
-u_int64_t Message::expectedContentSize()
-{
- return header.get() ? header->getContentSize() : 0;
-}
-
-void Message::releaseContent(MessageStore* store)
-{
- Mutex::ScopedLock locker(contentLock);
- if (!isPersistent() && persistenceId == 0) {
- store->stage(this);
- }
- if (!content.get() || content->size() > 0) {
- //set content to lazy loading mode (but only if there is stored content):
-
- //Note: the LazyLoadedContent instance contains a raw pointer to the message, however it is
- // then set as a member of that message so its lifetime is guaranteed to be no longer than
- // that of the message itself
- content = std::auto_ptr<Content>(new LazyLoadedContent(store, this, expectedContentSize()));
- }
-}
-
-void Message::setContent(std::auto_ptr<Content>& _content)
-{
- Mutex::ScopedLock locker(contentLock);
- content = _content;
-}
diff --git a/Final/cpp/lib/broker/BrokerMessage.h b/Final/cpp/lib/broker/BrokerMessage.h
deleted file mode 100644
index 1f68e1004a..0000000000
--- a/Final/cpp/lib/broker/BrokerMessage.h
+++ /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.
- *
- */
-#ifndef _Message_
-#define _Message_
-
-#include <memory>
-#include <boost/shared_ptr.hpp>
-#include <AMQContentBody.h>
-#include <AMQHeaderBody.h>
-#include <ProtocolVersion.h>
-#include <BasicHeaderProperties.h>
-#include <ConnectionToken.h>
-#include <Content.h>
-#include <OutputHandler.h>
-#include <Mutex.h>
-#include <TxBuffer.h>
-
-namespace qpid {
- namespace broker {
-
- class MessageStore;
- using qpid::framing::string;
-
- /**
- * Represents an AMQP message, i.e. a header body, a list of
- * content bodies and some details about the publication
- * request.
- */
- class Message{
- const ConnectionToken* const publisher;
- string exchange;
- string routingKey;
- const bool mandatory;
- const bool immediate;
- bool redelivered;
- qpid::framing::AMQHeaderBody::shared_ptr header;
- std::auto_ptr<Content> content;
- u_int64_t size;
- u_int64_t persistenceId;
- qpid::sys::Mutex contentLock;
-
- void sendContent(qpid::framing::OutputHandler* out,
- int channel, u_int32_t framesize, qpid::framing::ProtocolVersion* version);
-
- public:
- typedef boost::shared_ptr<Message> shared_ptr;
-
- Message(const ConnectionToken* const publisher,
- const string& exchange, const string& routingKey,
- bool mandatory, bool immediate);
- Message(qpid::framing::Buffer& buffer, bool headersOnly = false, u_int32_t contentChunkSize = 0);
- Message();
- ~Message();
- void setHeader(qpid::framing::AMQHeaderBody::shared_ptr header);
- void addContent(qpid::framing::AMQContentBody::shared_ptr data);
- bool isComplete();
- const ConnectionToken* const getPublisher();
-
- void deliver(qpid::framing::OutputHandler* out,
- int channel,
- const string& consumerTag,
- u_int64_t deliveryTag,
- u_int32_t framesize,
- qpid::framing::ProtocolVersion* version);
- void sendGetOk(qpid::framing::OutputHandler* out,
- int channel,
- u_int32_t messageCount,
- u_int64_t deliveryTag,
- u_int32_t framesize,
- qpid::framing::ProtocolVersion* version);
- void redeliver();
-
- qpid::framing::BasicHeaderProperties* getHeaderProperties();
- bool isPersistent();
- const string& getRoutingKey() const { return routingKey; }
- const string& getExchange() const { return exchange; }
- u_int64_t contentSize() const { return size; }
- u_int64_t getPersistenceId() const { return persistenceId; }
- void setPersistenceId(u_int64_t _persistenceId) { persistenceId = _persistenceId; }
-
- void decode(qpid::framing::Buffer& buffer, bool headersOnly = false, u_int32_t contentChunkSize = 0);
- void decodeHeader(qpid::framing::Buffer& buffer);
- void decodeContent(qpid::framing::Buffer& buffer, u_int32_t contentChunkSize = 0);
-
- void encode(qpid::framing::Buffer& buffer);
- void encodeHeader(qpid::framing::Buffer& buffer);
- void encodeContent(qpid::framing::Buffer& buffer);
- /**
- * @returns the size of the buffer needed to encode this
- * message in its entirety
- */
- u_int32_t encodedSize();
- /**
- * @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)
- */
- u_int32_t encodedHeaderSize();
- /**
- * @returns the size of the buffer needed to encode the
- * (possibly partial) content held by this message
- */
- u_int32_t encodedContentSize();
- /**
- * 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);
- /**
- * If headers have been received, returns the expected
- * content size else returns 0.
- */
- u_int64_t expectedContentSize();
- /**
- * Sets the 'content' implementation of this message (the
- * message controls the lifecycle of the content instance
- * it uses).
- */
- void setContent(std::auto_ptr<Content>& content);
- };
-
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/BrokerQueue.cpp b/Final/cpp/lib/broker/BrokerQueue.cpp
deleted file mode 100644
index 0e48d3b13d..0000000000
--- a/Final/cpp/lib/broker/BrokerQueue.cpp
+++ /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.
- *
- */
-#include <BrokerQueue.h>
-#include <MessageStore.h>
-#include <sys/Monitor.h>
-#include <sys/Time.h>
-#include <iostream>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-using namespace qpid::framing;
-
-Queue::Queue(const string& _name, u_int32_t _autodelete,
- MessageStore* const _store,
- const ConnectionToken* const _owner) :
-
- name(_name),
- autodelete(_autodelete),
- store(_store),
- owner(_owner),
- queueing(false),
- dispatching(false),
- next(0),
- lastUsed(0),
- exclusive(0),
- persistenceId(0)
-{
- if(autodelete) lastUsed = now()/TIME_MSEC;
-}
-
-Queue::~Queue(){
- for(Binding* b = bindings.front(); !bindings.empty(); b = bindings.front()){
- b->cancel();
- bindings.pop();
- }
-}
-
-void Queue::bound(Binding* b){
- bindings.push(b);
-}
-
-void Queue::deliver(Message::shared_ptr& msg){
- enqueue(0, msg, 0);
- process(msg);
-}
-
-void Queue::recover(Message::shared_ptr& msg){
- push(msg);
- if (store && msg->expectedContentSize() != msg->encodedContentSize()) {
- //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(Message::shared_ptr& msg){
- Mutex::ScopedLock locker(lock);
- if(queueing || !dispatch(msg)){
- push(msg);
- }
-}
-
-bool Queue::dispatch(Message::shared_ptr& msg){
- if(consumers.empty()){
- return false;
- }else if(exclusive){
- if(!exclusive->deliver(msg)){
- std::cout << "WARNING: Dropping undeliverable message from queue with exclusive consumer." << std::endl;
- }
- return true;
- }else{
- //deliver to next consumer
- next = next % consumers.size();
- Consumer* c = consumers[next];
- int start = next;
- while(c){
- next++;
- if(c->deliver(msg)) return true;
-
- next = next % consumers.size();
- c = next == start ? 0 : consumers[next];
- }
- return false;
- }
-}
-
-bool Queue::startDispatching(){
- Mutex::ScopedLock locker(lock);
- if(queueing && !dispatching){
- dispatching = true;
- return true;
- }else{
- return false;
- }
-}
-
-void Queue::dispatch(){
- bool proceed = startDispatching();
- while(proceed){
- Mutex::ScopedLock locker(lock);
- if(!messages.empty() && dispatch(messages.front())){
- pop();
- }else{
- dispatching = false;
- proceed = false;
- queueing = !messages.empty();
- }
- }
-}
-
-void Queue::consume(Consumer* c, bool requestExclusive){
- Mutex::ScopedLock locker(lock);
- if(exclusive) throw ExclusiveAccessException();
- if(requestExclusive){
- if(!consumers.empty()) throw ExclusiveAccessException();
- exclusive = c;
- }
-
- if(autodelete && consumers.empty()) lastUsed = 0;
- consumers.push_back(c);
-}
-
-void Queue::cancel(Consumer* c){
- Mutex::ScopedLock locker(lock);
- consumers.erase(find(consumers.begin(), consumers.end(), c));
- if(autodelete && consumers.empty()) lastUsed = now()*TIME_MSEC;
- if(exclusive == c) exclusive = 0;
-}
-
-Message::shared_ptr Queue::dequeue(){
- Mutex::ScopedLock locker(lock);
- Message::shared_ptr msg;
- if(!messages.empty()){
- msg = messages.front();
- pop();
- }
- return msg;
-}
-
-u_int32_t Queue::purge(){
- Mutex::ScopedLock locker(lock);
- int count = messages.size();
- while(!messages.empty()) pop();
- return count;
-}
-
-void Queue::pop(){
- if (policy.get()) policy->dequeued(messages.front()->contentSize());
- messages.pop();
-}
-
-void Queue::push(Message::shared_ptr& msg){
- queueing = true;
- messages.push(msg);
- if (policy.get()) {
- policy->enqueued(msg->contentSize());
- if (policy->limitExceeded()) {
- msg->releaseContent(store);
- }
- }
-}
-
-u_int32_t Queue::getMessageCount() const{
- Mutex::ScopedLock locker(lock);
- return messages.size();
-}
-
-u_int32_t Queue::getConsumerCount() const{
- Mutex::ScopedLock locker(lock);
- return consumers.size();
-}
-
-bool Queue::canAutoDelete() const{
- Mutex::ScopedLock locker(lock);
- return lastUsed && (now()*TIME_MSEC - lastUsed > autodelete);
-}
-
-void Queue::enqueue(TransactionContext* ctxt, Message::shared_ptr& msg, const string * const xid)
-{
- if (msg->isPersistent() && store) {
- store->enqueue(ctxt, msg.get(), *this, xid);
- }
-}
-
-void Queue::dequeue(TransactionContext* ctxt, Message::shared_ptr& msg, const string * const xid)
-{
- if (msg->isPersistent() && store) {
- store->dequeue(ctxt, msg.get(), *this, xid);
- }
-}
-
-namespace
-{
- const std::string qpidMaxSize("qpid.max_size");
- const std::string qpidMaxCount("qpid.max_count");
-}
-
-void Queue::create(const FieldTable& settings)
-{
- if (store) {
- store->create(*this, settings);
- }
- configure(settings);
-}
-
-void Queue::configure(const FieldTable& settings)
-{
- QueuePolicy* _policy = new QueuePolicy(settings);
- if (_policy->getMaxCount() || _policy->getMaxSize()) {
- setPolicy(std::auto_ptr<QueuePolicy>(_policy));
- }
-}
-
-void Queue::destroy()
-{
- if (store) {
- store->destroy(*this);
- }
-}
-
-void Queue::setPolicy(std::auto_ptr<QueuePolicy> _policy)
-{
- policy = _policy;
-}
-
-const QueuePolicy* const Queue::getPolicy()
-{
- return policy.get();
-}
diff --git a/Final/cpp/lib/broker/BrokerQueue.h b/Final/cpp/lib/broker/BrokerQueue.h
deleted file mode 100644
index 41611bebe9..0000000000
--- a/Final/cpp/lib/broker/BrokerQueue.h
+++ /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.
- *
- */
-#ifndef _Queue_
-#define _Queue_
-
-#include <vector>
-#include <memory>
-#include <queue>
-#include <boost/shared_ptr.hpp>
-#include <amqp_types.h>
-#include <Binding.h>
-#include <ConnectionToken.h>
-#include <Consumer.h>
-#include <BrokerMessage.h>
-#include <FieldTable.h>
-#include <sys/Monitor.h>
-#include <QueuePolicy.h>
-
-namespace qpid {
- namespace broker {
- class MessageStore;
-
- /**
- * Thrown when exclusive access would be violated.
- */
- struct ExclusiveAccessException{};
-
- 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{
- const string name;
- const u_int32_t autodelete;
- MessageStore* const store;
- const ConnectionToken* const owner;
- std::vector<Consumer*> consumers;
- std::queue<Binding*> bindings;
- std::queue<Message::shared_ptr> messages;
- bool queueing;
- bool dispatching;
- int next;
- mutable qpid::sys::Mutex lock;
- int64_t lastUsed;
- Consumer* exclusive;
- mutable u_int64_t persistenceId;
- std::auto_ptr<QueuePolicy> policy;
-
- void pop();
- void push(Message::shared_ptr& msg);
- bool startDispatching();
- bool dispatch(Message::shared_ptr& msg);
- void setPolicy(std::auto_ptr<QueuePolicy> policy);
-
- public:
-
- typedef boost::shared_ptr<Queue> shared_ptr;
-
- typedef std::vector<shared_ptr> vector;
-
- Queue(const string& name, u_int32_t autodelete = 0,
- MessageStore* const store = 0,
- const ConnectionToken* const owner = 0);
- ~Queue();
-
- void create(const qpid::framing::FieldTable& settings);
- void configure(const qpid::framing::FieldTable& settings);
- void destroy();
- /**
- * Informs the queue of a binding that should be cancelled on
- * destruction of the queue.
- */
- void bound(Binding* b);
- /**
- * Delivers a message to the queue. Will record it as
- * enqueued if persistent then process it.
- */
- void deliver(Message::shared_ptr& msg);
- /**
- * Dispatches the messages immediately to a consumer if
- * one is available or stores it for later if not.
- */
- void process(Message::shared_ptr& msg);
- /**
- * Used during recovery to add stored messages back to the queue
- */
- void recover(Message::shared_ptr& msg);
- /**
- * Dispatch any queued messages providing there are
- * consumers for them. Only one thread can be dispatching
- * at any time, but this method (rather than the caller)
- * is responsible for ensuring that.
- */
- void dispatch();
- void consume(Consumer* c, bool exclusive = false);
- void cancel(Consumer* c);
- u_int32_t purge();
- u_int32_t getMessageCount() const;
- u_int32_t getConsumerCount() const;
- inline const string& getName() const { return name; }
- inline const bool isExclusiveOwner(const ConnectionToken* const o) const { return o == owner; }
- inline bool hasExclusiveConsumer() const { return exclusive; }
- inline u_int64_t getPersistenceId() const { return persistenceId; }
- inline void setPersistenceId(u_int64_t _persistenceId) const { persistenceId = _persistenceId; }
-
- bool canAutoDelete() const;
-
- void enqueue(TransactionContext* ctxt, Message::shared_ptr& msg, const string * const xid);
- /**
- * dequeue from store (only done once messages is acknowledged)
- */
- void dequeue(TransactionContext* ctxt, Message::shared_ptr& msg, const string * const xid);
- /**
- * dequeues from memory only
- */
- Message::shared_ptr dequeue();
-
- const QueuePolicy* const getPolicy();
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/ConnectionToken.h b/Final/cpp/lib/broker/ConnectionToken.h
deleted file mode 100644
index 7e7f813d0e..0000000000
--- a/Final/cpp/lib/broker/ConnectionToken.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 _ConnectionToken_
-#define _ConnectionToken_
-
-namespace qpid {
- namespace broker {
- /**
- * An empty interface allowing opaque implementations of some
- * form of token to identify a connection.
- */
- class ConnectionToken{
- public:
- virtual ~ConnectionToken(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/Consumer.h b/Final/cpp/lib/broker/Consumer.h
deleted file mode 100644
index 26deef4a26..0000000000
--- a/Final/cpp/lib/broker/Consumer.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 _Consumer_
-#define _Consumer_
-
-#include <BrokerMessage.h>
-
-namespace qpid {
- namespace broker {
- class Consumer{
- public:
- virtual bool deliver(Message::shared_ptr& msg) = 0;
- virtual ~Consumer(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/Content.h b/Final/cpp/lib/broker/Content.h
deleted file mode 100644
index 8aacf02959..0000000000
--- a/Final/cpp/lib/broker/Content.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 _Content_
-#define _Content_
-
-#include <AMQContentBody.h>
-#include <Buffer.h>
-#include <OutputHandler.h>
-#include <ProtocolVersion.h>
-
-namespace qpid {
- namespace broker {
- class Content{
- public:
- virtual void add(qpid::framing::AMQContentBody::shared_ptr data) = 0;
- virtual u_int32_t size() = 0;
- virtual void send(qpid::framing::ProtocolVersion& version, qpid::framing::OutputHandler* out, int channel, u_int32_t framesize) = 0;
- virtual void encode(qpid::framing::Buffer& buffer) = 0;
- virtual void destroy() = 0;
- virtual ~Content(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/Daemon.cpp b/Final/cpp/lib/broker/Daemon.cpp
deleted file mode 100644
index 3a0e687bf2..0000000000
--- a/Final/cpp/lib/broker/Daemon.cpp
+++ /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.
- *
- */
-#include "Daemon.h"
-#include "Exception.h"
-
-#include <boost/iostreams/stream.hpp>
-#include <boost/iostreams/device/file_descriptor.hpp>
-
-#include <sstream>
-
-#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;
-typedef boost::iostreams::stream<boost::iostreams::file_descriptor> fdstream;
-
-namespace {
-/** Throw an exception containing msg and strerror if throwIf is true.
- * Name is supposed to be reminiscent of perror().
- */
-void terror(bool throwIf, const string& msg, int errNo=errno) {
- if (throwIf)
- throw Exception(msg + (errNo? ": "+strError(errNo) : string(".")));
-}
-
-
-struct LockFile : public fdstream {
-
- LockFile(const std::string& path_, bool create)
- : path(path_), fd(-1), created(create)
- {
- errno = 0;
- int flags=create ? O_WRONLY|O_CREAT|O_NOFOLLOW : O_RDWR;
- fd = ::open(path.c_str(), flags, 0644);
- terror(fd < 0,"Cannot open "+path);
- terror(::lockf(fd, F_TLOCK, 0) < 0, "Cannot lock "+path);
- open(boost::iostreams::file_descriptor(fd));
- }
-
- ~LockFile() {
- if (fd >= 0) {
- ::lockf(fd, F_ULOCK, 0);
- close();
- }
- }
-
- std::string path;
- int fd;
- bool created;
-};
-
-} // namespace
-
-Daemon::Daemon() {
- pid = -1;
- pipeFds[0] = pipeFds[1] = -1;
-}
-
-string Daemon::dir() {
- return (getuid() == 0 ? "/var/run" : "/tmp");
-}
-
-string Daemon::pidFile(uint16_t port) {
- ostringstream path;
- path << dir() << "/qpidd." << port << ".pid";
- return path.str();
-}
-
-void Daemon::fork()
-{
- terror(pipe(pipeFds) < 0, "Can't create pipe");
- terror((pid = ::fork()) < 0, "Daemon fork failed");
- if (pid == 0) { // Child
- try {
- // File descriptors
- terror(::close(pipeFds[0])<0, "Cannot close read pipe");
- terror(::close(0)<0, "Cannot close stdin");
- terror(::close(1)<0, "Cannot close stdout");
- terror(::close(2)<0, "Cannot close stderr");
- int fd=::open("/dev/null",O_RDWR); // stdin
- terror(fd != 0, "Cannot re-open stdin");
- terror(::dup(fd)<0, "Cannot re-open stdout");
- terror(::dup(fd)<0, "Cannot re-open stderror");
-
- // Misc
- terror(setsid()<0, "Cannot set session ID");
- terror(chdir(dir().c_str()) < 0, "Cannot change directory to "+dir());
- umask(027);
-
- // Child behavior
- child();
- }
- catch (const exception& e) {
- fdstream pipe(pipeFds[1]);
- assert(pipe.is_open());
- pipe << "0 " << e.what() << endl;
- }
- }
- 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.
- errno = 0;
- struct timeval tv;
- tv.tv_sec = timeout;
- tv.tv_usec = 0;
-
- fd_set fds;
- FD_ZERO(&fds);
- FD_SET(pipeFds[0], &fds);
- terror(1 != select(FD_SETSIZE, &fds, 0, 0, &tv), "No response from daemon process");
-
- fdstream pipe(pipeFds[0]);
- uint16_t value = 0;
- pipe >> value >> skipws;
- if (value == 0) {
- string errmsg;
- getline(pipe, errmsg);
- throw Exception("Daemon startup failed"+ (errmsg.empty() ? string(".") : ": " + errmsg));
- }
- return value;
-}
-
-void Daemon::ready(uint16_t port) { // child
- lockFile = pidFile(port);
- LockFile lf(lockFile, true);
- lf << getpid() << endl;
- if (lf.fail())
- throw Exception("Cannot write lock file "+lockFile);
- fdstream pipe(pipeFds[1]);
- pipe << port << endl;;
-}
-
-pid_t Daemon::getPid(uint16_t port) {
- string name = pidFile(port);
- LockFile lockFile(name, false);
- pid_t pid;
- lockFile >> pid;
- if (lockFile.fail())
- throw Exception("Cannot read lock file "+name);
- 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/Final/cpp/lib/broker/Daemon.h b/Final/cpp/lib/broker/Daemon.h
deleted file mode 100644
index a9755bc8e7..0000000000
--- a/Final/cpp/lib/broker/Daemon.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef _broker_Daemon_h
-#define _broker_Daemon_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 <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(uint16_t port);
-
- Daemon();
-
- 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 dir();
- static std::string pidFile(uint16_t port);
-
- pid_t pid;
- int pipeFds[2];
- std::string lockFile;
-};
-
-}} // namespace qpid::broker
-
-#endif /*!_broker_Daemon_h*/
diff --git a/Final/cpp/lib/broker/DeletingTxOp.cpp b/Final/cpp/lib/broker/DeletingTxOp.cpp
deleted file mode 100644
index 25fe9c98db..0000000000
--- a/Final/cpp/lib/broker/DeletingTxOp.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 <DeletingTxOp.h>
-
-using namespace qpid::broker;
-
-DeletingTxOp::DeletingTxOp(TxOp* const _delegate) : delegate(_delegate){}
-
-bool DeletingTxOp::prepare(TransactionContext* ctxt) throw(){
- return delegate && delegate->prepare(ctxt);
-}
-
-void DeletingTxOp::commit() throw(){
- if(delegate){
- delegate->commit();
- delete delegate;
- delegate = 0;
- }
-}
-
-void DeletingTxOp::rollback() throw(){
- if(delegate){
- delegate->rollback();
- delete delegate;
- delegate = 0;
- }
-}
diff --git a/Final/cpp/lib/broker/DeletingTxOp.h b/Final/cpp/lib/broker/DeletingTxOp.h
deleted file mode 100644
index 3e026cd4ca..0000000000
--- a/Final/cpp/lib/broker/DeletingTxOp.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 _DeletingTxOp_
-#define _DeletingTxOp_
-
-#include <TxOp.h>
-
-namespace qpid {
- namespace broker {
- /**
- * TxOp wrapper that will delegate calls & delete the object
- * to which it delegates after completion of the transaction.
- */
- class DeletingTxOp : public virtual TxOp{
- TxOp* delegate;
- public:
- DeletingTxOp(TxOp* const delegate);
- virtual bool prepare(TransactionContext* ctxt) throw();
- virtual void commit() throw();
- virtual void rollback() throw();
- virtual ~DeletingTxOp(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/Deliverable.h b/Final/cpp/lib/broker/Deliverable.h
deleted file mode 100644
index e33443555d..0000000000
--- a/Final/cpp/lib/broker/Deliverable.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 _Deliverable_
-#define _Deliverable_
-
-#include <BrokerQueue.h>
-
-namespace qpid {
- namespace broker {
- class Deliverable{
- public:
- virtual void deliverTo(Queue::shared_ptr& queue) = 0;
- virtual ~Deliverable(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/DeliverableMessage.cpp b/Final/cpp/lib/broker/DeliverableMessage.cpp
deleted file mode 100644
index b9c89da690..0000000000
--- a/Final/cpp/lib/broker/DeliverableMessage.cpp
+++ /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.
- *
- */
-#include <DeliverableMessage.h>
-
-using namespace qpid::broker;
-
-DeliverableMessage::DeliverableMessage(Message::shared_ptr& _msg) : msg(_msg)
-{
-}
-
-void DeliverableMessage::deliverTo(Queue::shared_ptr& queue)
-{
- queue->deliver(msg);
-}
-
diff --git a/Final/cpp/lib/broker/DeliverableMessage.h b/Final/cpp/lib/broker/DeliverableMessage.h
deleted file mode 100644
index 962f0da640..0000000000
--- a/Final/cpp/lib/broker/DeliverableMessage.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.
- *
- */
-#ifndef _DeliverableMessage_
-#define _DeliverableMessage_
-
-#include <Deliverable.h>
-#include <BrokerMessage.h>
-#include <BrokerQueue.h>
-
-namespace qpid {
- namespace broker {
- class DeliverableMessage : public Deliverable{
- Message::shared_ptr msg;
- public:
- DeliverableMessage(Message::shared_ptr& msg);
- virtual void deliverTo(Queue::shared_ptr& queue);
- virtual ~DeliverableMessage(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/DeliveryRecord.cpp b/Final/cpp/lib/broker/DeliveryRecord.cpp
deleted file mode 100644
index 19b01cc312..0000000000
--- a/Final/cpp/lib/broker/DeliveryRecord.cpp
+++ /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.
- *
- */
-#include <DeliveryRecord.h>
-#include <BrokerChannel.h>
-
-using namespace qpid::broker;
-using std::string;
-
-DeliveryRecord::DeliveryRecord(Message::shared_ptr _msg,
- Queue::shared_ptr _queue,
- const string _consumerTag,
- const u_int64_t _deliveryTag) : msg(_msg),
- queue(_queue),
- consumerTag(_consumerTag),
- deliveryTag(_deliveryTag),
- pull(false){}
-
-DeliveryRecord::DeliveryRecord(Message::shared_ptr _msg,
- Queue::shared_ptr _queue,
- const u_int64_t _deliveryTag) : msg(_msg),
- queue(_queue),
- consumerTag(""),
- deliveryTag(_deliveryTag),
- pull(true){}
-
-
-void DeliveryRecord::discard(TransactionContext* ctxt, const std::string* const xid) const{
- queue->dequeue(ctxt, msg, xid);
-}
-
-void DeliveryRecord::discard() const{
- discard(0, 0);
-}
-
-bool DeliveryRecord::matches(u_int64_t tag) const{
- return deliveryTag == tag;
-}
-
-bool DeliveryRecord::coveredBy(const AccumulatedAck* const range) const{
- return range->covers(deliveryTag);
-}
-
-void DeliveryRecord::redeliver(Channel* const channel) const{
- if(pull){
- //if message was originally sent as response to get, we must requeue it
- requeue();
- }else{
- channel->deliver(msg, consumerTag, deliveryTag);
- }
-}
-
-void DeliveryRecord::requeue() const{
- msg->redeliver();
- queue->process(msg);
-}
-
-void DeliveryRecord::addTo(Prefetch* const prefetch) const{
- if(!pull){
- //ignore 'pulled' messages (i.e. those that were sent in
- //response to get) when calculating prefetch
- prefetch->size += msg->contentSize();
- prefetch->count++;
- }
-}
-
-void DeliveryRecord::subtractFrom(Prefetch* const prefetch) const{
- if(!pull){
- //ignore 'pulled' messages (i.e. those that were sent in
- //response to get) when calculating prefetch
- prefetch->size -= msg->contentSize();
- prefetch->count--;
- }
-}
diff --git a/Final/cpp/lib/broker/DeliveryRecord.h b/Final/cpp/lib/broker/DeliveryRecord.h
deleted file mode 100644
index 01a4024b28..0000000000
--- a/Final/cpp/lib/broker/DeliveryRecord.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 _DeliveryRecord_
-#define _DeliveryRecord_
-
-#include <algorithm>
-#include <list>
-#include <AccumulatedAck.h>
-#include <BrokerMessage.h>
-#include <Prefetch.h>
-#include <BrokerQueue.h>
-
-namespace qpid {
- namespace broker {
- class Channel;
-
- /**
- * Record of a delivery for which an ack is outstanding.
- */
- class DeliveryRecord{
- mutable Message::shared_ptr msg;
- mutable Queue::shared_ptr queue;
- std::string consumerTag;
- u_int64_t deliveryTag;
- bool pull;
-
- public:
- DeliveryRecord(Message::shared_ptr msg, Queue::shared_ptr queue, const std::string consumerTag, const u_int64_t deliveryTag);
- DeliveryRecord(Message::shared_ptr msg, Queue::shared_ptr queue, const u_int64_t deliveryTag);
-
- void discard() const;
- void discard(TransactionContext* ctxt, const std::string* const xid) const;
- bool matches(u_int64_t tag) const;
- bool coveredBy(const AccumulatedAck* const range) const;
- void requeue() const;
- void redeliver(Channel* const) const;
- void addTo(Prefetch* const prefetch) const;
- void subtractFrom(Prefetch* const prefetch) const;
- };
-
- typedef std::list<DeliveryRecord>::iterator ack_iterator;
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/DirectExchange.cpp b/Final/cpp/lib/broker/DirectExchange.cpp
deleted file mode 100644
index c898ae8d7e..0000000000
--- a/Final/cpp/lib/broker/DirectExchange.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 <DirectExchange.h>
-#include <ExchangeBinding.h>
-#include <iostream>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-DirectExchange::DirectExchange(const string& _name) : Exchange(_name) {
-
-}
-
-void DirectExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* args){
- Mutex::ScopedLock l(lock);
- std::vector<Queue::shared_ptr>& queues(bindings[routingKey]);
- std::vector<Queue::shared_ptr>::iterator i = find(queues.begin(), queues.end(), queue);
- if(i == queues.end()){
- bindings[routingKey].push_back(queue);
- queue->bound(new ExchangeBinding(this, queue, routingKey, args));
- }
-}
-
-void DirectExchange::unbind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* /*args*/){
- Mutex::ScopedLock l(lock);
- std::vector<Queue::shared_ptr>& queues(bindings[routingKey]);
-
- std::vector<Queue::shared_ptr>::iterator i = find(queues.begin(), queues.end(), queue);
- if(i < queues.end()){
- queues.erase(i);
- if(queues.empty()){
- bindings.erase(routingKey);
- }
- }
-}
-
-void DirectExchange::route(Deliverable& msg, const string& routingKey, const FieldTable* /*args*/){
- Mutex::ScopedLock l(lock);
- std::vector<Queue::shared_ptr>& queues(bindings[routingKey]);
- int count(0);
- for(std::vector<Queue::shared_ptr>::iterator i = queues.begin(); i != queues.end(); i++, count++){
- msg.deliverTo(*i);
- }
- if(!count){
- std::cout << "WARNING: DirectExchange " << getName() << " could not route message with key " << routingKey << std::endl;
- }
-}
-
-DirectExchange::~DirectExchange(){
-
-}
-
-
-const std::string DirectExchange::typeName("direct");
diff --git a/Final/cpp/lib/broker/DirectExchange.h b/Final/cpp/lib/broker/DirectExchange.h
deleted file mode 100644
index a7ef5aca9e..0000000000
--- a/Final/cpp/lib/broker/DirectExchange.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 _DirectExchange_
-#define _DirectExchange_
-
-#include <map>
-#include <vector>
-#include <BrokerExchange.h>
-#include <FieldTable.h>
-#include <BrokerMessage.h>
-#include <sys/Monitor.h>
-#include <BrokerQueue.h>
-
-namespace qpid {
-namespace broker {
- class DirectExchange : public virtual Exchange{
- std::map<string, std::vector<Queue::shared_ptr> > bindings;
- qpid::sys::Mutex lock;
-
- public:
- static const std::string typeName;
-
- DirectExchange(const std::string& name);
-
- virtual std::string getType(){ return typeName; }
-
- virtual void bind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual void 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 ~DirectExchange();
- };
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/ExchangeBinding.cpp b/Final/cpp/lib/broker/ExchangeBinding.cpp
deleted file mode 100644
index bf2102414d..0000000000
--- a/Final/cpp/lib/broker/ExchangeBinding.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 <ExchangeBinding.h>
-#include <BrokerExchange.h>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-ExchangeBinding::ExchangeBinding(Exchange* _e, Queue::shared_ptr _q, const string& _key, const FieldTable* _args) : e(_e), q(_q), key(_key), args(_args){}
-
-void ExchangeBinding::cancel(){
- e->unbind(q, key, args);
- delete this;
-}
-
-ExchangeBinding::~ExchangeBinding(){
-}
diff --git a/Final/cpp/lib/broker/ExchangeBinding.h b/Final/cpp/lib/broker/ExchangeBinding.h
deleted file mode 100644
index 2afaa89552..0000000000
--- a/Final/cpp/lib/broker/ExchangeBinding.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 _ExchangeBinding_
-#define _ExchangeBinding_
-
-#include <Binding.h>
-#include <FieldTable.h>
-#include <BrokerQueue.h>
-
-namespace qpid {
- namespace broker {
- class Exchange;
- class Queue;
-
- class ExchangeBinding : public virtual Binding{
- Exchange* e;
- Queue::shared_ptr q;
- const string key;
- const qpid::framing::FieldTable* args;
- public:
- ExchangeBinding(Exchange* _e, Queue::shared_ptr _q, const string& _key, const qpid::framing::FieldTable* _args);
- virtual void cancel();
- virtual ~ExchangeBinding();
- };
- }
-}
-
-
-#endif
-
diff --git a/Final/cpp/lib/broker/ExchangeRegistry.cpp b/Final/cpp/lib/broker/ExchangeRegistry.cpp
deleted file mode 100644
index 7bf96c4544..0000000000
--- a/Final/cpp/lib/broker/ExchangeRegistry.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 <ExchangeRegistry.h>
-#include <DirectExchange.h>
-#include <FanOutExchange.h>
-#include <HeadersExchange.h>
-#include <TopicExchange.h>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-using std::pair;
-
-pair<Exchange::shared_ptr, bool> ExchangeRegistry::declare(const string& name, const string& type) throw(UnknownExchangeTypeException){
- Mutex::ScopedLock 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));
- }else if(type == DirectExchange::typeName){
- exchange = Exchange::shared_ptr(new DirectExchange(name));
- }else if(type == FanOutExchange::typeName){
- exchange = Exchange::shared_ptr(new FanOutExchange(name));
- }else if (type == HeadersExchange::typeName) {
- exchange = Exchange::shared_ptr(new HeadersExchange(name));
- }else{
- throw UnknownExchangeTypeException();
- }
- 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){
- Mutex::ScopedLock locker(lock);
- exchanges.erase(name);
-}
-
-Exchange::shared_ptr ExchangeRegistry::get(const string& name){
- Mutex::ScopedLock locker(lock);
- return exchanges[name];
-}
-
-namespace
-{
-const std::string empty;
-}
-
-Exchange::shared_ptr ExchangeRegistry::getDefault()
-{
- return get(empty);
-}
diff --git a/Final/cpp/lib/broker/ExchangeRegistry.h b/Final/cpp/lib/broker/ExchangeRegistry.h
deleted file mode 100644
index 8dcd0d3623..0000000000
--- a/Final/cpp/lib/broker/ExchangeRegistry.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 _ExchangeRegistry_
-#define _ExchangeRegistry_
-
-#include <map>
-#include <BrokerExchange.h>
-#include <sys/Monitor.h>
-
-namespace qpid {
-namespace broker {
- struct UnknownExchangeTypeException{};
-
- class ExchangeRegistry{
- typedef std::map<std::string, Exchange::shared_ptr> ExchangeMap;
- ExchangeMap exchanges;
- qpid::sys::Mutex lock;
- public:
- std::pair<Exchange::shared_ptr, bool> declare(const std::string& name, const std::string& type) throw(UnknownExchangeTypeException);
- void destroy(const std::string& name);
- Exchange::shared_ptr get(const std::string& name);
- Exchange::shared_ptr getDefault();
- };
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/FanOutExchange.cpp b/Final/cpp/lib/broker/FanOutExchange.cpp
deleted file mode 100644
index 48afcc20d5..0000000000
--- a/Final/cpp/lib/broker/FanOutExchange.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 <FanOutExchange.h>
-#include <ExchangeBinding.h>
-#include <algorithm>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-FanOutExchange::FanOutExchange(const std::string& _name) : Exchange(_name) {}
-
-void FanOutExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* args){
- Mutex::ScopedLock locker(lock);
- // Add if not already present.
- Queue::vector::iterator i = std::find(bindings.begin(), bindings.end(), queue);
- if (i == bindings.end()) {
- bindings.push_back(queue);
- queue->bound(new ExchangeBinding(this, queue, routingKey, args));
- }
-}
-
-void FanOutExchange::unbind(Queue::shared_ptr queue, const string& /*routingKey*/, const FieldTable* /*args*/){
- Mutex::ScopedLock locker(lock);
- Queue::vector::iterator i = std::find(bindings.begin(), bindings.end(), queue);
- if (i != bindings.end()) {
- bindings.erase(i);
- // TODO aconway 2006-09-14: What about the ExchangeBinding object?
- // Don't we have to verify routingKey/args match?
- }
-}
-
-void FanOutExchange::route(Deliverable& msg, const string& /*routingKey*/, const FieldTable* /*args*/){
- Mutex::ScopedLock locker(lock);
- for(Queue::vector::iterator i = bindings.begin(); i != bindings.end(); ++i){
- msg.deliverTo(*i);
- }
-}
-
-FanOutExchange::~FanOutExchange() {}
-
-const std::string FanOutExchange::typeName("fanout");
diff --git a/Final/cpp/lib/broker/FanOutExchange.h b/Final/cpp/lib/broker/FanOutExchange.h
deleted file mode 100644
index 6dc70e69bb..0000000000
--- a/Final/cpp/lib/broker/FanOutExchange.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 _FanOutExchange_
-#define _FanOutExchange_
-
-#include <map>
-#include <vector>
-#include <BrokerExchange.h>
-#include <FieldTable.h>
-#include <BrokerMessage.h>
-#include <sys/Monitor.h>
-#include <BrokerQueue.h>
-
-namespace qpid {
-namespace broker {
-
-class FanOutExchange : public virtual Exchange {
- std::vector<Queue::shared_ptr> bindings;
- qpid::sys::Mutex lock;
-
- public:
- static const std::string typeName;
-
- FanOutExchange(const std::string& name);
-
- virtual std::string getType(){ return typeName; }
-
- virtual void bind(Queue::shared_ptr queue, const std::string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual void 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 ~FanOutExchange();
-};
-
-}
-}
-
-
-
-#endif
diff --git a/Final/cpp/lib/broker/HeadersExchange.cpp b/Final/cpp/lib/broker/HeadersExchange.cpp
deleted file mode 100644
index acd344725a..0000000000
--- a/Final/cpp/lib/broker/HeadersExchange.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 <HeadersExchange.h>
-#include <ExchangeBinding.h>
-#include <Value.h>
-#include <QpidError.h>
-#include <algorithm>
-
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-// 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");
-}
-
-HeadersExchange::HeadersExchange(const string& _name) : Exchange(_name) { }
-
-void HeadersExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* args){
- Mutex::ScopedLock locker(lock);
- std::string what = args->getString("x-match");
- if (what != all && what != any) {
- THROW_QPID_ERROR(PROTOCOL_ERROR, "Invalid x-match value binding to headers exchange.");
- }
- bindings.push_back(Binding(*args, queue));
- queue->bound(new ExchangeBinding(this, queue, routingKey, args));
-}
-
-void HeadersExchange::unbind(Queue::shared_ptr queue, const string& /*routingKey*/, const FieldTable* args){
- Mutex::ScopedLock locker(lock);
- Bindings::iterator i =
- std::find(bindings.begin(),bindings.end(), Binding(*args, queue));
- if (i != bindings.end()) bindings.erase(i);
-}
-
-
-void HeadersExchange::route(Deliverable& msg, const string& /*routingKey*/, const FieldTable* args){
- Mutex::ScopedLock locker(lock);;
- for (Bindings::iterator i = bindings.begin(); i != bindings.end(); ++i) {
- if (match(i->first, *args)) msg.deliverTo(i->second);
- }
-}
-
-HeadersExchange::~HeadersExchange() {}
-
-const std::string HeadersExchange::typeName("headers");
-
-namespace
-{
-
- bool match_values(const Value& bind, const Value& msg) {
- return dynamic_cast<const EmptyValue*>(&bind) || bind == msg;
- }
-
-}
-
-
-bool HeadersExchange::match(const FieldTable& bind, const FieldTable& msg) {
- typedef FieldTable::ValueMap Map;
- std::string what = bind.getString(x_match);
- if (what == all) {
- for (Map::const_iterator i = bind.getMap().begin();
- i != bind.getMap().end();
- ++i)
- {
- if (i->first != x_match)
- {
- Map::const_iterator j = msg.getMap().find(i->first);
- if (j == msg.getMap().end()) return false;
- if (!match_values(*(i->second), *(j->second))) return false;
- }
- }
- return true;
- } else if (what == any) {
- for (Map::const_iterator i = bind.getMap().begin();
- i != bind.getMap().end();
- ++i)
- {
- if (i->first != x_match)
- {
- Map::const_iterator j = msg.getMap().find(i->first);
- if (j != msg.getMap().end()) {
- if (match_values(*(i->second), *(j->second))) return true;
- }
- }
- }
- return false;
- } else {
- return false;
- }
-}
-
-
-
diff --git a/Final/cpp/lib/broker/HeadersExchange.h b/Final/cpp/lib/broker/HeadersExchange.h
deleted file mode 100644
index 5e8da5ad85..0000000000
--- a/Final/cpp/lib/broker/HeadersExchange.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 _HeadersExchange_
-#define _HeadersExchange_
-
-#include <vector>
-#include <BrokerExchange.h>
-#include <FieldTable.h>
-#include <BrokerMessage.h>
-#include <sys/Monitor.h>
-#include <BrokerQueue.h>
-
-namespace qpid {
-namespace broker {
-
-
-class HeadersExchange : public virtual Exchange {
- typedef std::pair<qpid::framing::FieldTable, Queue::shared_ptr> Binding;
- typedef std::vector<Binding> Bindings;
-
- Bindings bindings;
- qpid::sys::Mutex lock;
-
- public:
- static const std::string typeName;
-
- HeadersExchange(const string& name);
-
- virtual std::string getType(){ return typeName; }
-
- virtual void bind(Queue::shared_ptr queue, const string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual void 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 ~HeadersExchange();
-
- static bool match(const qpid::framing::FieldTable& bindArgs, const qpid::framing::FieldTable& msgArgs);
-};
-
-
-
-}
-}
-
-#endif
diff --git a/Final/cpp/lib/broker/InMemoryContent.cpp b/Final/cpp/lib/broker/InMemoryContent.cpp
deleted file mode 100644
index 07af8633e5..0000000000
--- a/Final/cpp/lib/broker/InMemoryContent.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 <InMemoryContent.h>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-using boost::static_pointer_cast;
-
-void InMemoryContent::add(AMQContentBody::shared_ptr data)
-{
- content.push_back(data);
-}
-
-u_int32_t InMemoryContent::size()
-{
- int sum(0);
- for (content_iterator i = content.begin(); i != content.end(); i++) {
- sum += (*i)->size();
- }
- return sum;
-}
-
-void InMemoryContent::send(qpid::framing::ProtocolVersion& version, OutputHandler* out, int channel, u_int32_t framesize)
-{
- for (content_iterator i = content.begin(); i != content.end(); i++) {
- if ((*i)->size() > framesize) {
- u_int32_t offset = 0;
- for (int chunk = (*i)->size() / framesize; chunk > 0; chunk--) {
- string data = (*i)->getData().substr(offset, framesize);
- out->send(new AMQFrame(version, channel, new AMQContentBody(data)));
- offset += framesize;
- }
- u_int32_t remainder = (*i)->size() % framesize;
- if (remainder) {
- string data = (*i)->getData().substr(offset, remainder);
- out->send(new AMQFrame(version, channel, new AMQContentBody(data)));
- }
- } else {
- AMQBody::shared_ptr contentBody = static_pointer_cast<AMQBody, AMQContentBody>(*i);
- out->send(new AMQFrame(version, channel, contentBody));
- }
- }
-}
-
-void InMemoryContent::encode(Buffer& buffer)
-{
- for (content_iterator i = content.begin(); i != content.end(); i++) {
- (*i)->encode(buffer);
- }
-}
-
-void InMemoryContent::destroy()
-{
-}
diff --git a/Final/cpp/lib/broker/InMemoryContent.h b/Final/cpp/lib/broker/InMemoryContent.h
deleted file mode 100644
index 1db1acd7e1..0000000000
--- a/Final/cpp/lib/broker/InMemoryContent.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 _InMemoryContent_
-#define _InMemoryContent_
-
-#include <Content.h>
-#include <vector>
-
-
-namespace qpid {
- namespace broker {
- class InMemoryContent : public Content{
- typedef std::vector<qpid::framing::AMQContentBody::shared_ptr> content_list;
- typedef content_list::iterator content_iterator;
-
- content_list content;
- public:
- void add(qpid::framing::AMQContentBody::shared_ptr data);
- u_int32_t size();
- void send(qpid::framing::ProtocolVersion& version, qpid::framing::OutputHandler* out, int channel, u_int32_t framesize);
- void encode(qpid::framing::Buffer& buffer);
- void destroy();
- ~InMemoryContent(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/LazyLoadedContent.cpp b/Final/cpp/lib/broker/LazyLoadedContent.cpp
deleted file mode 100644
index ec1ca3e195..0000000000
--- a/Final/cpp/lib/broker/LazyLoadedContent.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 <LazyLoadedContent.h>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-LazyLoadedContent::LazyLoadedContent(MessageStore* const _store, Message* const _msg, u_int64_t _expectedSize) :
- store(_store), msg(_msg), expectedSize(_expectedSize) {}
-
-void LazyLoadedContent::add(AMQContentBody::shared_ptr data)
-{
- store->appendContent(msg, data->getData());
-}
-
-u_int32_t LazyLoadedContent::size()
-{
- return 0;//all content is written as soon as it is added
-}
-
-void LazyLoadedContent::send(qpid::framing::ProtocolVersion& version, OutputHandler* out, int channel, u_int32_t framesize)
-{
- if (expectedSize > framesize) {
- for (u_int64_t offset = 0; offset < expectedSize; offset += framesize) {
- u_int64_t remaining = expectedSize - offset;
- string data;
- store->loadContent(msg, data, offset, remaining > framesize ? framesize : remaining);
- out->send(new AMQFrame(version, channel, new AMQContentBody(data)));
- }
- } else {
- string data;
- store->loadContent(msg, data, 0, expectedSize);
- out->send(new AMQFrame(version, channel, new AMQContentBody(data)));
- }
-}
-
-void LazyLoadedContent::encode(Buffer&)
-{
- //do nothing as all content is written as soon as it is added
-}
-
-void LazyLoadedContent::destroy()
-{
- store->destroy(msg);
-}
diff --git a/Final/cpp/lib/broker/LazyLoadedContent.h b/Final/cpp/lib/broker/LazyLoadedContent.h
deleted file mode 100644
index 80f8cce4eb..0000000000
--- a/Final/cpp/lib/broker/LazyLoadedContent.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 _LazyLoadedContent_
-#define _LazyLoadedContent_
-
-#include <Content.h>
-#include <MessageStore.h>
-
-namespace qpid {
- namespace broker {
- class LazyLoadedContent : public Content{
- MessageStore* const store;
- Message* const msg;
- const u_int64_t expectedSize;
- public:
- LazyLoadedContent(MessageStore* const store, Message* const msg, u_int64_t expectedSize);
- void add(qpid::framing::AMQContentBody::shared_ptr data);
- u_int32_t size();
- void send(qpid::framing::ProtocolVersion& version, qpid::framing::OutputHandler* out, int channel, u_int32_t framesize);
- void encode(qpid::framing::Buffer& buffer);
- void destroy();
- ~LazyLoadedContent(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/Makefile.am b/Final/cpp/lib/broker/Makefile.am
deleted file mode 100644
index 1a3fc79dea..0000000000
--- a/Final/cpp/lib/broker/Makefile.am
+++ /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.
-#
-AM_CXXFLAGS = $(WARNING_CFLAGS)
-INCLUDES = \
- -I$(top_srcdir)/gen \
- -I$(top_srcdir)/lib/common \
- -I$(top_srcdir)/lib/common/sys \
- -I$(top_srcdir)/lib/common/framing \
- $(APR_CXXFLAGS)
-
-lib_LTLIBRARIES = libqpidbroker.la
-libqpidbroker_la_LIBADD = \
- ../common/libqpidcommon.la \
- -lboost_iostreams
-
-libqpidbroker_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO_ARG)
-libqpidbroker_la_SOURCES = \
- AccumulatedAck.cpp \
- AccumulatedAck.h \
- AutoDelete.cpp \
- AutoDelete.h \
- Binding.h \
- Broker.cpp \
- Broker.h \
- BrokerChannel.cpp \
- BrokerChannel.h \
- BrokerExchange.h \
- BrokerMessage.cpp \
- BrokerMessage.h \
- BrokerQueue.cpp \
- BrokerQueue.h \
- ConnectionToken.h \
- Consumer.h \
- Content.h \
- Daemon.cpp \
- Daemon.h \
- DeletingTxOp.cpp \
- DeletingTxOp.h \
- Deliverable.h \
- DeliverableMessage.cpp \
- DeliverableMessage.h \
- DeliveryRecord.cpp \
- DeliveryRecord.h \
- DirectExchange.cpp \
- DirectExchange.h \
- ExchangeBinding.cpp \
- ExchangeBinding.h \
- ExchangeRegistry.cpp \
- ExchangeRegistry.h \
- FanOutExchange.cpp \
- FanOutExchange.h \
- HeadersExchange.cpp \
- HeadersExchange.h \
- InMemoryContent.cpp \
- InMemoryContent.h \
- LazyLoadedContent.cpp \
- LazyLoadedContent.h \
- MessageBuilder.cpp \
- MessageBuilder.h \
- MessageStore.h \
- MessageStoreModule.cpp \
- MessageStoreModule.h \
- NameGenerator.cpp \
- NameGenerator.h \
- NullMessageStore.cpp \
- NullMessageStore.h \
- Prefetch.h \
- QueuePolicy.cpp \
- QueuePolicy.h \
- QueueRegistry.cpp \
- QueueRegistry.h \
- RecoveryManager.cpp \
- RecoveryManager.h \
- SessionHandlerFactoryImpl.cpp \
- SessionHandlerFactoryImpl.h \
- SessionHandlerImpl.cpp \
- SessionHandlerImpl.h \
- TopicExchange.cpp \
- TopicExchange.h \
- TransactionalStore.h \
- TxAck.cpp \
- TxAck.h \
- TxBuffer.cpp \
- TxBuffer.h \
- TxOp.h \
- TxPublish.cpp \
- TxPublish.h
-
-
-# Force build during dist phase so help2man will work.
-dist-hook: $(lib_LTLIBRARIES)
diff --git a/Final/cpp/lib/broker/MessageBuilder.cpp b/Final/cpp/lib/broker/MessageBuilder.cpp
deleted file mode 100644
index 41bf812d2d..0000000000
--- a/Final/cpp/lib/broker/MessageBuilder.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 <MessageBuilder.h>
-
-#include <InMemoryContent.h>
-#include <LazyLoadedContent.h>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-using std::auto_ptr;
-
-MessageBuilder::MessageBuilder(CompletionHandler* _handler, MessageStore* const _store, u_int64_t _stagingThreshold) :
- handler(_handler),
- store(_store),
- stagingThreshold(_stagingThreshold)
-{}
-
-void MessageBuilder::route(){
- if (message->isComplete()) {
- if (handler) handler->complete(message);
- message.reset();
- }
-}
-
-void MessageBuilder::initialise(Message::shared_ptr& msg){
- if(message.get()){
- THROW_QPID_ERROR(PROTOCOL_ERROR + 504, "Invalid message sequence: got publish before previous content was completed.");
- }
- message = msg;
-}
-
-void MessageBuilder::setHeader(AMQHeaderBody::shared_ptr& header){
- if(!message.get()){
- THROW_QPID_ERROR(PROTOCOL_ERROR + 504, "Invalid message sequence: got header before publish.");
- }
- message->setHeader(header);
- if (stagingThreshold && header->getContentSize() >= stagingThreshold) {
- store->stage(message.get());
- message->releaseContent(store);
- } else {
- auto_ptr<Content> content(new InMemoryContent());
- message->setContent(content);
- }
- route();
-}
-
-void MessageBuilder::addContent(AMQContentBody::shared_ptr& content){
- if(!message.get()){
- THROW_QPID_ERROR(PROTOCOL_ERROR + 504, "Invalid message sequence: got content before publish.");
- }
- message->addContent(content);
- route();
-}
diff --git a/Final/cpp/lib/broker/MessageBuilder.h b/Final/cpp/lib/broker/MessageBuilder.h
deleted file mode 100644
index 4e51f223f0..0000000000
--- a/Final/cpp/lib/broker/MessageBuilder.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 _MessageBuilder_
-#define _MessageBuilder_
-
-#include <memory>
-#include <QpidError.h>
-#include <BrokerExchange.h>
-#include <BrokerMessage.h>
-#include <MessageStore.h>
-#include <AMQContentBody.h>
-#include <AMQHeaderBody.h>
-#include <BasicPublishBody.h>
-
-namespace qpid {
- namespace broker {
- class MessageBuilder{
- public:
- class CompletionHandler{
- public:
- virtual void complete(Message::shared_ptr&) = 0;
- virtual ~CompletionHandler(){}
- };
- MessageBuilder(CompletionHandler* _handler, MessageStore* const store = 0, u_int64_t stagingThreshold = 0);
- void initialise(Message::shared_ptr& msg);
- void setHeader(qpid::framing::AMQHeaderBody::shared_ptr& header);
- void addContent(qpid::framing::AMQContentBody::shared_ptr& content);
- private:
- Message::shared_ptr message;
- CompletionHandler* handler;
- MessageStore* const store;
- const u_int64_t stagingThreshold;
-
- void route();
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/MessageStore.h b/Final/cpp/lib/broker/MessageStore.h
deleted file mode 100644
index 938f807a67..0000000000
--- a/Final/cpp/lib/broker/MessageStore.h
+++ /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 _MessageStore_
-#define _MessageStore_
-
-#include <BrokerMessage.h>
-#include <FieldTable.h>
-#include <RecoveryManager.h>
-#include <TransactionalStore.h>
-
-namespace qpid {
- namespace broker {
- struct MessageStoreSettings
- {
- /**
- * Messages whose content length is larger than this value
- * will be staged (i.e. will have thier data written to
- * disk as it arrives) and will load their data lazily. On
- * recovery therefore, only the headers should be loaded.
- */
- u_int64_t stagingThreshold;
- };
- /**
- * 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:
- /**
- * Record the existance of a durable queue
- */
- virtual void create(const Queue& queue, const qpid::framing::FieldTable& settings) = 0;
- /**
- * Destroy a durable queue
- */
- virtual void destroy(const Queue& queue) = 0;
-
- /**
- * Request recovery of queue and message state from store
- */
- virtual void recover(RecoveryManager& queues, const MessageStoreSettings* const settings = 0) = 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(Message* const 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(Message* const msg) = 0;
-
- /**
- * Appends content to a previously staged message
- */
- virtual void appendContent(Message* const 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(Message* const msg, std::string& data, u_int64_t offset, u_int32_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.
- *
- * @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, Message* const msg, const Queue& queue, const std::string * const xid) = 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.
- *
- * @param msg the message to dequeue
- * @param queue the name of th 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, Message* const msg, const Queue& queue, const std::string * const xid) = 0;
-
- /**
- * Treat all enqueue/dequeues where this xid was specified as being prepared.
- */
- virtual void prepared(const std::string * const xid) = 0;
- /**
- * Treat all enqueue/dequeues where this xid was specified as being committed.
- */
- virtual void committed(const std::string * const xid) = 0;
- /**
- * Treat all enqueue/dequeues where this xid was specified as being aborted.
- */
- virtual void aborted(const std::string * const xid) = 0;
-
- virtual ~MessageStore(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/MessageStoreModule.cpp b/Final/cpp/lib/broker/MessageStoreModule.cpp
deleted file mode 100644
index ccc5501379..0000000000
--- a/Final/cpp/lib/broker/MessageStoreModule.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 <MessageStoreModule.h>
-#include <iostream>
-
-using namespace qpid::broker;
-
-MessageStoreModule::MessageStoreModule(const std::string& name) : store(name)
-{
-}
-
-void MessageStoreModule::create(const Queue& queue, const qpid::framing::FieldTable& settings)
-{
- store->create(queue, settings);
-}
-
-void MessageStoreModule::destroy(const Queue& queue)
-{
- store->destroy(queue);
-}
-
-void MessageStoreModule::recover(RecoveryManager& registry, const MessageStoreSettings* const settings)
-{
- store->recover(registry, settings);
-}
-
-void MessageStoreModule::stage(Message* const msg)
-{
- store->stage(msg);
-}
-
-void MessageStoreModule::destroy(Message* const msg)
-{
- store->destroy(msg);
-}
-
-void MessageStoreModule::appendContent(Message* const msg, const std::string& data)
-{
- store->appendContent(msg, data);
-}
-
-void MessageStoreModule::loadContent(Message* const msg, string& data, u_int64_t offset, u_int32_t length)
-{
- store->loadContent(msg, data, offset, length);
-}
-
-void MessageStoreModule::enqueue(TransactionContext* ctxt, Message* const msg, const Queue& queue, const string * const xid)
-{
- store->enqueue(ctxt, msg, queue, xid);
-}
-
-void MessageStoreModule::dequeue(TransactionContext* ctxt, Message* const msg, const Queue& queue, const string * const xid)
-{
- store->dequeue(ctxt, msg, queue, xid);
-}
-
-void MessageStoreModule::prepared(const string * const xid)
-{
- store->prepared(xid);
-}
-
-void MessageStoreModule::committed(const string * const xid)
-{
- store->committed(xid);
-}
-
-void MessageStoreModule::aborted(const string * const xid)
-{
- store->aborted(xid);
-}
-
-std::auto_ptr<TransactionContext> MessageStoreModule::begin()
-{
- return store->begin();
-}
-
-void MessageStoreModule::commit(TransactionContext* ctxt)
-{
- store->commit(ctxt);
-}
-
-void MessageStoreModule::abort(TransactionContext* ctxt)
-{
- store->abort(ctxt);
-}
diff --git a/Final/cpp/lib/broker/MessageStoreModule.h b/Final/cpp/lib/broker/MessageStoreModule.h
deleted file mode 100644
index c49e06efa1..0000000000
--- a/Final/cpp/lib/broker/MessageStoreModule.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 _MessageStoreModule_
-#define _MessageStoreModule_
-
-#include <BrokerMessage.h>
-#include <MessageStore.h>
-#include <BrokerQueue.h>
-#include <RecoveryManager.h>
-#include <sys/Module.h>
-
-namespace qpid {
- namespace broker {
- /**
- * A null implementation of the MessageStore interface
- */
- class MessageStoreModule : public MessageStore{
- qpid::sys::Module<MessageStore> store;
- public:
- MessageStoreModule(const std::string& name);
- void create(const Queue& queue, const qpid::framing::FieldTable& settings);
- void destroy(const Queue& queue);
- void recover(RecoveryManager& queues, const MessageStoreSettings* const settings = 0);
- void stage(Message* const msg);
- void destroy(Message* const msg);
- void appendContent(Message* const msg, const std::string& data);
- void loadContent(Message* const msg, std::string& data, u_int64_t offset, u_int32_t length);
- void enqueue(TransactionContext* ctxt, Message* const msg, const Queue& queue, const string * const xid);
- void dequeue(TransactionContext* ctxt, Message* const msg, const Queue& queue, const string * const xid);
- void prepared(const std::string * const xid);
- void committed(const std::string * const xid);
- void aborted(const std::string * const xid);
- std::auto_ptr<TransactionContext> begin();
- void commit(TransactionContext* ctxt);
- void abort(TransactionContext* ctxt);
- ~MessageStoreModule(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/NameGenerator.cpp b/Final/cpp/lib/broker/NameGenerator.cpp
deleted file mode 100644
index 3f281859fa..0000000000
--- a/Final/cpp/lib/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/Final/cpp/lib/broker/NameGenerator.h b/Final/cpp/lib/broker/NameGenerator.h
deleted file mode 100644
index b2dbbdfb69..0000000000
--- a/Final/cpp/lib/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 <BrokerMessage.h>
-
-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/Final/cpp/lib/broker/NullMessageStore.cpp b/Final/cpp/lib/broker/NullMessageStore.cpp
deleted file mode 100644
index dd58539925..0000000000
--- a/Final/cpp/lib/broker/NullMessageStore.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 <NullMessageStore.h>
-
-#include <BrokerQueue.h>
-#include <RecoveryManager.h>
-
-#include <iostream>
-
-using namespace qpid::broker;
-
-NullMessageStore::NullMessageStore(bool _warn) : warn(_warn){}
-
-void NullMessageStore::create(const Queue& queue, const qpid::framing::FieldTable&)
-{
- if (warn) std::cout << "WARNING: Can't create durable queue '" << queue.getName() << "'. Persistence not enabled." << std::endl;
-}
-
-void NullMessageStore::destroy(const Queue& queue)
-{
- if (warn) std::cout << "WARNING: Can't destroy durable queue '" << queue.getName() << "'. Persistence not enabled." << std::endl;
-}
-
-void NullMessageStore::recover(RecoveryManager&, const MessageStoreSettings* const)
-{
- if (warn) std::cout << "Persistence not enabled, no recovery attempted." << std::endl;
-}
-
-void NullMessageStore::stage(Message* const)
-{
- if (warn) std::cout << "WARNING: Can't stage message. Persistence not enabled." << std::endl;
-}
-
-void NullMessageStore::destroy(Message* const)
-{
- if (warn) std::cout << "WARNING: No need to destroy staged message. Persistence not enabled." << std::endl;
-}
-
-void NullMessageStore::appendContent(Message* const, const string&)
-{
- if (warn) std::cout << "WARNING: Can't append content. Persistence not enabled." << std::endl;
-}
-
-void NullMessageStore::loadContent(Message* const, string&, u_int64_t, u_int32_t)
-{
- if (warn) std::cout << "WARNING: Can't load content. Persistence not enabled." << std::endl;
-}
-
-void NullMessageStore::enqueue(TransactionContext*, Message* const, const Queue& queue, const string * const)
-{
- if (warn) std::cout << "WARNING: Can't enqueue message onto '" << queue.getName() << "'. Persistence not enabled." << std::endl;
-}
-
-void NullMessageStore::dequeue(TransactionContext*, Message* const, const Queue& queue, const string * const)
-{
- if (warn) std::cout << "WARNING: Can't dequeue message from '" << queue.getName() << "'. Persistence not enabled." << std::endl;
-}
-
-void NullMessageStore::prepared(const string * const)
-{
- if (warn) std::cout << "WARNING: Persistence not enabled." << std::endl;
-}
-
-void NullMessageStore::committed(const string * const)
-{
- if (warn) std::cout << "WARNING: Persistence not enabled." << std::endl;
-}
-
-void NullMessageStore::aborted(const string * const)
-{
- if (warn) std::cout << "WARNING: Persistence not enabled." << std::endl;
-}
-
-std::auto_ptr<TransactionContext> NullMessageStore::begin()
-{
- return std::auto_ptr<TransactionContext>();
-}
-
-void NullMessageStore::commit(TransactionContext*)
-{
-}
-
-void NullMessageStore::abort(TransactionContext*)
-{
-}
diff --git a/Final/cpp/lib/broker/NullMessageStore.h b/Final/cpp/lib/broker/NullMessageStore.h
deleted file mode 100644
index ef2bea8fd6..0000000000
--- a/Final/cpp/lib/broker/NullMessageStore.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 _NullMessageStore_
-#define _NullMessageStore_
-
-#include <BrokerMessage.h>
-#include <MessageStore.h>
-#include <BrokerQueue.h>
-
-namespace qpid {
- namespace broker {
-
- /**
- * A null implementation of the MessageStore interface
- */
- class NullMessageStore : public MessageStore{
- const bool warn;
- public:
- NullMessageStore(bool warn = true);
- virtual void create(const Queue& queue, const qpid::framing::FieldTable& settings);
- virtual void destroy(const Queue& queue);
- virtual void recover(RecoveryManager& queues, const MessageStoreSettings* const settings = 0);
- virtual void stage(Message* const msg);
- virtual void destroy(Message* const msg);
- virtual void appendContent(Message* const msg, const std::string& data);
- virtual void loadContent(Message* const msg, std::string& data, u_int64_t offset, u_int32_t length);
- virtual void enqueue(TransactionContext* ctxt, Message* const msg, const Queue& queue, const string * const xid);
- virtual void dequeue(TransactionContext* ctxt, Message* const msg, const Queue& queue, const string * const xid);
- virtual void prepared(const std::string * const xid);
- virtual void committed(const std::string * const xid);
- virtual void aborted(const std::string * const xid);
- virtual std::auto_ptr<TransactionContext> begin();
- virtual void commit(TransactionContext* ctxt);
- virtual void abort(TransactionContext* ctxt);
- ~NullMessageStore(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/Prefetch.h b/Final/cpp/lib/broker/Prefetch.h
deleted file mode 100644
index a1adccaee7..0000000000
--- a/Final/cpp/lib/broker/Prefetch.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.
- *
- */
-#ifndef _Prefetch_
-#define _Prefetch_
-
-#include <amqp_types.h>
-
-namespace qpid {
- namespace broker {
- /**
- * Count and total size of asynchronously delivered
- * (i.e. pushed) messages that have acks outstanding.
- */
- struct Prefetch{
- u_int32_t size;
- u_int16_t count;
-
- void reset() { size = 0; count = 0; }
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/QueuePolicy.cpp b/Final/cpp/lib/broker/QueuePolicy.cpp
deleted file mode 100644
index e13fd62fc6..0000000000
--- a/Final/cpp/lib/broker/QueuePolicy.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 <QueuePolicy.h>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-QueuePolicy::QueuePolicy(u_int32_t _maxCount, u_int64_t _maxSize) :
- maxCount(_maxCount), maxSize(_maxSize), count(0), size(0) {}
-
-QueuePolicy::QueuePolicy(const FieldTable& settings) :
- maxCount(getInt(settings, maxCountKey, 0)),
- maxSize(getInt(settings, maxSizeKey, 0)), count(0), size(0) {}
-
-void QueuePolicy::enqueued(u_int64_t _size)
-{
- if (maxCount) count++;
- if (maxSize) size += _size;
-}
-
-void QueuePolicy::dequeued(u_int64_t _size)
-{
- if (maxCount) count--;
- if (maxSize) size -= _size;
-}
-
-bool QueuePolicy::limitExceeded()
-{
- return (maxSize && size > maxSize) || (maxCount && count > maxCount);
-}
-
-void QueuePolicy::update(FieldTable& settings)
-{
- if (maxCount) settings.setInt(maxCountKey, maxCount);
- if (maxSize) settings.setInt(maxSizeKey, maxSize);
-}
-
-
-int QueuePolicy::getInt(const FieldTable& settings, const std::string& key, int defaultValue)
-{
- //Note: currently field table only contain signed 32 bit ints, which
- // restricts the values that can be set on the queue policy.
- try {
- return settings.getInt(key);
- } catch (FieldNotFoundException& ignore) {
- return defaultValue;
- }
-}
-
-const std::string QueuePolicy::maxCountKey("qpid.max_count");
-const std::string QueuePolicy::maxSizeKey("qpid.max_size");
diff --git a/Final/cpp/lib/broker/QueuePolicy.h b/Final/cpp/lib/broker/QueuePolicy.h
deleted file mode 100644
index 597cfe7ce8..0000000000
--- a/Final/cpp/lib/broker/QueuePolicy.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 _QueuePolicy_
-#define _QueuePolicy_
-
-#include <FieldTable.h>
-
-namespace qpid {
- namespace broker {
- class QueuePolicy
- {
- static const std::string maxCountKey;
- static const std::string maxSizeKey;
-
- const u_int32_t maxCount;
- const u_int64_t maxSize;
- u_int32_t count;
- u_int64_t size;
-
- static int getInt(const qpid::framing::FieldTable& settings, const std::string& key, int defaultValue);
-
- public:
- QueuePolicy(u_int32_t maxCount, u_int64_t maxSize);
- QueuePolicy(const qpid::framing::FieldTable& settings);
- void enqueued(u_int64_t size);
- void dequeued(u_int64_t size);
- void update(qpid::framing::FieldTable& settings);
- bool limitExceeded();
- u_int32_t getMaxCount() const { return maxCount; }
- u_int64_t getMaxSize() const { return maxSize; }
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/QueueRegistry.cpp b/Final/cpp/lib/broker/QueueRegistry.cpp
deleted file mode 100644
index c69d553b06..0000000000
--- a/Final/cpp/lib/broker/QueueRegistry.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 <QueueRegistry.h>
-#include <SessionHandlerImpl.h>
-#include <sstream>
-#include <assert.h>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-
-QueueRegistry::QueueRegistry(MessageStore* const _store) : counter(1), store(_store){}
-
-QueueRegistry::~QueueRegistry()
-{
-}
-
-std::pair<Queue::shared_ptr, bool>
-QueueRegistry::declare(const string& declareName, bool durable,
- u_int32_t autoDelete, const ConnectionToken* owner)
-{
- Mutex::ScopedLock 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));
- queues[name] = queue;
- return std::pair<Queue::shared_ptr, bool>(queue, true);
- } else {
- return std::pair<Queue::shared_ptr, bool>(i->second, false);
- }
-}
-
-void QueueRegistry::destroy(const string& name){
- Mutex::ScopedLock locker(lock);
- queues.erase(name);
-}
-
-Queue::shared_ptr QueueRegistry::find(const string& name){
- Mutex::ScopedLock 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;
-}
-
-MessageStore* const QueueRegistry::getStore() const {
- return store;
-}
diff --git a/Final/cpp/lib/broker/QueueRegistry.h b/Final/cpp/lib/broker/QueueRegistry.h
deleted file mode 100644
index 7232024675..0000000000
--- a/Final/cpp/lib/broker/QueueRegistry.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 _QueueRegistry_
-#define _QueueRegistry_
-
-#include <map>
-#include <sys/Monitor.h>
-#include <BrokerQueue.h>
-
-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(MessageStore* const store = 0);
- ~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, u_int32_t autodelete = 0,
- const ConnectionToken* const 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);
-
- /**
- * Find the named queue. Return 0 if not found.
- */
- Queue::shared_ptr find(const string& name);
-
- /**
- * Generate unique queue name.
- */
- string generateName();
-
- /**
- * Return the message store used.
- */
- MessageStore* const getStore() const;
-
-
- private:
- typedef std::map<string, Queue::shared_ptr> QueueMap;
- QueueMap queues;
- qpid::sys::Mutex lock;
- int counter;
- MessageStore* const store;
-};
-
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/RecoveryManager.cpp b/Final/cpp/lib/broker/RecoveryManager.cpp
deleted file mode 100644
index 6ea4c00c65..0000000000
--- a/Final/cpp/lib/broker/RecoveryManager.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 <RecoveryManager.h>
-
-using namespace qpid::broker;
-
-RecoveryManager::RecoveryManager(QueueRegistry& _queues, ExchangeRegistry& _exchanges) : queues(_queues), exchanges(_exchanges) {}
-
-RecoveryManager::~RecoveryManager() {}
-
-Queue::shared_ptr RecoveryManager::recoverQueue(const string& name)
-{
- std::pair<Queue::shared_ptr, bool> result = queues.declare(name, true);
- Exchange::shared_ptr exchange = exchanges.getDefault();
- if (exchange) {
- exchange->bind(result.first, result.first->getName(), 0);
- }
- return result.first;
-}
-
-Exchange::shared_ptr RecoveryManager::recoverExchange(const string& name, const string& type)
-{
- return exchanges.declare(name, type).first;
-}
diff --git a/Final/cpp/lib/broker/RecoveryManager.h b/Final/cpp/lib/broker/RecoveryManager.h
deleted file mode 100644
index d4e4cff3fd..0000000000
--- a/Final/cpp/lib/broker/RecoveryManager.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 _RecoveryManager_
-#define _RecoveryManager_
-
-#include <ExchangeRegistry.h>
-#include <QueueRegistry.h>
-
-namespace qpid {
-namespace broker {
-
- class RecoveryManager{
- QueueRegistry& queues;
- ExchangeRegistry& exchanges;
- public:
- RecoveryManager(QueueRegistry& queues, ExchangeRegistry& exchanges);
- ~RecoveryManager();
- Queue::shared_ptr recoverQueue(const std::string& name);
- Exchange::shared_ptr recoverExchange(const std::string& name, const std::string& type);
- };
-
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/SessionHandlerFactoryImpl.cpp b/Final/cpp/lib/broker/SessionHandlerFactoryImpl.cpp
deleted file mode 100644
index 1b5441e3cf..0000000000
--- a/Final/cpp/lib/broker/SessionHandlerFactoryImpl.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 <SessionHandlerFactoryImpl.h>
-
-#include <DirectExchange.h>
-#include <FanOutExchange.h>
-#include <HeadersExchange.h>
-#include <MessageStoreModule.h>
-#include <NullMessageStore.h>
-#include <SessionHandlerImpl.h>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-
-namespace
-{
-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");
-}
-
-SessionHandlerFactoryImpl::SessionHandlerFactoryImpl(const std::string& _store, u_int64_t _stagingThreshold, u_int32_t _timeout) :
- store(_store.empty() ? (MessageStore*) new NullMessageStore() : (MessageStore*) new MessageStoreModule(_store)),
- queues(store.get()), settings(_timeout, _stagingThreshold), cleaner(&queues, _timeout/10)
-{
- exchanges.declare(empty, DirectExchange::typeName); // Default exchange.
- exchanges.declare(amq_direct, DirectExchange::typeName);
- exchanges.declare(amq_topic, TopicExchange::typeName);
- exchanges.declare(amq_fanout, FanOutExchange::typeName);
- exchanges.declare(amq_match, HeadersExchange::typeName);
-
- if(store.get()) {
- RecoveryManager recoverer(queues, exchanges);
- MessageStoreSettings storeSettings = { settings.stagingThreshold };
- store->recover(recoverer, &storeSettings);
- }
-
- cleaner.start();
-}
-
-SessionHandler* SessionHandlerFactoryImpl::create(SessionContext* ctxt)
-{
- return new SessionHandlerImpl(ctxt, &queues, &exchanges, &cleaner, settings);
-}
-
-SessionHandlerFactoryImpl::~SessionHandlerFactoryImpl()
-{
- cleaner.stop();
-}
diff --git a/Final/cpp/lib/broker/SessionHandlerFactoryImpl.h b/Final/cpp/lib/broker/SessionHandlerFactoryImpl.h
deleted file mode 100644
index a69b67b08d..0000000000
--- a/Final/cpp/lib/broker/SessionHandlerFactoryImpl.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 _SessionHandlerFactoryImpl_
-#define _SessionHandlerFactoryImpl_
-
-#include <AutoDelete.h>
-#include <ExchangeRegistry.h>
-#include <MessageStore.h>
-#include <QueueRegistry.h>
-#include <AMQFrame.h>
-#include <ProtocolInitiation.h>
-#include <sys/SessionContext.h>
-#include <sys/SessionHandler.h>
-#include <sys/SessionHandlerFactory.h>
-#include <sys/TimeoutHandler.h>
-#include <SessionHandlerImpl.h>
-#include <memory>
-
-namespace qpid {
- namespace broker {
-
- class SessionHandlerFactoryImpl : public virtual qpid::sys::SessionHandlerFactory
- {
- std::auto_ptr<MessageStore> store;
- QueueRegistry queues;
- ExchangeRegistry exchanges;
- const Settings settings;
- AutoDelete cleaner;
- public:
- SessionHandlerFactoryImpl(const std::string& store = "", u_int64_t stagingThreshold = 0, u_int32_t timeout = 30000);
- virtual qpid::sys::SessionHandler* create(qpid::sys::SessionContext* ctxt);
- virtual ~SessionHandlerFactoryImpl();
- };
-
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/SessionHandlerImpl.cpp b/Final/cpp/lib/broker/SessionHandlerImpl.cpp
deleted file mode 100644
index b23432e29d..0000000000
--- a/Final/cpp/lib/broker/SessionHandlerImpl.cpp
+++ /dev/null
@@ -1,468 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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 <SessionHandlerImpl.h>
-#include <FanOutExchange.h>
-#include <HeadersExchange.h>
-#include <TopicExchange.h>
-#include "assert.h"
-
-using namespace boost;
-using namespace qpid::broker;
-using namespace qpid::sys;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-SessionHandlerImpl::SessionHandlerImpl(SessionContext* _context,
- QueueRegistry* _queues,
- ExchangeRegistry* _exchanges,
- AutoDelete* _cleaner,
- const Settings& _settings) :
- context(_context),
- queues(_queues),
- exchanges(_exchanges),
- cleaner(_cleaner),
- settings(_settings),
- basicHandler(new BasicHandlerImpl(this)),
- channelHandler(new ChannelHandlerImpl(this)),
- connectionHandler(new ConnectionHandlerImpl(this)),
- exchangeHandler(new ExchangeHandlerImpl(this)),
- queueHandler(new QueueHandlerImpl(this)),
- txHandler(new TxHandlerImpl(this)),
- framemax(65536),
- heartbeat(0)
- {
-
- client =NULL;
-}
-
-SessionHandlerImpl::~SessionHandlerImpl(){
-
- if (client != NULL)
- delete client;
-
-}
-
-Channel* SessionHandlerImpl::getChannel(u_int16_t channel){
- channel_iterator i = channels.find(channel);
- if(i == channels.end()){
- std::stringstream out;
- out << "Unknown channel: " << channel;
- throw ConnectionException(504, out.str());
- }
- return i->second;
-}
-
-Queue::shared_ptr SessionHandlerImpl::getQueue(const string& name, u_int16_t channel){
- Queue::shared_ptr queue;
- if (name.empty()) {
- queue = getChannel(channel)->getDefaultQueue();
- if (!queue) throw ConnectionException( 530, "Queue must be specified or previously declared" );
- } else {
- queue = queues->find(name);
- if (queue == 0) {
- throw ChannelException( 404, "Queue not found: " + name);
- }
- }
- return queue;
-}
-
-
-Exchange::shared_ptr SessionHandlerImpl::findExchange(const string& name){
- return exchanges->get(name);
-}
-
-void SessionHandlerImpl::received(qpid::framing::AMQFrame* frame){
- u_int16_t channel = frame->getChannel();
- AMQBody::shared_ptr body = frame->getBody();
- AMQMethodBody::shared_ptr method;
-
- switch(body->type())
- {
- case METHOD_BODY:
- method = dynamic_pointer_cast<AMQMethodBody, AMQBody>(body);
- try{
- method->invoke(*this, channel);
- }catch(ChannelException& e){
- channels[channel]->close();
- channels.erase(channel);
- client->getChannel().close(channel, e.code, e.text, method->amqpClassId(), method->amqpMethodId());
- }catch(ConnectionException& e){
- client->getConnection().close(0, e.code, e.text, method->amqpClassId(), method->amqpMethodId());
- context->close();
- }catch(std::exception& e){
- string error(e.what());
- client->getConnection().close(0, 541/*internal error*/, error, method->amqpClassId(), method->amqpMethodId());
- context->close();
- }
- break;
-
- case HEADER_BODY:
- this->handleHeader(channel, dynamic_pointer_cast<AMQHeaderBody, AMQBody>(body));
- break;
-
- case CONTENT_BODY:
- this->handleContent(channel, dynamic_pointer_cast<AMQContentBody, AMQBody>(body));
- break;
-
- case HEARTBEAT_BODY:
- //channel must be 0
- this->handleHeartbeat(dynamic_pointer_cast<AMQHeartbeatBody, AMQBody>(body));
- break;
- }
-}
-
-void SessionHandlerImpl::initiated(qpid::framing::ProtocolInitiation* header){
-
- if (client == NULL)
- {
- client = new qpid::framing::AMQP_ClientProxy(context, header->getMajor(), header->getMinor());
-
-
- //send connection start
- FieldTable properties;
- string mechanisms("PLAIN");
- string locales("en_US"); // channel, majour, minor
- client->getConnection().start(0, header->getMajor(), header->getMinor(), properties, mechanisms, locales);
- }
-}
-
-
-void SessionHandlerImpl::idleOut(){
-
-}
-
-void SessionHandlerImpl::idleIn(){
-
-}
-
-void SessionHandlerImpl::closed(){
- try {
- for(channel_iterator i = channels.begin(); i != channels.end(); i = channels.begin()){
- Channel* c = i->second;
- channels.erase(i);
- c->close();
- delete c;
- }
- for(queue_iterator i = exclusiveQueues.begin(); i < exclusiveQueues.end(); i = exclusiveQueues.begin()){
- string name = (*i)->getName();
- queues->destroy(name);
- exclusiveQueues.erase(i);
- }
- } catch(std::exception& e) {
- std::cout << "Caught unhandled exception while closing session: " << e.what() << std::endl;
- }
-}
-
-void SessionHandlerImpl::handleHeader(u_int16_t channel, AMQHeaderBody::shared_ptr body){
- getChannel(channel)->handleHeader(body);
-}
-
-void SessionHandlerImpl::handleContent(u_int16_t channel, AMQContentBody::shared_ptr body){
- getChannel(channel)->handleContent(body);
-}
-
-void SessionHandlerImpl::handleHeartbeat(AMQHeartbeatBody::shared_ptr /*body*/){
- std::cout << "SessionHandlerImpl::handleHeartbeat()" << std::endl;
-}
-
-void SessionHandlerImpl::ConnectionHandlerImpl::startOk(
- u_int16_t /*channel*/, const FieldTable& /*clientProperties*/, const string& /*mechanism*/,
- const string& /*response*/, const string& /*locale*/){
- parent->client->getConnection().tune(0, 100, parent->framemax, parent->heartbeat);
-}
-
-void SessionHandlerImpl::ConnectionHandlerImpl::secureOk(u_int16_t /*channel*/, const string& /*response*/){}
-
-void SessionHandlerImpl::ConnectionHandlerImpl::tuneOk(u_int16_t /*channel*/, u_int16_t /*channelmax*/, u_int32_t framemax, u_int16_t heartbeat){
- parent->framemax = framemax;
- parent->heartbeat = heartbeat;
-}
-
-void SessionHandlerImpl::ConnectionHandlerImpl::open(u_int16_t /*channel*/, const string& /*virtualHost*/, const string& /*capabilities*/, bool /*insist*/){
- string knownhosts;
- parent->client->getConnection().openOk(0, knownhosts);
-}
-
-void SessionHandlerImpl::ConnectionHandlerImpl::close(
- u_int16_t /*channel*/, u_int16_t /*replyCode*/, const string& /*replyText*/,
- u_int16_t /*classId*/, u_int16_t /*methodId*/)
-{
- parent->client->getConnection().closeOk(0);
- parent->context->close();
-}
-
-void SessionHandlerImpl::ConnectionHandlerImpl::closeOk(u_int16_t /*channel*/){
- parent->context->close();
-}
-
-
-
-void SessionHandlerImpl::ChannelHandlerImpl::open(u_int16_t channel, const string& /*outOfBand*/){
-
-
- if (parent->channels[channel] == 0) {
- parent->channels[channel] = new Channel(parent->client->getProtocolVersion() , parent->context, channel, parent->framemax,
- parent->queues->getStore(), parent->settings.stagingThreshold);
- parent->client->getChannel().openOk(channel);
- } else {
- std::stringstream out;
- out << "Channel already open: " << channel;
- throw ConnectionException(504, out.str());
- }
-}
-
-void SessionHandlerImpl::ChannelHandlerImpl::flow(u_int16_t channel, bool active){
- parent->getChannel(channel)->flow(active);
- parent->client->getChannel().flowOk(channel, active);
-}
-void SessionHandlerImpl::ChannelHandlerImpl::flowOk(u_int16_t /*channel*/, bool /*active*/){}
-
-void SessionHandlerImpl::ChannelHandlerImpl::close(u_int16_t channel, u_int16_t /*replyCode*/, const string& /*replyText*/,
- u_int16_t /*classId*/, u_int16_t /*methodId*/){
- Channel* c = parent->getChannel(channel);
- if(c){
- parent->channels.erase(channel);
- c->close();
- delete c;
- parent->client->getChannel().closeOk(channel);
- }
-}
-
-void SessionHandlerImpl::ChannelHandlerImpl::closeOk(u_int16_t /*channel*/){}
-
-
-
-void SessionHandlerImpl::ExchangeHandlerImpl::declare(u_int16_t channel, u_int16_t /*ticket*/, const string& exchange, const string& type,
- bool passive, bool /*durable*/, bool /*autoDelete*/, bool /*internal*/, bool nowait,
- const FieldTable& /*arguments*/){
-
- if(passive){
- if(!parent->exchanges->get(exchange)){
- throw ChannelException(404, "Exchange not found: " + exchange);
- }
- }else{
- try{
- std::pair<Exchange::shared_ptr, bool> response = parent->exchanges->declare(exchange, type);
- if(!response.second && response.first->getType() != type){
- throw ConnectionException(530, "Exchange already declared to be of type "
- + response.first->getType() + ", requested " + type);
- }
- }catch(UnknownExchangeTypeException& e){
- throw ConnectionException(503, "Exchange type not implemented: " + type);
- }
- }
- if(!nowait){
- parent->client->getExchange().declareOk(channel);
- }
-}
-
-void SessionHandlerImpl::ExchangeHandlerImpl::delete_(u_int16_t channel, u_int16_t /*ticket*/,
- const string& exchange, bool /*ifUnused*/, bool nowait){
-
- //TODO: implement unused
- parent->exchanges->destroy(exchange);
- if(!nowait) parent->client->getExchange().deleteOk(channel);
-}
-
-void SessionHandlerImpl::QueueHandlerImpl::declare(u_int16_t channel, u_int16_t /*ticket*/, const string& name,
- bool passive, bool durable, bool exclusive,
- bool autoDelete, bool nowait, const qpid::framing::FieldTable& arguments){
- Queue::shared_ptr queue;
- if (passive && !name.empty()) {
- queue = parent->getQueue(name, channel);
- } else {
- std::pair<Queue::shared_ptr, bool> queue_created =
- parent->queues->declare(name, durable, autoDelete ? parent->settings.timeout : 0, exclusive ? parent : 0);
- queue = queue_created.first;
- assert(queue);
- if (queue_created.second) { // This is a new queue
-
- //apply settings & create persistent record if required
- queue_created.first->create(arguments);
-
- //add default binding:
- parent->exchanges->getDefault()->bind(queue, name, 0);
- if (exclusive) {
- parent->exclusiveQueues.push_back(queue);
- } else if(autoDelete){
- parent->cleaner->add(queue);
- }
- }
- }
- if (exclusive && !queue->isExclusiveOwner(parent)) {
- throw ChannelException(405, "Cannot grant exclusive access to queue");
- }
- parent->getChannel(channel)->setDefaultQueue(queue);
- if (!nowait) {
- string queueName = queue->getName();
- parent->client->getQueue().declareOk(channel, queueName, queue->getMessageCount(), queue->getConsumerCount());
- }
-}
-
-void SessionHandlerImpl::QueueHandlerImpl::bind(u_int16_t channel, u_int16_t /*ticket*/, const string& queueName,
- const string& exchangeName, const string& routingKey, bool nowait,
- const FieldTable& arguments){
-
- Queue::shared_ptr queue = parent->getQueue(queueName, channel);
- Exchange::shared_ptr exchange = parent->exchanges->get(exchangeName);
- if(exchange){
-// kpvdr - cannot use this any longer as routingKey is now const
-// if(routingKey.empty() && queueName.empty()) routingKey = queue->getName();
-// exchange->bind(queue, routingKey, &arguments);
- string exchangeRoutingKey = routingKey.empty() && queueName.empty() ? queue->getName() : routingKey;
- exchange->bind(queue, exchangeRoutingKey, &arguments);
- if(!nowait) parent->client->getQueue().bindOk(channel);
- }else{
- throw ChannelException(404, "Bind failed. No such exchange: " + exchangeName);
- }
-}
-
-void SessionHandlerImpl::QueueHandlerImpl::purge(u_int16_t channel, u_int16_t /*ticket*/, const string& queueName, bool nowait){
-
- Queue::shared_ptr queue = parent->getQueue(queueName, channel);
- int count = queue->purge();
- if(!nowait) parent->client->getQueue().purgeOk(channel, count);
-}
-
-void SessionHandlerImpl::QueueHandlerImpl::delete_(u_int16_t channel, u_int16_t /*ticket*/, const string& queue,
- bool ifUnused, bool ifEmpty, bool nowait){
- ChannelException error(0, "");
- int count(0);
- Queue::shared_ptr q = parent->getQueue(queue, channel);
- if(ifEmpty && q->getMessageCount() > 0){
- throw ChannelException(406, "Queue not empty.");
- }else if(ifUnused && q->getConsumerCount() > 0){
- throw ChannelException(406, "Queue in use.");
- }else{
- //remove the queue from the list of exclusive queues if necessary
- if(q->isExclusiveOwner(parent)){
- queue_iterator i = find(parent->exclusiveQueues.begin(), parent->exclusiveQueues.end(), q);
- if(i < parent->exclusiveQueues.end()) parent->exclusiveQueues.erase(i);
- }
- count = q->getMessageCount();
- q->destroy();
- parent->queues->destroy(queue);
- }
-
- if(!nowait) parent->client->getQueue().deleteOk(channel, count);
-}
-
-
-
-
-void SessionHandlerImpl::BasicHandlerImpl::qos(u_int16_t channel, u_int32_t prefetchSize, u_int16_t prefetchCount, bool /*global*/){
- //TODO: handle global
- parent->getChannel(channel)->setPrefetchSize(prefetchSize);
- parent->getChannel(channel)->setPrefetchCount(prefetchCount);
- parent->client->getBasic().qosOk(channel);
-}
-
-void SessionHandlerImpl::BasicHandlerImpl::consume(
- u_int16_t channelId, u_int16_t /*ticket*/,
- const string& queueName, const string& consumerTag,
- bool noLocal, bool noAck, bool exclusive,
- bool nowait, const FieldTable& fields)
-{
-
- Queue::shared_ptr queue = parent->getQueue(queueName, channelId);
- Channel* channel = parent->channels[channelId];
- if(!consumerTag.empty() && channel->exists(consumerTag)){
- throw ConnectionException(530, "Consumer tags must be unique");
- }
-
- try{
- string newTag = consumerTag;
- channel->consume(
- newTag, queue, !noAck, exclusive, noLocal ? parent : 0, &fields);
-
- if(!nowait) parent->client->getBasic().consumeOk(channelId, newTag);
-
- //allow messages to be dispatched if required as there is now a consumer:
- queue->dispatch();
- }catch(ExclusiveAccessException& e){
- if(exclusive) throw ChannelException(403, "Exclusive access cannot be granted");
- else throw ChannelException(403, "Access would violate previously granted exclusivity");
- }
-
-}
-
-void SessionHandlerImpl::BasicHandlerImpl::cancel(u_int16_t channel, const string& consumerTag, bool nowait){
- parent->getChannel(channel)->cancel(consumerTag);
-
- if(!nowait) parent->client->getBasic().cancelOk(channel, consumerTag);
-}
-
-void SessionHandlerImpl::BasicHandlerImpl::publish(u_int16_t channel, u_int16_t /*ticket*/,
- const string& exchangeName, const string& routingKey,
- bool mandatory, bool immediate){
-
- Exchange::shared_ptr exchange = exchangeName.empty() ? parent->exchanges->getDefault() : parent->exchanges->get(exchangeName);
- if(exchange){
- Message* msg = new Message(parent, exchangeName, routingKey, mandatory, immediate);
- parent->getChannel(channel)->handlePublish(msg, exchange);
- }else{
- throw ChannelException(404, "Exchange not found '" + exchangeName + "'");
- }
-}
-
-void SessionHandlerImpl::BasicHandlerImpl::get(u_int16_t channelId, u_int16_t /*ticket*/, const string& queueName, bool noAck){
- Queue::shared_ptr queue = parent->getQueue(queueName, channelId);
- if(!parent->getChannel(channelId)->get(queue, !noAck)){
- string clusterId;//not used, part of an imatix hack
-
- parent->client->getBasic().getEmpty(channelId, clusterId);
- }
-}
-
-void SessionHandlerImpl::BasicHandlerImpl::ack(u_int16_t channel, u_int64_t deliveryTag, bool multiple){
- try{
- parent->getChannel(channel)->ack(deliveryTag, multiple);
- }catch(InvalidAckException& e){
- throw ConnectionException(530, "Received ack for unrecognised delivery tag");
- }
-}
-
-void SessionHandlerImpl::BasicHandlerImpl::reject(u_int16_t /*channel*/, u_int64_t /*deliveryTag*/, bool /*requeue*/){}
-
-void SessionHandlerImpl::BasicHandlerImpl::recover(u_int16_t channel, bool requeue){
- parent->getChannel(channel)->recover(requeue);
- parent->client->getBasic().recoverOk(channel);
-}
-
-void SessionHandlerImpl::TxHandlerImpl::select(u_int16_t channel){
- parent->getChannel(channel)->begin();
- parent->client->getTx().selectOk(channel);
-}
-
-void SessionHandlerImpl::TxHandlerImpl::commit(u_int16_t channel){
- parent->getChannel(channel)->commit();
- parent->client->getTx().commitOk(channel);
-}
-
-void SessionHandlerImpl::TxHandlerImpl::rollback(u_int16_t channel){
-
- parent->getChannel(channel)->rollback();
- parent->client->getTx().rollbackOk(channel);
- parent->getChannel(channel)->recover(false);
-}
-
diff --git a/Final/cpp/lib/broker/SessionHandlerImpl.h b/Final/cpp/lib/broker/SessionHandlerImpl.h
deleted file mode 100644
index 7e631b4505..0000000000
--- a/Final/cpp/lib/broker/SessionHandlerImpl.h
+++ /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.
- *
- */
-#ifndef _SessionHandlerImpl_
-#define _SessionHandlerImpl_
-
-#include <map>
-#include <sstream>
-#include <vector>
-#include <exception>
-#include <AMQFrame.h>
-#include <AMQP_ClientProxy.h>
-#include <AMQP_ServerOperations.h>
-#include <AutoDelete.h>
-#include <ExchangeRegistry.h>
-#include <BrokerChannel.h>
-#include <ConnectionToken.h>
-#include <DirectExchange.h>
-#include <OutputHandler.h>
-#include <ProtocolInitiation.h>
-#include <QueueRegistry.h>
-#include <sys/SessionContext.h>
-#include <sys/SessionHandler.h>
-#include <sys/TimeoutHandler.h>
-#include <TopicExchange.h>
-
-namespace qpid {
-namespace broker {
-
-struct ChannelException : public std::exception {
- u_int16_t code;
- string text;
- ChannelException(u_int16_t _code, string _text) : code(_code), text(_text) {}
- ~ChannelException() throw() {}
- const char* what() const throw() { return text.c_str(); }
-};
-
-struct ConnectionException : public std::exception {
- u_int16_t code;
- string text;
- ConnectionException(u_int16_t _code, string _text) : code(_code), text(_text) {}
- ~ConnectionException() throw() {}
- const char* what() const throw() { return text.c_str(); }
-};
-
-class Settings {
- public:
- const u_int32_t timeout;//timeout for auto-deleted queues (in ms)
- const u_int64_t stagingThreshold;
-
- Settings(u_int32_t _timeout, u_int64_t _stagingThreshold) : timeout(_timeout), stagingThreshold(_stagingThreshold) {}
-};
-
-class SessionHandlerImpl : public virtual qpid::sys::SessionHandler,
- public virtual qpid::framing::AMQP_ServerOperations,
- public virtual ConnectionToken
-{
- typedef std::map<u_int16_t, Channel*>::iterator channel_iterator;
- typedef std::vector<Queue::shared_ptr>::iterator queue_iterator;
-
- qpid::sys::SessionContext* context;
- qpid::framing::AMQP_ClientProxy* client;
- QueueRegistry* queues;
- ExchangeRegistry* const exchanges;
- AutoDelete* const cleaner;
- const Settings settings;
-
- std::auto_ptr<BasicHandler> basicHandler;
- std::auto_ptr<ChannelHandler> channelHandler;
- std::auto_ptr<ConnectionHandler> connectionHandler;
- std::auto_ptr<ExchangeHandler> exchangeHandler;
- std::auto_ptr<QueueHandler> queueHandler;
- std::auto_ptr<TxHandler> txHandler;
-
- std::map<u_int16_t, Channel*> channels;
- std::vector<Queue::shared_ptr> exclusiveQueues;
-
- u_int32_t framemax;
- u_int16_t heartbeat;
-
- void handleHeader(u_int16_t channel, qpid::framing::AMQHeaderBody::shared_ptr body);
- void handleContent(u_int16_t channel, qpid::framing::AMQContentBody::shared_ptr body);
- void handleHeartbeat(qpid::framing::AMQHeartbeatBody::shared_ptr body);
-
- Channel* getChannel(u_int16_t channel);
- /**
- * Get named queue, never returns 0.
- * @return: named queue or default queue for channel if name=""
- * @exception: ChannelException if no queue of that name is found.
- * @exception: ConnectionException if no queue specified and channel has not declared one.
- */
- Queue::shared_ptr getQueue(const string& name, u_int16_t channel);
-
- Exchange::shared_ptr findExchange(const string& name);
-
- public:
- SessionHandlerImpl(qpid::sys::SessionContext* context, QueueRegistry* queues,
- ExchangeRegistry* exchanges, AutoDelete* cleaner, const Settings& settings);
- virtual void received(qpid::framing::AMQFrame* frame);
- virtual void initiated(qpid::framing::ProtocolInitiation* header);
- virtual void idleOut();
- virtual void idleIn();
- virtual void closed();
- virtual ~SessionHandlerImpl();
-
- class ConnectionHandlerImpl : public virtual ConnectionHandler{
- SessionHandlerImpl* parent;
- public:
- inline ConnectionHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {}
-
- virtual void startOk(u_int16_t channel, const qpid::framing::FieldTable& clientProperties, const string& mechanism,
- const string& response, const string& locale);
-
- // Change to match new code generator function signature (adding const to string&) - kpvdr 2006-11-20
- virtual void secureOk(u_int16_t channel, const string& response);
-
- virtual void tuneOk(u_int16_t channel, u_int16_t channelMax, u_int32_t frameMax, u_int16_t heartbeat);
-
- // Change to match new code generator function signature (adding const to string&) - kpvdr 2006-11-20
- virtual void open(u_int16_t channel, const string& virtualHost, const string& capabilities, bool insist);
-
- // Change to match new code generator function signature (adding const to string&) - kpvdr 2006-11-20
- virtual void close(u_int16_t channel, u_int16_t replyCode, const string& replyText, u_int16_t classId,
- u_int16_t methodId);
-
- virtual void closeOk(u_int16_t channel);
-
- virtual ~ConnectionHandlerImpl(){}
- };
-
- class ChannelHandlerImpl : public virtual ChannelHandler{
- SessionHandlerImpl* parent;
- public:
- inline ChannelHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {}
-
- // Change to match new code generator function signature (adding const to string&) - kpvdr 2006-11-20
- virtual void open(u_int16_t channel, const string& outOfBand);
-
- virtual void flow(u_int16_t channel, bool active);
-
- virtual void flowOk(u_int16_t channel, bool active);
-
- // Change to match new code generator function signature (adding const to string&) - kpvdr 2006-11-20
- virtual void close(u_int16_t channel, u_int16_t replyCode, const string& replyText,
- u_int16_t classId, u_int16_t methodId);
-
- virtual void closeOk(u_int16_t channel);
-
- virtual ~ChannelHandlerImpl(){}
- };
-
- class ExchangeHandlerImpl : public virtual ExchangeHandler{
- SessionHandlerImpl* parent;
- public:
- inline ExchangeHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {}
-
- virtual void declare(u_int16_t channel, u_int16_t ticket, const string& exchange, const string& type,
- bool passive, bool durable, bool autoDelete, bool internal, bool nowait,
- const qpid::framing::FieldTable& arguments);
-
- // Change to match new code generator function signature (adding const to string&) - kpvdr 2006-11-20
- virtual void delete_(u_int16_t channel, u_int16_t ticket, const string& exchange, bool ifUnused, bool nowait);
-
- virtual ~ExchangeHandlerImpl(){}
- };
-
-
- class QueueHandlerImpl : public virtual QueueHandler{
- SessionHandlerImpl* parent;
- public:
- inline QueueHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {}
-
- virtual void declare(u_int16_t channel, u_int16_t ticket, const string& queue,
- bool passive, bool durable, bool exclusive,
- bool autoDelete, bool nowait, const qpid::framing::FieldTable& arguments);
-
- virtual void bind(u_int16_t channel, u_int16_t ticket, const string& queue,
- const string& exchange, const string& routingKey, bool nowait,
- const qpid::framing::FieldTable& arguments);
-
- virtual void purge(u_int16_t channel, u_int16_t ticket, const string& queue,
- bool nowait);
-
- // Change to match new code generator function signature (adding const to string&) - kpvdr 2006-11-20
- virtual void delete_(u_int16_t channel, u_int16_t ticket, const string& queue, bool ifUnused, bool ifEmpty,
- bool nowait);
-
- virtual ~QueueHandlerImpl(){}
- };
-
- class BasicHandlerImpl : public virtual BasicHandler{
- SessionHandlerImpl* parent;
- public:
- inline BasicHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {}
-
- virtual void qos(u_int16_t channel, u_int32_t prefetchSize, u_int16_t prefetchCount, bool global);
-
- virtual void consume(
- u_int16_t channel, u_int16_t ticket, const string& queue,
- const string& consumerTag, bool noLocal, bool noAck,
- bool exclusive, bool nowait,
- const qpid::framing::FieldTable& fields);
-
- virtual void cancel(u_int16_t channel, const string& consumerTag, bool nowait);
-
- virtual void publish(u_int16_t channel, u_int16_t ticket, const string& exchange, const string& routingKey,
- bool mandatory, bool immediate);
-
- virtual void get(u_int16_t channel, u_int16_t ticket, const string& queue, bool noAck);
-
- virtual void ack(u_int16_t channel, u_int64_t deliveryTag, bool multiple);
-
- virtual void reject(u_int16_t channel, u_int64_t deliveryTag, bool requeue);
-
- virtual void recover(u_int16_t channel, bool requeue);
-
- virtual ~BasicHandlerImpl(){}
- };
-
- class TxHandlerImpl : public virtual TxHandler{
- SessionHandlerImpl* parent;
- public:
- TxHandlerImpl(SessionHandlerImpl* _parent) : parent(_parent) {}
- virtual ~TxHandlerImpl() {}
- virtual void select(u_int16_t channel);
- virtual void commit(u_int16_t channel);
- virtual void rollback(u_int16_t channel);
- };
-
-
- inline virtual ChannelHandler* getChannelHandler(){ return channelHandler.get(); }
- inline virtual ConnectionHandler* getConnectionHandler(){ return connectionHandler.get(); }
- inline virtual BasicHandler* getBasicHandler(){ return basicHandler.get(); }
- inline virtual ExchangeHandler* getExchangeHandler(){ return exchangeHandler.get(); }
- inline virtual QueueHandler* getQueueHandler(){ return queueHandler.get(); }
- inline virtual TxHandler* getTxHandler(){ return txHandler.get(); }
-
- inline virtual AccessHandler* getAccessHandler(){ throw ConnectionException(540, "Access class not implemented"); }
- inline virtual FileHandler* getFileHandler(){ throw ConnectionException(540, "File class not implemented"); }
- inline virtual StreamHandler* getStreamHandler(){ throw ConnectionException(540, "Stream class not implemented"); }
- inline virtual DtxHandler* getDtxHandler(){ throw ConnectionException(540, "Dtx class not implemented"); }
- inline virtual TunnelHandler* getTunnelHandler(){ throw ConnectionException(540, "Tunnel class not implemented"); }
-
- // Temporary add-in to resolve version conflicts: AMQP v8.0 still defines class Test;
- // however v0.9 will not - kpvdr 2006-11-17
- inline virtual TestHandler* getTestHandler(){ throw ConnectionException(540, "Test class not implemented"); }
-};
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/TopicExchange.cpp b/Final/cpp/lib/broker/TopicExchange.cpp
deleted file mode 100644
index 3ebb3c8c56..0000000000
--- a/Final/cpp/lib/broker/TopicExchange.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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 <ExchangeBinding.h>
-#include <algorithm>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-// 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.
-
-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 = 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;
-}
-
-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: Ineficient 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) : Exchange(_name) { }
-
-void TopicExchange::bind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* args){
- Monitor::ScopedLock l(lock);
- TopicPattern routingPattern(routingKey);
- bindings[routingPattern].push_back(queue);
- queue->bound(new ExchangeBinding(this, queue, routingKey, args));
-}
-
-void TopicExchange::unbind(Queue::shared_ptr queue, const string& routingKey, const FieldTable* /*args*/){
- Monitor::ScopedLock l(lock);
- BindingMap::iterator bi = bindings.find(TopicPattern(routingKey));
- Queue::vector& qv(bi->second);
- if (bi == bindings.end()) return;
- Queue::vector::iterator q = find(qv.begin(), qv.end(), queue);
- if(q == qv.end()) return;
- qv.erase(q);
- if(qv.empty()) bindings.erase(bi);
-}
-
-
-void TopicExchange::route(Deliverable& msg, const string& routingKey, const FieldTable* /*args*/){
- Monitor::ScopedLock l(lock);
- for (BindingMap::iterator i = bindings.begin(); i != bindings.end(); ++i) {
- if (i->first.match(routingKey)) {
- Queue::vector& qv(i->second);
- for(Queue::vector::iterator j = qv.begin(); j != qv.end(); j++){
- msg.deliverTo(*j);
- }
- }
- }
-}
-
-TopicExchange::~TopicExchange() {}
-
-const std::string TopicExchange::typeName("topic");
-
-
diff --git a/Final/cpp/lib/broker/TopicExchange.h b/Final/cpp/lib/broker/TopicExchange.h
deleted file mode 100644
index fa0c86863a..0000000000
--- a/Final/cpp/lib/broker/TopicExchange.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 _TopicExchange_
-#define _TopicExchange_
-
-#include <map>
-#include <vector>
-#include <BrokerExchange.h>
-#include <FieldTable.h>
-#include <BrokerMessage.h>
-#include <sys/Monitor.h>
-#include <BrokerQueue.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);
-
- 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{
- typedef std::map<TopicPattern, Queue::vector> BindingMap;
- BindingMap bindings;
- qpid::sys::Mutex lock;
-
- public:
- static const std::string typeName;
-
- TopicExchange(const string& name);
-
- virtual std::string getType(){ return typeName; }
-
- virtual void bind(Queue::shared_ptr queue, const string& routingKey, const qpid::framing::FieldTable* args);
-
- virtual void 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 ~TopicExchange();
-};
-
-
-
-}
-}
-
-#endif
diff --git a/Final/cpp/lib/broker/TransactionalStore.h b/Final/cpp/lib/broker/TransactionalStore.h
deleted file mode 100644
index 17bca3878a..0000000000
--- a/Final/cpp/lib/broker/TransactionalStore.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 _TransactionalStore_
-#define _TransactionalStore_
-
-#include <memory>
-
-namespace qpid {
- namespace broker {
- struct InvalidTransactionContextException : public std::exception {};
-
- class TransactionContext{
- public:
- virtual ~TransactionContext(){}
- };
-
- class TransactionalStore{
- public:
- virtual std::auto_ptr<TransactionContext> begin() = 0;
- virtual void commit(TransactionContext*) = 0;
- virtual void abort(TransactionContext*) = 0;
-
- virtual ~TransactionalStore(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/TxAck.cpp b/Final/cpp/lib/broker/TxAck.cpp
deleted file mode 100644
index b5211158f3..0000000000
--- a/Final/cpp/lib/broker/TxAck.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 <TxAck.h>
-
-using std::bind1st;
-using std::bind2nd;
-using std::mem_fun_ref;
-using namespace qpid::broker;
-
-TxAck::TxAck(AccumulatedAck& _acked, std::list<DeliveryRecord>& _unacked, const std::string* const _xid) :
- acked(_acked), unacked(_unacked), xid(_xid){
-
-}
-
-bool TxAck::prepare(TransactionContext* ctxt) throw(){
- try{
- //dequeue all acked messages from their queues
- for (ack_iterator i = unacked.begin(); i != unacked.end(); i++) {
- if (i->coveredBy(&acked)) {
- i->discard(ctxt, xid);
- }
- }
- return true;
- }catch(...){
- std::cout << "TxAck::prepare() - Failed to prepare" << std::endl;
- return false;
- }
-}
-
-void TxAck::commit() throw(){
- //remove all acked records from the list
- unacked.remove_if(bind2nd(mem_fun_ref(&DeliveryRecord::coveredBy), &acked));
-}
-
-void TxAck::rollback() throw(){
-}
diff --git a/Final/cpp/lib/broker/TxAck.h b/Final/cpp/lib/broker/TxAck.h
deleted file mode 100644
index 88c321c445..0000000000
--- a/Final/cpp/lib/broker/TxAck.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 _TxAck_
-#define _TxAck_
-
-#include <algorithm>
-#include <functional>
-#include <list>
-#include <AccumulatedAck.h>
-#include <DeliveryRecord.h>
-#include <TxOp.h>
-
-namespace qpid {
- namespace broker {
- /**
- * Defines the transactional behaviour for acks received by a
- * transactional channel.
- */
- class TxAck : public TxOp{
- AccumulatedAck& acked;
- std::list<DeliveryRecord>& unacked;
- const std::string* const xid;
-
- public:
- /**
- * @param acked a representation of the accumulation of
- * acks received
- * @param unacked the record of delivered messages
- */
- TxAck(AccumulatedAck& acked, std::list<DeliveryRecord>& unacked, const std::string* const xid = 0);
- virtual bool prepare(TransactionContext* ctxt) throw();
- virtual void commit() throw();
- virtual void rollback() throw();
- virtual ~TxAck(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/TxBuffer.cpp b/Final/cpp/lib/broker/TxBuffer.cpp
deleted file mode 100644
index acd3283bb7..0000000000
--- a/Final/cpp/lib/broker/TxBuffer.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 <TxBuffer.h>
-
-using std::mem_fun;
-using namespace qpid::broker;
-
-bool TxBuffer::prepare(TransactionalStore* const store)
-{
- std::auto_ptr<TransactionContext> ctxt;
- if(store) ctxt = store->begin();
- for(op_iterator i = ops.begin(); i < ops.end(); i++){
- if(!(*i)->prepare(ctxt.get())){
- if(store) store->abort(ctxt.get());
- return false;
- }
- }
- if(store) store->commit(ctxt.get());
- return true;
-}
-
-void TxBuffer::commit()
-{
- for_each(ops.begin(), ops.end(), mem_fun(&TxOp::commit));
- ops.clear();
-}
-
-void TxBuffer::rollback()
-{
- for_each(ops.begin(), ops.end(), mem_fun(&TxOp::rollback));
- ops.clear();
-}
-
-void TxBuffer::enlist(TxOp* const op)
-{
- ops.push_back(op);
-}
diff --git a/Final/cpp/lib/broker/TxBuffer.h b/Final/cpp/lib/broker/TxBuffer.h
deleted file mode 100644
index 2d9a2a3679..0000000000
--- a/Final/cpp/lib/broker/TxBuffer.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.
- *
- */
-#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*>::iterator op_iterator;
- std::vector<TxOp*> ops;
- public:
- /**
- * Requests that all ops are prepared. This should
- * primarily involve making sure that a persistent record
- * of the operations is stored where necessary.
- *
- * All ops will be prepared under a transaction on the
- * specified store. If any operation fails on prepare,
- * this transaction will be rolled back.
- *
- * 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(TransactionalStore* const store);
- /**
- * Signals that the ops all prepared all completed
- * 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();
- /**
- * Rolls back all the operations.
- *
- * Should only be called either after a call to prepare()
- * returns true (2pc) or instead of a prepare call
- * ('server-local')
- */
- void rollback();
- /**
- * Adds an operation to the transaction.
- */
- void enlist(TxOp* const op);
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/TxOp.h b/Final/cpp/lib/broker/TxOp.h
deleted file mode 100644
index abba84a8e8..0000000000
--- a/Final/cpp/lib/broker/TxOp.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 _TxOp_
-#define _TxOp_
-
-#include <TransactionalStore.h>
-
-namespace qpid {
- namespace broker {
- class TxOp{
- public:
- virtual bool prepare(TransactionContext*) throw() = 0;
- virtual void commit() throw() = 0;
- virtual void rollback() throw() = 0;
- virtual ~TxOp(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/broker/TxPublish.cpp b/Final/cpp/lib/broker/TxPublish.cpp
deleted file mode 100644
index 49dd8abd89..0000000000
--- a/Final/cpp/lib/broker/TxPublish.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 <TxPublish.h>
-
-using namespace qpid::broker;
-
-TxPublish::TxPublish(Message::shared_ptr _msg, const std::string* const _xid) : msg(_msg), xid(_xid) {}
-
-bool TxPublish::prepare(TransactionContext* ctxt) throw(){
- try{
- for_each(queues.begin(), queues.end(), Prepare(ctxt, msg, xid));
- return true;
- }catch(...){
- std::cout << "TxPublish::prepare() - Failed to prepare" << std::endl;
- return false;
- }
-}
-
-void TxPublish::commit() throw(){
- for_each(queues.begin(), queues.end(), Commit(msg));
-}
-
-void TxPublish::rollback() throw(){
-}
-
-void TxPublish::deliverTo(Queue::shared_ptr& queue){
- queues.push_back(queue);
-}
-
-TxPublish::Prepare::Prepare(TransactionContext* _ctxt, Message::shared_ptr& _msg, const string* const _xid)
- : ctxt(_ctxt), msg(_msg), xid(_xid){}
-
-void TxPublish::Prepare::operator()(Queue::shared_ptr& queue){
- queue->enqueue(ctxt, msg, xid);
-}
-
-TxPublish::Commit::Commit(Message::shared_ptr& _msg) : msg(_msg){}
-
-void TxPublish::Commit::operator()(Queue::shared_ptr& queue){
- queue->process(msg);
-}
-
diff --git a/Final/cpp/lib/broker/TxPublish.h b/Final/cpp/lib/broker/TxPublish.h
deleted file mode 100644
index 75f201257e..0000000000
--- a/Final/cpp/lib/broker/TxPublish.h
+++ /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.
- *
- */
-#ifndef _TxPublish_
-#define _TxPublish_
-
-#include <algorithm>
-#include <functional>
-#include <list>
-#include <Deliverable.h>
-#include <BrokerMessage.h>
-#include <MessageStore.h>
-#include <BrokerQueue.h>
-#include <TxOp.h>
-
-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;
- Message::shared_ptr& msg;
- const std::string* const xid;
- public:
- Prepare(TransactionContext* ctxt, Message::shared_ptr& msg, const std::string* const xid);
- void operator()(Queue::shared_ptr& queue);
- };
-
- class Commit{
- Message::shared_ptr& msg;
- public:
- Commit(Message::shared_ptr& msg);
- void operator()(Queue::shared_ptr& queue);
- };
-
- Message::shared_ptr msg;
- const std::string* const xid;
- std::list<Queue::shared_ptr> queues;
-
- public:
- TxPublish(Message::shared_ptr msg, const std::string* const xid = 0);
- virtual bool prepare(TransactionContext* ctxt) throw();
- virtual void commit() throw();
- virtual void rollback() throw();
-
- virtual void deliverTo(Queue::shared_ptr& queue);
-
- virtual ~TxPublish(){}
- };
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/client/ClientChannel.cpp b/Final/cpp/lib/client/ClientChannel.cpp
deleted file mode 100644
index a97d79dcf9..0000000000
--- a/Final/cpp/lib/client/ClientChannel.cpp
+++ /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.
- *
- */
-#include <ClientChannel.h>
-#include <sys/Monitor.h>
-#include <ClientMessage.h>
-#include <QpidError.h>
-#include <MethodBodyInstances.h>
-
-using namespace boost; //to use dynamic_pointer_cast
-using namespace qpid::client;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-Channel::Channel(bool _transactional, u_int16_t _prefetch) :
- id(0),
- con(0),
- out(0),
- incoming(0),
- closed(true),
- prefetch(_prefetch),
- transactional(_transactional),
-// AMQP version management change - kpvdr 2006-11-20
-// TODO: Make this class version-aware and link these hard-wired numbers to that version
- version(8, 0)
-{ }
-
-Channel::~Channel(){
- stop();
-}
-
-void Channel::setPrefetch(u_int16_t _prefetch){
- prefetch = _prefetch;
- if(con != 0 && out != 0){
- setQos();
- }
-}
-
-void Channel::setQos(){
-// AMQP version management change - kpvdr 2006-11-20
-// TODO: Make this class version-aware and link these hard-wired numbers to that version
- sendAndReceive(new AMQFrame(version, id, new BasicQosBody(version, 0, prefetch, false)), method_bodies.basic_qos_ok);
- if(transactional){
- sendAndReceive(new AMQFrame(version, id, new TxSelectBody(version)), method_bodies.tx_select_ok);
- }
-}
-
-void Channel::declareExchange(Exchange& exchange, bool synch){
- string name = exchange.getName();
- string type = exchange.getType();
- FieldTable args;
- AMQFrame* frame = new AMQFrame(version, id, new ExchangeDeclareBody(version, 0, name, type, false, false, false, false, !synch, args));
- if(synch){
- sendAndReceive(frame, method_bodies.exchange_declare_ok);
- }else{
- out->send(frame);
- }
-}
-
-void Channel::deleteExchange(Exchange& exchange, bool synch){
- string name = exchange.getName();
- AMQFrame* frame = new AMQFrame(version, id, new ExchangeDeleteBody(version, 0, name, false, !synch));
- if(synch){
- sendAndReceive(frame, method_bodies.exchange_delete_ok);
- }else{
- out->send(frame);
- }
-}
-
-void Channel::declareQueue(Queue& queue, bool synch){
- string name = queue.getName();
- FieldTable args;
- AMQFrame* frame = new AMQFrame(version, id, new QueueDeclareBody(version, 0, name, false/*passive*/, queue.isDurable(),
- queue.isExclusive(),
- queue.isAutoDelete(), !synch, args));
- if(synch){
- sendAndReceive(frame, method_bodies.queue_declare_ok);
- if(queue.getName().length() == 0){
- QueueDeclareOkBody::shared_ptr response =
- dynamic_pointer_cast<QueueDeclareOkBody, AMQMethodBody>(responses.getResponse());
- queue.setName(response->getQueue());
- }
- }else{
- out->send(frame);
- }
-}
-
-void Channel::deleteQueue(Queue& queue, bool ifunused, bool ifempty, bool synch){
- //ticket, queue, ifunused, ifempty, nowait
- string name = queue.getName();
- AMQFrame* frame = new AMQFrame(version, id, new QueueDeleteBody(version, 0, name, ifunused, ifempty, !synch));
- if(synch){
- sendAndReceive(frame, method_bodies.queue_delete_ok);
- }else{
- out->send(frame);
- }
-}
-
-void Channel::bind(const Exchange& exchange, const Queue& queue, const std::string& key, const FieldTable& args, bool synch){
- string e = exchange.getName();
- string q = queue.getName();
- AMQFrame* frame = new AMQFrame(version, id, new QueueBindBody(version, 0, q, e, key,!synch, args));
- if(synch){
- sendAndReceive(frame, method_bodies.queue_bind_ok);
- }else{
- out->send(frame);
- }
-}
-
-void Channel::consume(
- Queue& queue, std::string& tag, MessageListener* listener,
- int ackMode, bool noLocal, bool synch, const FieldTable* fields)
-{
- string q = queue.getName();
- AMQFrame* frame =
- new AMQFrame(version,
- id,
- new BasicConsumeBody(
- version, 0, q, tag, noLocal, ackMode == NO_ACK, false, !synch,
- fields ? *fields : FieldTable()));
- if(synch){
- sendAndReceive(frame, method_bodies.basic_consume_ok);
- BasicConsumeOkBody::shared_ptr response = dynamic_pointer_cast<BasicConsumeOkBody, AMQMethodBody>(responses.getResponse());
- tag = response->getConsumerTag();
- }else{
- out->send(frame);
- }
- Consumer* c = new Consumer();
- c->listener = listener;
- c->ackMode = ackMode;
- c->lastDeliveryTag = 0;
- consumers[tag] = c;
-}
-
-void Channel::cancel(std::string& tag, bool synch){
- Consumer* c = consumers[tag];
- if(c->ackMode == LAZY_ACK && c->lastDeliveryTag > 0){
- out->send(new AMQFrame(version, id, new BasicAckBody(version, c->lastDeliveryTag, true)));
- }
-
- AMQFrame* frame = new AMQFrame(version, id, new BasicCancelBody(version, (string&) tag, !synch));
- if(synch){
- sendAndReceive(frame, method_bodies.basic_cancel_ok);
- }else{
- out->send(frame);
- }
- consumers.erase(tag);
- if(c != 0){
- delete c;
- }
-}
-
-void Channel::cancelAll(){
- for(consumer_iterator i = consumers.begin(); i != consumers.end(); i = consumers.begin()){
- Consumer* c = i->second;
- if((c->ackMode == LAZY_ACK || c->ackMode == AUTO_ACK) && c->lastDeliveryTag > 0){
- out->send(new AMQFrame(version, id, new BasicAckBody(version, c->lastDeliveryTag, true)));
- }
- consumers.erase(i);
- delete c;
- }
-}
-
-void Channel::retrieve(Message& msg){
- Monitor::ScopedLock l(retrievalMonitor);
- while(retrieved == 0){
- retrievalMonitor.wait();
- }
-
- msg.header = retrieved->getHeader();
- msg.deliveryTag = retrieved->getDeliveryTag();
- retrieved->getData(msg.data);
- delete retrieved;
- retrieved = 0;
-}
-
-bool Channel::get(Message& msg, const Queue& queue, int ackMode){
- string name = queue.getName();
- AMQFrame* frame = new AMQFrame(version, id, new BasicGetBody(version, 0, name, ackMode));
- responses.expect();
- out->send(frame);
- responses.waitForResponse();
- AMQMethodBody::shared_ptr response = responses.getResponse();
- if(method_bodies.basic_get_ok.match(response.get())){
- if(incoming != 0){
- std::cout << "Existing message not complete" << std::endl;
- THROW_QPID_ERROR(PROTOCOL_ERROR + 504, "Existing message not complete");
- }else{
- incoming = new IncomingMessage(dynamic_pointer_cast<BasicGetOkBody, AMQMethodBody>(response));
- }
- retrieve(msg);
- return true;
- }if(method_bodies.basic_get_empty.match(response.get())){
- return false;
- }else{
- THROW_QPID_ERROR(PROTOCOL_ERROR + 500, "Unexpected response to basic.get.");
- }
-}
-
-
-void Channel::publish(Message& msg, const Exchange& exchange, const std::string& routingKey, bool mandatory, bool immediate){
- string e = exchange.getName();
- string key = routingKey;
-
- out->send(new AMQFrame(version, id, new BasicPublishBody(version, 0, e, key, mandatory, immediate)));
- //break msg up into header frame and content frame(s) and send these
- string data = msg.getData();
- msg.header->setContentSize(data.length());
- AMQBody::shared_ptr body(static_pointer_cast<AMQBody, AMQHeaderBody>(msg.header));
- out->send(new AMQFrame(version, id, body));
-
- u_int64_t data_length = data.length();
- if(data_length > 0){
- u_int32_t frag_size = con->getMaxFrameSize() - 8;//frame itself uses 8 bytes
- if(data_length < frag_size){
- out->send(new AMQFrame(version, id, new AMQContentBody(data)));
- }else{
- u_int32_t offset = 0;
- u_int32_t remaining = data_length - offset;
- while (remaining > 0) {
- u_int32_t length = remaining > frag_size ? frag_size : remaining;
- string frag(data.substr(offset, length));
- out->send(new AMQFrame(version, id, new AMQContentBody(frag)));
-
- offset += length;
- remaining = data_length - offset;
- }
- }
- }
-}
-
-void Channel::commit(){
- AMQFrame* frame = new AMQFrame(version, id, new TxCommitBody(version));
- sendAndReceive(frame, method_bodies.tx_commit_ok);
-}
-
-void Channel::rollback(){
- AMQFrame* frame = new AMQFrame(version, id, new TxRollbackBody(version));
- sendAndReceive(frame, method_bodies.tx_rollback_ok);
-}
-
-void Channel::handleMethod(AMQMethodBody::shared_ptr body){
- //channel.flow, channel.close, basic.deliver, basic.return or a response to a synchronous request
- if(method_bodies.basic_deliver.match(body.get())){
- if(incoming != 0){
- std::cout << "Existing message not complete [deliveryTag=" << incoming->getDeliveryTag() << "]" << std::endl;
- THROW_QPID_ERROR(PROTOCOL_ERROR + 504, "Existing message not complete");
- }else{
- incoming = new IncomingMessage(dynamic_pointer_cast<BasicDeliverBody, AMQMethodBody>(body));
- }
- }else if(method_bodies.basic_return.match(body.get())){
- if(incoming != 0){
- std::cout << "Existing message not complete" << std::endl;
- THROW_QPID_ERROR(PROTOCOL_ERROR + 504, "Existing message not complete");
- }else{
- incoming = new IncomingMessage(dynamic_pointer_cast<BasicReturnBody, AMQMethodBody>(body));
- }
- }else if(method_bodies.channel_close.match(body.get())){
- con->removeChannel(this);
- //need to signal application that channel has been closed through exception
-
- }else if(method_bodies.channel_flow.match(body.get())){
-
- } else if(responses.isWaiting()){
- responses.signalResponse(body);
- }else{
- //signal error
- std::cout << "Unhandled method: " << *body << std::endl;
- THROW_QPID_ERROR(PROTOCOL_ERROR + 504, "Unhandled method");
- }
-}
-
-void Channel::handleHeader(AMQHeaderBody::shared_ptr body){
- if(incoming == 0){
- //handle invalid frame sequence
- std::cout << "Invalid message sequence: got header before return or deliver." << std::endl;
- THROW_QPID_ERROR(PROTOCOL_ERROR + 504, "Invalid message sequence: got header before return or deliver.");
- }else{
- incoming->setHeader(body);
- if(incoming->isComplete()){
- enqueue();
- }
- }
-}
-
-void Channel::handleContent(AMQContentBody::shared_ptr body){
- if(incoming == 0){
- //handle invalid frame sequence
- std::cout << "Invalid message sequence: got content before return or deliver." << std::endl;
- THROW_QPID_ERROR(PROTOCOL_ERROR + 504, "Invalid message sequence: got content before return or deliver.");
- }else{
- incoming->addContent(body);
- if(incoming->isComplete()){
- enqueue();
- }
- }
-}
-
-void Channel::handleHeartbeat(AMQHeartbeatBody::shared_ptr /*body*/){
- THROW_QPID_ERROR(PROTOCOL_ERROR + 504, "Channel received heartbeat");
-}
-
-void Channel::start(){
- dispatcher = Thread(this);
-}
-
-void Channel::stop(){
- {
- Monitor::ScopedLock l(dispatchMonitor);
- closed = true;
- dispatchMonitor.notify();
- }
- dispatcher.join();
-}
-
-void Channel::run(){
- dispatch();
-}
-
-void Channel::enqueue(){
- if(incoming->isResponse()){
- Monitor::ScopedLock l(retrievalMonitor);
- retrieved = incoming;
- retrievalMonitor.notify();
- }else{
- Monitor::ScopedLock l(dispatchMonitor);
- messages.push(incoming);
- dispatchMonitor.notify();
- }
- incoming = 0;
-}
-
-IncomingMessage* Channel::dequeue(){
- Monitor::ScopedLock l(dispatchMonitor);
- while(messages.empty() && !closed){
- dispatchMonitor.wait();
- }
- IncomingMessage* msg = 0;
- if(!messages.empty()){
- msg = messages.front();
- messages.pop();
- }
- return msg;
-}
-
-void Channel::deliver(Consumer* consumer, Message& msg){
- //record delivery tag:
- consumer->lastDeliveryTag = msg.getDeliveryTag();
-
- //allow registered listener to handle the message
- consumer->listener->received(msg);
-
- //if the handler calls close on the channel or connection while
- //handling this message, then consumer will now have been deleted.
- if(!closed){
- bool multiple(false);
- switch(consumer->ackMode){
- case LAZY_ACK:
- multiple = true;
- if(++(consumer->count) < prefetch) break;
- //else drop-through
- case AUTO_ACK:
- out->send(new AMQFrame(version, id, new BasicAckBody(version, msg.getDeliveryTag(), multiple)));
- consumer->lastDeliveryTag = 0;
- }
- }
-
- //as it stands, transactionality is entirely orthogonal to ack
- //mode, though the acks will not be processed by the broker under
- //a transaction until it commits.
-}
-
-void Channel::dispatch(){
- while(!closed){
- IncomingMessage* incomingMsg = dequeue();
- if(incomingMsg){
- //Note: msg is currently only valid for duration of this call
- Message msg(incomingMsg->getHeader());
- incomingMsg->getData(msg.data);
- if(incomingMsg->isReturn()){
- if(returnsHandler == 0){
- //print warning to log/console
- std::cout << "Message returned: " << msg.getData() << std::endl;
- }else{
- returnsHandler->returned(msg);
- }
- }else{
- msg.deliveryTag = incomingMsg->getDeliveryTag();
- std::string tag = incomingMsg->getConsumerTag();
-
- if(consumers[tag] == 0){
- //signal error
- std::cout << "Unknown consumer: " << tag << std::endl;
- }else{
- deliver(consumers[tag], msg);
- }
- }
- delete incomingMsg;
- }
- }
-}
-
-void Channel::setReturnedMessageHandler(ReturnedMessageHandler* handler){
- returnsHandler = handler;
-}
-
-void Channel::sendAndReceive(AMQFrame* frame, const AMQMethodBody& body){
- responses.expect();
- out->send(frame);
- responses.receive(body);
-}
-
-void Channel::close(){
- if(con != 0){
- con->closeChannel(this);
- }
-}
diff --git a/Final/cpp/lib/client/ClientChannel.h b/Final/cpp/lib/client/ClientChannel.h
deleted file mode 100644
index 066f837430..0000000000
--- a/Final/cpp/lib/client/ClientChannel.h
+++ /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.
- *
- */
-#include <map>
-#include <string>
-#include <queue>
-#include "sys/types.h"
-
-#ifndef _Channel_
-#define _Channel_
-
-#include <framing/amqp_framing.h>
-#include <Connection.h>
-#include <ClientExchange.h>
-#include <IncomingMessage.h>
-#include <ClientMessage.h>
-#include <MessageListener.h>
-#include <ClientQueue.h>
-#include <ResponseHandler.h>
-#include <ReturnedMessageHandler.h>
-
-namespace qpid {
-namespace client {
- /**
- * The available acknowledgements modes
- *
- * \ingroup clientapi
- */
- enum ack_modes {
- /** 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
- };
-
- /**
- * Represents an AMQP channel, i.e. loosely a session of work. It
- * is through a channel that most of the AMQP 'methods' are
- * exposed.
- *
- * \ingroup clientapi
- */
- class Channel : private virtual qpid::framing::BodyHandler, public virtual qpid::sys::Runnable{
- struct Consumer{
- MessageListener* listener;
- int ackMode;
- int count;
- u_int64_t lastDeliveryTag;
- };
- typedef std::map<std::string,Consumer*>::iterator consumer_iterator;
-
- u_int16_t id;
- Connection* con;
- qpid::sys::Thread dispatcher;
- qpid::framing::OutputHandler* out;
- IncomingMessage* incoming;
- ResponseHandler responses;
- std::queue<IncomingMessage*> messages;//holds returned messages or those delivered for a consume
- IncomingMessage* retrieved;//holds response to basic.get
- qpid::sys::Monitor dispatchMonitor;
- qpid::sys::Monitor retrievalMonitor;
- std::map<std::string, Consumer*> consumers;
- ReturnedMessageHandler* returnsHandler;
- bool closed;
-
- u_int16_t prefetch;
- const bool transactional;
- qpid::framing::ProtocolVersion version;
-
- void enqueue();
- void retrieve(Message& msg);
- IncomingMessage* dequeue();
- void dispatch();
- void stop();
- void sendAndReceive(qpid::framing::AMQFrame* frame, const qpid::framing::AMQMethodBody& body);
- void deliver(Consumer* consumer, Message& msg);
- void setQos();
- void cancelAll();
-
- virtual void handleMethod(qpid::framing::AMQMethodBody::shared_ptr body);
- virtual void handleHeader(qpid::framing::AMQHeaderBody::shared_ptr body);
- virtual void handleContent(qpid::framing::AMQContentBody::shared_ptr body);
- virtual void handleHeartbeat(qpid::framing::AMQHeartbeatBody::shared_ptr body);
-
- public:
- /**
- * Creates a channel object.
- *
- * @param transactional if true, the publishing and acknowledgement
- * of messages will be transactional and can be committed or
- * aborted in atomic units (@see commit(), @see rollback())
- *
- * @param prefetch specifies the number of unacknowledged
- * messages the channel is willing to have sent to it
- * asynchronously
- */
- Channel(bool transactional = false, u_int16_t prefetch = 500);
- ~Channel();
-
- /**
- * Declares an exchange.
- *
- * In AMQP Exchanges are the destinations to which messages
- * are published. They have Queues bound to them and route
- * messages they receive to those queues. The routing rules
- * depend on the type of the exchange.
- *
- * @param exchange an Exchange object representing the
- * exchange to declare
- *
- * @param synch if true this call will block until a response
- * is received from the broker
- */
- void declareExchange(Exchange& exchange, bool synch = true);
- /**
- * Deletes an exchange
- *
- * @param exchange an Exchange object representing the exchange to delete
- *
- * @param synch if true this call will block until a response
- * is received from the broker
- */
- void deleteExchange(Exchange& exchange, bool synch = true);
- /**
- * Declares a Queue
- *
- * @param queue a Queue object representing the queue to declare
- *
- * @param synch if true this call will block until a response
- * is received from the broker
- */
- void declareQueue(Queue& queue, bool synch = true);
- /**
- * Deletes a Queue
- *
- * @param queue a Queue object representing the queue to delete
- *
- * @param synch if true this call will block until a response
- * is received from the broker
- */
- void deleteQueue(Queue& queue, bool ifunused = false, bool ifempty = false, bool synch = true);
- /**
- * Binds a queue to an exchange. The exact semantics of this
- * (in particular how 'routing keys' and 'binding arguments'
- * are used) depends on the type of the exchange.
- *
- * @param exchange an Exchange object representing the
- * exchange to bind to
- *
- * @param queue a Queue object representing the queue to be
- * bound
- *
- * @param key the 'routing key' for the binding
- *
- * @param args the 'binding arguments' for the binding
- *
- * @param synch if true this call will block until a response
- * is received from the broker
- */
- void bind(const Exchange& exchange, const Queue& queue, const std::string& key,
- const qpid::framing::FieldTable& args, bool synch = true);
- /**
- * Creates a 'consumer' for a queue. Messages in (or arriving
- * at) that queue will be delivered to consumers
- * asynchronously.
- *
- * @param queue a Queue instance representing the queue to
- * consume from
- *
- * @param tag an identifier to associate with the consumer
- * that can be used to cancel its subscription (if empty, this
- * will be assigned by the broker)
- *
- * @param listener a pointer to an instance of an
- * implementation of the MessageListener interface. Messages
- * received from this queue for this consumer will result in
- * invocation of the received() method on the listener, with
- * the message itself passed in.
- *
- * @param ackMode the mode of acknowledgement that the broker
- * should assume for this consumer. @see ack_modes
- *
- * @param noLocal if true, this consumer will not be sent any
- * message published by this connection
- *
- * @param synch if true this call will block until a response
- * is received from the broker
- */
- void consume(
- Queue& queue, std::string& tag, MessageListener* listener,
- int ackMode = NO_ACK, bool noLocal = false, bool synch = true,
- const qpid::framing::FieldTable* fields = 0);
-
- /**
- * Cancels a subscription previously set up through a call to consume().
- *
- * @param tag the identifier used (or assigned) in the consume
- * request that set up the subscription to be cancelled.
- *
- * @param synch if true this call will block until a response
- * is received from the broker
- */
- void cancel(std::string& tag, bool synch = true);
- /**
- * Synchronous pull of a message from a queue.
- *
- * @param msg a message object that will contain the message
- * headers and content if the call completes.
- *
- * @param queue the queue to consume from
- *
- * @param ackMode the acknowledgement mode to use (@see
- * ack_modes)
- *
- * @return true if a message was succcessfully dequeued from
- * the queue, false if the queue was empty.
- */
- bool get(Message& msg, const Queue& queue, int ackMode = NO_ACK);
- /**
- * Publishes (i.e. sends a message to the broker).
- *
- * @param msg the message to publish
- *
- * @param exchange the exchange to publish the message to
- *
- * @param routingKey the routing key to publish with
- *
- * @param mandatory if true and the exchange to which this
- * publish is directed has no matching bindings, the message
- * will be returned (see setReturnedMessageHandler()).
- *
- * @param immediate if true and there is no consumer to
- * receive this message on publication, the message will be
- * returned (see setReturnedMessageHandler()).
- */
- void publish(Message& msg, const Exchange& exchange, const std::string& routingKey,
- bool mandatory = false, bool immediate = false);
-
- /**
- * For a transactional channel this will commit all
- * publications and acknowledgements since the last commit (or
- * the channel was opened if there has been no previous
- * commit). This will cause published messages to become
- * available to consumers and acknowledged messages to be
- * consumed and removed from the queues they were dispatched
- * from.
- *
- * Transactionailty of a channel is specified when the channel
- * object is created (@see Channel()).
- */
- void commit();
- /**
- * For a transactional channel, this will rollback any
- * publications or acknowledgements. It will be as if the
- * ppblished messages were never sent and the acknowledged
- * messages were never consumed.
- */
- void rollback();
-
- /**
- * Change the prefetch in use.
- */
- void setPrefetch(u_int16_t prefetch);
-
- /**
- * Start message dispatching on a new thread
- */
- void start();
- /**
- * Do message dispatching on this thread
- */
- void run();
-
- /**
- * Closes a channel, stopping any message dispatching.
- */
- void close();
-
- /**
- * Set a handler for this channel that will process any
- * returned messages
- *
- * @see publish()
- */
- void setReturnedMessageHandler(ReturnedMessageHandler* handler);
-
- friend class Connection;
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/client/ClientExchange.cpp b/Final/cpp/lib/client/ClientExchange.cpp
deleted file mode 100644
index 5e5f3f14c6..0000000000
--- a/Final/cpp/lib/client/ClientExchange.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 <ClientExchange.h>
-
-qpid::client::Exchange::Exchange(std::string _name, std::string _type) : name(_name), type(_type){}
-const std::string& qpid::client::Exchange::getName() const { return name; }
-const std::string& qpid::client::Exchange::getType() const { return type; }
-
-const std::string qpid::client::Exchange::DIRECT_EXCHANGE = "direct";
-const std::string qpid::client::Exchange::TOPIC_EXCHANGE = "topic";
-const std::string qpid::client::Exchange::HEADERS_EXCHANGE = "headers";
-
-const qpid::client::Exchange qpid::client::Exchange::DEFAULT_EXCHANGE("", DIRECT_EXCHANGE);
-const qpid::client::Exchange qpid::client::Exchange::STANDARD_DIRECT_EXCHANGE("amq.direct", DIRECT_EXCHANGE);
-const qpid::client::Exchange qpid::client::Exchange::STANDARD_TOPIC_EXCHANGE("amq.topic", TOPIC_EXCHANGE);
-const qpid::client::Exchange qpid::client::Exchange::STANDARD_HEADERS_EXCHANGE("amq.headers", HEADERS_EXCHANGE);
diff --git a/Final/cpp/lib/client/ClientExchange.h b/Final/cpp/lib/client/ClientExchange.h
deleted file mode 100644
index a8ac21fa9b..0000000000
--- a/Final/cpp/lib/client/ClientExchange.h
+++ /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.
- *
- */
-#include <string>
-
-#ifndef _Exchange_
-#define _Exchange_
-
-namespace qpid {
-namespace client {
-
- /**
- * A 'handle' used to represent an AMQP exchange in the Channel
- * methods. Exchanges are the destinations to which messages are
- * published.
- *
- * There are different types of exchange (the standard types are
- * available as static constants, see DIRECT_EXCHANGE,
- * TOPIC_EXCHANGE and HEADERS_EXCHANGE). A Queue can be bound to
- * an exchange using Channel::bind() and messages published to
- * that exchange are then routed to the queue based on the details
- * of the binding and the type of exchange.
- *
- * There are some standard exchange instances that are predeclared
- * on all AMQP brokers. These are defined as static members
- * STANDARD_DIRECT_EXCHANGE, STANDARD_TOPIC_EXCHANGE and
- * STANDARD_HEADERS_EXCHANGE. There is also the 'default' exchange
- * (member DEFAULT_EXCHANGE) which is nameless and of type
- * 'direct' and has every declared queue bound to it by queue
- * name.
- *
- * \ingroup clientapi
- */
- class Exchange{
- const std::string name;
- const std::string type;
-
- public:
- /**
- * A direct exchange routes messages published with routing
- * key X to any queue bound with key X (i.e. an exact match is
- * used).
- */
- static const std::string DIRECT_EXCHANGE;
- /**
- * A topic exchange treat the key with which a queue is bound
- * as a pattern and routes all messages whose routing keys
- * match that pattern to the bound queue. The routing key for
- * a message must consist of zero or more alpha-numeric words
- * delimited by dots. The pattern is of a similar form but *
- * can be used to match excatly one word and # can be used to
- * match zero or more words.
- */
- static const std::string TOPIC_EXCHANGE;
- /**
- * The headers exchange routes messages based on whether their
- * headers match the binding arguments specified when
- * binding. (see the AMQP spec for more details).
- */
- static const std::string HEADERS_EXCHANGE;
-
- /**
- * The 'default' exchange, nameless and of type 'direct'. Has
- * every declared queue bound to it by name.
- */
- static const Exchange DEFAULT_EXCHANGE;
- /**
- * The standard direct exchange, named amq.direct.
- */
- static const Exchange STANDARD_DIRECT_EXCHANGE;
- /**
- * The standard topic exchange, named amq.topic.
- */
- static const Exchange STANDARD_TOPIC_EXCHANGE;
- /**
- * The standard headers exchange, named amq.header.
- */
- static const Exchange STANDARD_HEADERS_EXCHANGE;
-
- Exchange(std::string name, std::string type = DIRECT_EXCHANGE);
- const std::string& getName() const;
- const std::string& getType() const;
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/client/ClientMessage.cpp b/Final/cpp/lib/client/ClientMessage.cpp
deleted file mode 100644
index e8a2a6019e..0000000000
--- a/Final/cpp/lib/client/ClientMessage.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 <ClientMessage.h>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-Message::Message(){
- header = AMQHeaderBody::shared_ptr(new AMQHeaderBody(BASIC));
-}
-
-Message::Message(AMQHeaderBody::shared_ptr& _header) : header(_header){
-}
-
-Message::~Message(){
-}
-
-BasicHeaderProperties* Message::getHeaderProperties(){
- return dynamic_cast<BasicHeaderProperties*>(header->getProperties());
-}
-
-const std::string& Message::getContentType(){
- return getHeaderProperties()->getContentType();
-}
-
-const std::string& Message::getContentEncoding(){
- return getHeaderProperties()->getContentEncoding();
-}
-
-FieldTable& Message::getHeaders(){
- return getHeaderProperties()->getHeaders();
-}
-
-u_int8_t Message::getDeliveryMode(){
- return getHeaderProperties()->getDeliveryMode();
-}
-
-u_int8_t Message::getPriority(){
- return getHeaderProperties()->getPriority();
-}
-
-const std::string& Message::getCorrelationId(){
- return getHeaderProperties()->getCorrelationId();
-}
-
-const std::string& Message::getReplyTo(){
- return getHeaderProperties()->getReplyTo();
-}
-
-const std::string& Message::getExpiration(){
- return getHeaderProperties()->getExpiration();
-}
-
-const std::string& Message::getMessageId(){
- return getHeaderProperties()->getMessageId();
-}
-
-u_int64_t Message::getTimestamp(){
- return getHeaderProperties()->getTimestamp();
-}
-
-const std::string& Message::getType(){
- return getHeaderProperties()->getType();
-}
-
-const std::string& Message::getUserId(){
- return getHeaderProperties()->getUserId();
-}
-
-const std::string& Message::getAppId(){
- return getHeaderProperties()->getAppId();
-}
-
-const std::string& Message::getClusterId(){
- return getHeaderProperties()->getClusterId();
-}
-
-void Message::setContentType(const std::string& type){
- getHeaderProperties()->setContentType(type);
-}
-
-void Message::setContentEncoding(const std::string& encoding){
- getHeaderProperties()->setContentEncoding(encoding);
-}
-
-void Message::setHeaders(const FieldTable& headers){
- getHeaderProperties()->setHeaders(headers);
-}
-
-void Message::setDeliveryMode(u_int8_t mode){
- getHeaderProperties()->setDeliveryMode(mode);
-}
-
-void Message::setPriority(u_int8_t priority){
- getHeaderProperties()->setPriority(priority);
-}
-
-void Message::setCorrelationId(const std::string& correlationId){
- getHeaderProperties()->setCorrelationId(correlationId);
-}
-
-void Message::setReplyTo(const std::string& replyTo){
- getHeaderProperties()->setReplyTo(replyTo);
-}
-
-void Message::setExpiration(const std::string& expiration){
- getHeaderProperties()->setExpiration(expiration);
-}
-
-void Message::setMessageId(const std::string& messageId){
- getHeaderProperties()->setMessageId(messageId);
-}
-
-void Message::setTimestamp(u_int64_t timestamp){
- getHeaderProperties()->setTimestamp(timestamp);
-}
-
-void Message::setType(const std::string& type){
- getHeaderProperties()->setType(type);
-}
-
-void Message::setUserId(const std::string& userId){
- getHeaderProperties()->setUserId(userId);
-}
-
-void Message::setAppId(const std::string& appId){
- getHeaderProperties()->setAppId(appId);
-}
-
-void Message::setClusterId(const std::string& clusterId){
- getHeaderProperties()->setClusterId(clusterId);
-}
diff --git a/Final/cpp/lib/client/ClientMessage.h b/Final/cpp/lib/client/ClientMessage.h
deleted file mode 100644
index b46eb0bc72..0000000000
--- a/Final/cpp/lib/client/ClientMessage.h
+++ /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 <string>
-#include <framing/amqp_framing.h>
-
-#ifndef _Message_
-#define _Message_
-
-
-namespace qpid {
-namespace client {
-
- /**
- * A representation of messages for sent or recived through the
- * client api.
- *
- * \ingroup clientapi
- */
- class Message{
- qpid::framing::AMQHeaderBody::shared_ptr header;
- std::string data;
- bool redelivered;
- u_int64_t deliveryTag;
-
- qpid::framing::BasicHeaderProperties* getHeaderProperties();
- Message(qpid::framing::AMQHeaderBody::shared_ptr& header);
- public:
- Message();
- ~Message();
-
- /**
- * Allows the application to access the content of messages
- * received.
- *
- * @return a string representing the data of the message
- */
- inline std::string getData(){ return data; }
- /**
- * Allows the application to set the content of messages to be
- * sent.
- *
- * @param data a string representing the data of the message
- */
- inline void setData(const std::string& _data){ data = _data; }
-
- /**
- * @return true if this message was delivered previously (to
- * any consumer) but was not acknowledged.
- */
- inline bool isRedelivered(){ return redelivered; }
- inline void setRedelivered(bool _redelivered){ redelivered = _redelivered; }
-
- inline u_int64_t getDeliveryTag(){ return deliveryTag; }
-
- const std::string& getContentType();
- const std::string& getContentEncoding();
- qpid::framing::FieldTable& getHeaders();
- u_int8_t getDeliveryMode();
- u_int8_t getPriority();
- const std::string& getCorrelationId();
- const std::string& getReplyTo();
- const std::string& getExpiration();
- const std::string& getMessageId();
- u_int64_t getTimestamp();
- const std::string& getType();
- const std::string& getUserId();
- const std::string& getAppId();
- const std::string& getClusterId();
-
- void setContentType(const std::string& type);
- void setContentEncoding(const std::string& encoding);
- void setHeaders(const qpid::framing::FieldTable& headers);
- /**
- * Sets the delivery mode. 1 = non-durable, 2 = durable.
- */
- void setDeliveryMode(u_int8_t mode);
- void setPriority(u_int8_t priority);
- void setCorrelationId(const std::string& correlationId);
- void setReplyTo(const std::string& replyTo);
- void setExpiration(const std::string& expiration);
- void setMessageId(const std::string& messageId);
- void setTimestamp(u_int64_t timestamp);
- void setType(const std::string& type);
- void setUserId(const std::string& userId);
- void setAppId(const std::string& appId);
- void setClusterId(const std::string& clusterId);
-
-
- friend class Channel;
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/client/ClientQueue.cpp b/Final/cpp/lib/client/ClientQueue.cpp
deleted file mode 100644
index 773be504d8..0000000000
--- a/Final/cpp/lib/client/ClientQueue.cpp
+++ /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 <ClientQueue.h>
-
-qpid::client::Queue::Queue() : name(""), autodelete(true), exclusive(true), durable(false){}
-
-qpid::client::Queue::Queue(std::string _name) : name(_name), autodelete(false), exclusive(false), durable(false){}
-
-qpid::client::Queue::Queue(std::string _name, bool temp) : name(_name), autodelete(temp), exclusive(temp), durable(false){}
-
-qpid::client::Queue::Queue(std::string _name, bool _autodelete, bool _exclusive, bool _durable)
- : name(_name), autodelete(_autodelete), exclusive(_exclusive), durable(_durable){}
-
-const std::string& qpid::client::Queue::getName() const{
- return name;
-}
-
-void qpid::client::Queue::setName(const std::string& _name){
- name = _name;
-}
-
-bool qpid::client::Queue::isAutoDelete() const{
- return autodelete;
-}
-
-bool qpid::client::Queue::isExclusive() const{
- return exclusive;
-}
-
-bool qpid::client::Queue::isDurable() const{
- return durable;
-}
-
-void qpid::client::Queue::setDurable(bool _durable){
- durable = _durable;
-}
-
-
-
-
diff --git a/Final/cpp/lib/client/ClientQueue.h b/Final/cpp/lib/client/ClientQueue.h
deleted file mode 100644
index 4a63097c55..0000000000
--- a/Final/cpp/lib/client/ClientQueue.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 <string>
-
-#ifndef _Queue_
-#define _Queue_
-
-namespace qpid {
-namespace client {
-
- /**
- * A 'handle' used to represent an AMQP queue in the Channel
- * methods. Creating an instance of this class does not cause the
- * queue to be created on the broker. Rather, an instance of this
- * class should be passed to Channel::declareQueue() to ensure
- * that the queue exists or is created.
- *
- * Queues hold messages and allow clients to consume
- * (see Channel::consume()) or get (see Channel::get()) those messags. A
- * queue receives messages by being bound to one or more Exchange;
- * messages published to that exchange may then be routed to the
- * queue based on the details of the binding and the type of the
- * exchange (see Channel::bind()).
- *
- * Queues are identified by a name. They can be exclusive (in which
- * case they can only be used in the context of the connection
- * over which they were declared, and are deleted when then
- * connection closes), or they can be shared. Shared queues can be
- * auto deleted when they have no consumers.
- *
- * We use the term 'temporary queue' to refer to an exclusive
- * queue.
- *
- * \ingroup clientapi
- */
- class Queue{
- std::string name;
- const bool autodelete;
- const bool exclusive;
- bool durable;
-
- public:
-
- /**
- * Creates an unnamed, non-durable, temporary queue. A name
- * will be assigned to this queue instance by a call to
- * Channel::declareQueue().
- */
- Queue();
- /**
- * Creates a shared, non-durable, queue with a given name,
- * that will not be autodeleted.
- *
- * @param name the name of the queue
- */
- Queue(std::string name);
- /**
- * Creates a non-durable queue with a given name.
- *
- * @param name the name of the queue
- *
- * @param temp if true the queue will be a temporary queue, if
- * false it will be shared and not autodeleted.
- */
- Queue(std::string name, bool temp);
- /**
- * This constructor allows the autodelete, exclusive and
- * durable propeties to be explictly set. Note however that if
- * exclusive is true, autodelete has no meaning as exclusive
- * queues are always destroyed when the connection that
- * created them is closed.
- */
- Queue(std::string name, bool autodelete, bool exclusive, bool durable);
- const std::string& getName() const;
- void setName(const std::string&);
- bool isAutoDelete() const;
- bool isExclusive() const;
- bool isDurable() const;
- void setDurable(bool durable);
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/client/Connection.cpp b/Final/cpp/lib/client/Connection.cpp
deleted file mode 100644
index c00b58a4a9..0000000000
--- a/Final/cpp/lib/client/Connection.cpp
+++ /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.
- *
- */
-#include <Connection.h>
-#include <ClientChannel.h>
-#include <ClientMessage.h>
-#include <QpidError.h>
-#include <iostream>
-#include <MethodBodyInstances.h>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-using namespace qpid::sys;
-using namespace qpid::sys;
-
-Connection::Connection( bool _debug, u_int32_t _max_frame_size, qpid::framing::ProtocolVersion* _version) :
- debug(_debug),
- channelIdCounter(0),
- max_frame_size(_max_frame_size),
- closed(true),
- version(_version->getMajor(),_version->getMinor()),
- tcpNoDelay(false)
-{
- connector = new Connector(version, debug, _max_frame_size);
-}
-
-Connection::~Connection(){
- delete connector;
-}
-
-void Connection::setTcpNoDelay(bool on) {
- tcpNoDelay = on;
-}
-
-void Connection::open(const std::string& _host, int _port, const std::string& uid, const std::string& pwd, const std::string& virtualhost){
- host = _host;
- port = _port;
- connector->setInputHandler(this);
- connector->setTimeoutHandler(this);
- connector->setShutdownHandler(this);
- out = connector->getOutputHandler();
- connector->connect(host, port, tcpNoDelay);
-
- ProtocolInitiation* header = new ProtocolInitiation(version);
- responses.expect();
- connector->init(header);
- responses.receive(method_bodies.connection_start);
-
- FieldTable props;
- string mechanism("PLAIN");
- string response = ((char)0) + uid + ((char)0) + pwd;
- string locale("en_US");
- responses.expect();
- out->send(new AMQFrame(version, 0, new ConnectionStartOkBody(version, props, mechanism, response, locale)));
-
- /**
- * Assume for now that further challenges will not be required
- //receive connection.secure
- responses.receive(connection_secure));
- //send connection.secure-ok
- out->send(new AMQFrame(0, new ConnectionSecureOkBody(response)));
- **/
-
- responses.receive(method_bodies.connection_tune);
-
- ConnectionTuneBody::shared_ptr proposal = boost::dynamic_pointer_cast<ConnectionTuneBody, AMQMethodBody>(responses.getResponse());
- out->send(new AMQFrame(version, 0, new ConnectionTuneOkBody(version, proposal->getChannelMax(), max_frame_size, proposal->getHeartbeat())));
-
- u_int16_t heartbeat = proposal->getHeartbeat();
- connector->setReadTimeout(heartbeat * 2);
- connector->setWriteTimeout(heartbeat);
-
- //send connection.open
- string capabilities;
- string vhost = virtualhost;
- responses.expect();
- out->send(new AMQFrame(version, 0, new ConnectionOpenBody(version, vhost, capabilities, true)));
- //receive connection.open-ok (or redirect, but ignore that for now esp. as using force=true).
- responses.waitForResponse();
- if(responses.validate(method_bodies.connection_open_ok)){
- //ok
- }else if(responses.validate(method_bodies.connection_redirect)){
- //ignore for now
- ConnectionRedirectBody::shared_ptr redirect(boost::dynamic_pointer_cast<ConnectionRedirectBody, AMQMethodBody>(responses.getResponse()));
- std::cout << "Received redirection to " << redirect->getHost() << std::endl;
- }else{
- THROW_QPID_ERROR(PROTOCOL_ERROR, "Bad response");
- }
- closed = false;
-}
-
-void Connection::close(){
- if(!closed){
- u_int16_t code(200);
- string text("Ok");
- u_int16_t classId(0);
- u_int16_t methodId(0);
-
- sendAndReceive(new AMQFrame(version, 0, new ConnectionCloseBody(version, code, text, classId, methodId)), method_bodies.connection_close_ok);
- connector->close();
- closed = true;
- }
-}
-
-void Connection::openChannel(Channel* channel){
- channel->con = this;
- channel->id = ++channelIdCounter;
- channel->out = out;
- channels[channel->id] = channel;
- //now send frame to open channel and wait for response
- string oob;
- channel->sendAndReceive(new AMQFrame(version, channel->id, new ChannelOpenBody(version, oob)), method_bodies.channel_open_ok);
- channel->setQos();
- channel->closed = false;
-}
-
-void Connection::closeChannel(Channel* channel){
- //send frame to close channel
- u_int16_t code(200);
- string text("Ok");
- u_int16_t classId(0);
- u_int16_t methodId(0);
- closeChannel(channel, code, text, classId, methodId);
-}
-
-void Connection::closeChannel(Channel* channel, u_int16_t code, string& text, u_int16_t classId, u_int16_t methodId){
- //send frame to close channel
- channel->cancelAll();
- channel->closed = true;
- channel->sendAndReceive(new AMQFrame(version, channel->id, new ChannelCloseBody(version, code, text, classId, methodId)), method_bodies.channel_close_ok);
- channel->con = 0;
- channel->out = 0;
- removeChannel(channel);
-}
-
-void Connection::removeChannel(Channel* channel){
- //send frame to close channel
-
- channels.erase(channel->id);
- channel->out = 0;
- channel->id = 0;
- channel->con = 0;
-}
-
-void Connection::received(AMQFrame* frame){
- u_int16_t channelId = frame->getChannel();
-
- if(channelId == 0){
- this->handleBody(frame->getBody());
- }else{
- Channel* channel = channels[channelId];
- if(channel == 0){
- error(504, "Unknown channel");
- }else{
- try{
- channel->handleBody(frame->getBody());
- }catch(qpid::QpidError e){
- channelException(channel, dynamic_cast<AMQMethodBody*>(frame->getBody().get()), e);
- }
- }
- }
-}
-
-void Connection::handleMethod(AMQMethodBody::shared_ptr body){
- //connection.close, basic.deliver, basic.return or a response to a synchronous request
- if(responses.isWaiting()){
- responses.signalResponse(body);
- }else if(method_bodies.connection_close.match(body.get())){
- //send back close ok
- //close socket
- ConnectionCloseBody* request = dynamic_cast<ConnectionCloseBody*>(body.get());
- std::cout << "Connection closed by server: " << request->getReplyCode() << ":" << request->getReplyText() << std::endl;
- connector->close();
- }else{
- std::cout << "Unhandled method for connection: " << *body << std::endl;
- error(504, "Unrecognised method", body->amqpClassId(), body->amqpMethodId());
- }
-}
-
-void Connection::handleHeader(AMQHeaderBody::shared_ptr /*body*/){
- error(504, "Channel error: received header body with channel 0.");
-}
-
-void Connection::handleContent(AMQContentBody::shared_ptr /*body*/){
- error(504, "Channel error: received content body with channel 0.");
-}
-
-void Connection::handleHeartbeat(AMQHeartbeatBody::shared_ptr /*body*/){
-}
-
-void Connection::sendAndReceive(AMQFrame* frame, const AMQMethodBody& body){
- responses.expect();
- out->send(frame);
- responses.receive(body);
-}
-
-void Connection::error(int code, const string& msg, int classid, int methodid){
- std::cout << "Connection exception generated: " << code << msg;
- if(classid || methodid){
- std::cout << " [" << methodid << ":" << classid << "]";
- }
- std::cout << std::endl;
- sendAndReceive(new AMQFrame(version, 0, new ConnectionCloseBody(version, code, msg, classid, methodid)), method_bodies.connection_close_ok);
- connector->close();
-}
-
-void Connection::channelException(Channel* channel, AMQMethodBody* method, QpidError& e){
- std::cout << "Caught error from channel [" << e.code << "] " << e.msg << " (" << e.location.file << ":" << e.location.line << ")" << std::endl;
- int code = e.code == PROTOCOL_ERROR ? e.code - PROTOCOL_ERROR : 500;
- string msg = e.msg;
- if(method == 0){
- closeChannel(channel, code, msg);
- }else{
- closeChannel(channel, code, msg, method->amqpClassId(), method->amqpMethodId());
- }
-}
-
-void Connection::idleIn(){
- std::cout << "Connection timed out due to abscence of heartbeat." << std::endl;
- connector->close();
-}
-
-void Connection::idleOut(){
- out->send(new AMQFrame(version, 0, new AMQHeartbeatBody()));
-}
-
-void Connection::shutdown(){
- closed = true;
- //close all channels
- for(iterator i = channels.begin(); i != channels.end(); i++){
- i->second->stop();
- }
-}
diff --git a/Final/cpp/lib/client/Connection.h b/Final/cpp/lib/client/Connection.h
deleted file mode 100644
index 2222250188..0000000000
--- a/Final/cpp/lib/client/Connection.h
+++ /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.
- *
- */
-#include <map>
-#include <string>
-
-#ifndef _Connection_
-#define _Connection_
-
-#include <QpidError.h>
-#include <Connector.h>
-#include <sys/ShutdownHandler.h>
-#include <sys/TimeoutHandler.h>
-
-#include <framing/amqp_framing.h>
-#include <ClientExchange.h>
-#include <IncomingMessage.h>
-#include <ClientMessage.h>
-#include <MessageListener.h>
-#include <ClientQueue.h>
-#include <ResponseHandler.h>
-#include <AMQP_HighestVersion.h>
-
-namespace qpid {
-
- /**
- * The client namespace contains all classes that make up a client
- * implementation of the AMQP protocol. The key classes that form
- * the basis of the client API to be used by applications are
- * Connection and Channel.
- */
-namespace client {
-
- class Channel;
-
- /**
- * \defgroup clientapi Application API for an AMQP client
- */
-
- /**
- * Represents a connection to an AMQP broker. All communication is
- * initiated by establishing a connection, then opening one or
- * more Channels over that connection.
- *
- * \ingroup clientapi
- */
- class Connection : public virtual qpid::framing::InputHandler,
- public virtual qpid::sys::TimeoutHandler,
- public virtual qpid::sys::ShutdownHandler,
- private virtual qpid::framing::BodyHandler{
-
- typedef std::map<int, Channel*>::iterator iterator;
-
- const bool debug;
- u_int16_t channelIdCounter;
-
- std::string host;
- int port;
- const u_int32_t max_frame_size;
- std::map<int, Channel*> channels;
- Connector* connector;
- qpid::framing::OutputHandler* out;
- ResponseHandler responses;
- volatile bool closed;
- qpid::framing::ProtocolVersion version;
- bool tcpNoDelay;
-
- void channelException(Channel* channel, qpid::framing::AMQMethodBody* body, QpidError& e);
- void error(int code, const std::string& msg, int classid = 0, int methodid = 0);
- void closeChannel(Channel* channel, u_int16_t code, std::string& text, u_int16_t classId = 0, u_int16_t methodId = 0);
- void sendAndReceive(qpid::framing::AMQFrame* frame, const qpid::framing::AMQMethodBody& body);
-
- virtual void handleMethod(qpid::framing::AMQMethodBody::shared_ptr body);
- virtual void handleHeader(qpid::framing::AMQHeaderBody::shared_ptr body);
- virtual void handleContent(qpid::framing::AMQContentBody::shared_ptr body);
- virtual void handleHeartbeat(qpid::framing::AMQHeartbeatBody::shared_ptr body);
-
- public:
- /**
- * Creates a connection object, but does not open the
- * connection.
- *
- * @param _version the version of the protocol to connect with
- *
- * @param debug turns on tracing for the connection
- * (i.e. prints details of the frames sent and received to std
- * out). Optional and defaults to false.
- *
- * @param max_frame_size the maximum frame size that the
- * client will accept. Optional and defaults to 65536.
- */
- Connection( bool debug = false, u_int32_t max_frame_size = 65536,
- qpid::framing::ProtocolVersion* _version = &(qpid::framing::highestProtocolVersion));
- ~Connection();
-
- void setTcpNoDelay(bool on);
-
- /**
- * 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 = "");
- /**
- * Closes the connection. Any further use of this connection
- * (without reopening it) will not succeed.
- */
- void close();
- /**
- * Opens a Channel. In AMQP channels are like multi-plexed
- * 'sessions' of work over a connection. Almost all the
- * interaction with AMQP is done over a channel.
- *
- * @param channel a pointer to a channel instance that will be
- * used to represent the new channel.
- */
- void openChannel(Channel* channel);
- /*
- * Requests that the server close this channel, then removes
- * the association to the channel from this connection
- *
- * @param channel a pointer to the channel instance to close
- */
- void closeChannel(Channel* channel);
- /*
- * Removes the channel from association with this connection,
- * without sending a close request to the server.
- *
- * @param channel a pointer to the channel instance to
- * disassociate
- */
- void removeChannel(Channel* channel);
-
- virtual void received(qpid::framing::AMQFrame* frame);
-
- virtual void idleOut();
- virtual void idleIn();
-
- virtual void shutdown();
-
- /**
- * @return the maximum frame size in use on this connection
- */
- inline u_int32_t getMaxFrameSize(){ return max_frame_size; }
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/client/Connector.cpp b/Final/cpp/lib/client/Connector.cpp
deleted file mode 100644
index a99360b840..0000000000
--- a/Final/cpp/lib/client/Connector.cpp
+++ /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.
- *
- */
-#include <iostream>
-#include <QpidError.h>
-#include <sys/Time.h>
-#include "Connector.h"
-
-using namespace qpid::sys;
-using namespace qpid::client;
-using namespace qpid::framing;
-using qpid::QpidError;
-
-Connector::Connector(const qpid::framing::ProtocolVersion& pVersion, bool _debug, u_int32_t buffer_size) :
- debug(_debug),
- receive_buffer_size(buffer_size),
- send_buffer_size(buffer_size),
- version(pVersion),
- closed(true),
- lastIn(0), lastOut(0),
- timeout(0),
- idleIn(0), idleOut(0),
- timeoutHandler(0),
- shutdownHandler(0),
- inbuf(receive_buffer_size),
- outbuf(send_buffer_size){ }
-
-Connector::~Connector(){ }
-
-void Connector::connect(const std::string& host, int port, bool tcpNoDelay){
- socket = Socket::createTcp();
- if (tcpNoDelay) {
- socket.setTcpNoDelay(true);
- }
- socket.connect(host, port);
- closed = false;
- receiver = Thread(this);
-}
-
-void Connector::init(ProtocolInitiation* header){
- writeBlock(header);
- delete header;
-}
-
-void Connector::close(){
- if (markClosed()) {
- socket.close();
- receiver.join();
- }
-}
-
-void Connector::setInputHandler(InputHandler* handler){
- input = handler;
-}
-
-void Connector::setShutdownHandler(ShutdownHandler* handler){
- shutdownHandler = handler;
-}
-
-OutputHandler* Connector::getOutputHandler(){
- return this;
-}
-
-void Connector::send(AMQFrame* frame){
- writeBlock(frame);
- if(debug) std::cout << "SENT: " << *frame << std::endl;
- delete frame;
-}
-
-void Connector::writeBlock(AMQDataBlock* data){
- Mutex::ScopedLock l(writeLock);
- data->encode(outbuf);
- //transfer data to wire
- outbuf.flip();
- writeToSocket(outbuf.start(), outbuf.available());
- outbuf.clear();
-}
-
-void Connector::writeToSocket(char* data, size_t available){
- size_t written = 0;
- while(written < available && !closed){
- ssize_t sent = socket.send(data + written, available-written);
- if(sent > 0) {
- lastOut = now() * TIME_MSEC;
- written += sent;
- }
- }
-}
-
-void Connector::handleClosed(){
- if (markClosed()) {
- socket.close();
- if(shutdownHandler) shutdownHandler->shutdown();
- }
-}
-
-bool Connector::markClosed(){
- if (closed) {
- return false;
- } else {
- closed = true;
- return true;
- }
-}
-
-void Connector::checkIdle(ssize_t status){
- if(timeoutHandler){
- Time t = now() * TIME_MSEC;
- if(status == Socket::SOCKET_TIMEOUT) {
- if(idleIn && (t - lastIn > idleIn)){
- timeoutHandler->idleIn();
- }
- }else if(status == Socket::SOCKET_EOF){
- handleClosed();
- }else{
- lastIn = t;
- }
- if(idleOut && (t - lastOut > idleOut)){
- timeoutHandler->idleOut();
- }
- }
-}
-
-void Connector::setReadTimeout(u_int16_t t){
- idleIn = t * 1000;//t is in secs
- if(idleIn && (!timeout || idleIn < timeout)){
- timeout = idleIn;
- setSocketTimeout();
- }
-
-}
-
-void Connector::setWriteTimeout(u_int16_t t){
- idleOut = t * 1000;//t is in secs
- if(idleOut && (!timeout || idleOut < timeout)){
- timeout = idleOut;
- setSocketTimeout();
- }
-}
-
-void Connector::setSocketTimeout(){
- socket.setTimeout(timeout*TIME_MSEC);
-}
-
-void Connector::setTimeoutHandler(TimeoutHandler* handler){
- timeoutHandler = handler;
-}
-
-void Connector::run(){
- try{
- while(!closed){
- ssize_t available = inbuf.available();
- if(available < 1){
- THROW_QPID_ERROR(INTERNAL_ERROR, "Frame exceeds buffer size.");
- }
- ssize_t received = socket.recv(inbuf.start(), available);
- checkIdle(received);
-
- if(!closed && received > 0){
- inbuf.move(received);
- inbuf.flip();//position = 0, limit = total data read
-
- AMQFrame frame(version);
- while(frame.decode(inbuf)){
- if(debug) std::cout << "RECV: " << frame << std::endl;
- input->received(&frame);
- }
- //need to compact buffer to preserve any 'extra' data
- inbuf.compact();
- }
- }
- }catch(QpidError error){
- std::cout << "Error [" << error.code << "] " << error.msg
- << " (" << error.location.file << ":" << error.location.line
- << ")" << std::endl;
- handleClosed();
- }
-}
diff --git a/Final/cpp/lib/client/Connector.h b/Final/cpp/lib/client/Connector.h
deleted file mode 100644
index 44112369dc..0000000000
--- a/Final/cpp/lib/client/Connector.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#ifndef _Connector_
-#define _Connector_
-
-
-#include <framing/InputHandler.h>
-#include <framing/OutputHandler.h>
-#include <framing/InitiationHandler.h>
-#include <framing/ProtocolInitiation.h>
-#include <ProtocolVersion.h>
-#include <sys/ShutdownHandler.h>
-#include <sys/TimeoutHandler.h>
-#include <sys/Thread.h>
-#include <sys/Monitor.h>
-#include <sys/Socket.h>
-
-namespace qpid {
-namespace client {
-
- class Connector : public qpid::framing::OutputHandler,
- private qpid::sys::Runnable
- {
- const bool debug;
- const int receive_buffer_size;
- const int send_buffer_size;
- qpid::framing::ProtocolVersion version;
-
- volatile bool closed;
-
- int64_t lastIn;
- int64_t lastOut;
- int64_t timeout;
- u_int32_t idleIn;
- u_int32_t idleOut;
-
- qpid::sys::TimeoutHandler* timeoutHandler;
- qpid::sys::ShutdownHandler* shutdownHandler;
- qpid::framing::InputHandler* input;
- qpid::framing::InitiationHandler* initialiser;
- qpid::framing::OutputHandler* output;
-
- qpid::framing::Buffer inbuf;
- qpid::framing::Buffer outbuf;
-
- qpid::sys::Mutex writeLock;
- qpid::sys::Thread receiver;
-
- qpid::sys::Socket socket;
-
- void checkIdle(ssize_t status);
- void writeBlock(qpid::framing::AMQDataBlock* data);
- void writeToSocket(char* data, size_t available);
- void setSocketTimeout();
-
- void run();
- void handleClosed();
- bool markClosed();
-
- public:
- Connector(const qpid::framing::ProtocolVersion& pVersion, bool debug = false, u_int32_t buffer_size = 1024);
- virtual ~Connector();
- virtual void connect(const std::string& host, int port, bool tcpNoDelay=false);
- virtual void init(qpid::framing::ProtocolInitiation* header);
- virtual void close();
- virtual void setInputHandler(qpid::framing::InputHandler* handler);
- virtual void setTimeoutHandler(qpid::sys::TimeoutHandler* handler);
- virtual void setShutdownHandler(qpid::sys::ShutdownHandler* handler);
- virtual qpid::framing::OutputHandler* getOutputHandler();
- virtual void send(qpid::framing::AMQFrame* frame);
- virtual void setReadTimeout(u_int16_t timeout);
- virtual void setWriteTimeout(u_int16_t timeout);
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/client/IncomingMessage.cpp b/Final/cpp/lib/client/IncomingMessage.cpp
deleted file mode 100644
index 2ff143ba94..0000000000
--- a/Final/cpp/lib/client/IncomingMessage.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 <IncomingMessage.h>
-#include <QpidError.h>
-#include <iostream>
-
-using namespace qpid::client;
-using namespace qpid::framing;
-
-IncomingMessage::IncomingMessage(BasicDeliverBody::shared_ptr intro) : delivered(intro){}
-IncomingMessage::IncomingMessage(BasicReturnBody::shared_ptr intro): returned(intro){}
-IncomingMessage::IncomingMessage(BasicGetOkBody::shared_ptr intro): response(intro){}
-
-IncomingMessage::~IncomingMessage(){
-}
-
-void IncomingMessage::setHeader(AMQHeaderBody::shared_ptr _header){
- this->header = _header;
-}
-
-void IncomingMessage::addContent(AMQContentBody::shared_ptr _content){
- this->content.push_back(_content);
-}
-
-bool IncomingMessage::isComplete(){
- return header != 0 && header->getContentSize() == contentSize();
-}
-
-bool IncomingMessage::isReturn(){
- return returned;
-}
-
-bool IncomingMessage::isDelivery(){
- return delivered;
-}
-
-bool IncomingMessage::isResponse(){
- return response;
-}
-
-const string& IncomingMessage::getConsumerTag(){
- if(!isDelivery()) THROW_QPID_ERROR(CLIENT_ERROR, "Consumer tag only valid for delivery");
- return delivered->getConsumerTag();
-}
-
-u_int64_t IncomingMessage::getDeliveryTag(){
- if(!isDelivery()) THROW_QPID_ERROR(CLIENT_ERROR, "Delivery tag only valid for delivery");
- return delivered->getDeliveryTag();
-}
-
-AMQHeaderBody::shared_ptr& IncomingMessage::getHeader(){
- return header;
-}
-
-void IncomingMessage::getData(string& s){
- int count(content.size());
- for(int i = 0; i < count; i++){
- if(i == 0) s = content[i]->getData();
- else s += content[i]->getData();
- }
-}
-
-u_int64_t IncomingMessage::contentSize(){
- u_int64_t size(0);
- u_int64_t count(content.size());
- for(u_int64_t i = 0; i < count; i++){
- size += content[i]->size();
- }
- return size;
-}
diff --git a/Final/cpp/lib/client/IncomingMessage.h b/Final/cpp/lib/client/IncomingMessage.h
deleted file mode 100644
index 464e05d877..0000000000
--- a/Final/cpp/lib/client/IncomingMessage.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.
- *
- */
-#include <string>
-#include <vector>
-#include <framing/amqp_framing.h>
-
-#ifndef _IncomingMessage_
-#define _IncomingMessage_
-
-#include <ClientMessage.h>
-
-namespace qpid {
-namespace client {
-
- class IncomingMessage{
- //content will be preceded by one of these method frames
- qpid::framing::BasicDeliverBody::shared_ptr delivered;
- qpid::framing::BasicReturnBody::shared_ptr returned;
- qpid::framing::BasicGetOkBody::shared_ptr response;
- qpid::framing::AMQHeaderBody::shared_ptr header;
- std::vector<qpid::framing::AMQContentBody::shared_ptr> content;
-
- u_int64_t contentSize();
- public:
- IncomingMessage(qpid::framing::BasicDeliverBody::shared_ptr intro);
- IncomingMessage(qpid::framing::BasicReturnBody::shared_ptr intro);
- IncomingMessage(qpid::framing::BasicGetOkBody::shared_ptr intro);
- ~IncomingMessage();
- void setHeader(qpid::framing::AMQHeaderBody::shared_ptr header);
- void addContent(qpid::framing::AMQContentBody::shared_ptr content);
- bool isComplete();
- bool isReturn();
- bool isDelivery();
- bool isResponse();
- const std::string& getConsumerTag();//only relevant if isDelivery()
- qpid::framing::AMQHeaderBody::shared_ptr& getHeader();
- u_int64_t getDeliveryTag();
- void getData(std::string& data);
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/client/Makefile.am b/Final/cpp/lib/client/Makefile.am
deleted file mode 100644
index 9935da654a..0000000000
--- a/Final/cpp/lib/client/Makefile.am
+++ /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.
-#
-AM_CXXFLAGS = $(WARNING_CFLAGS)
-INCLUDES = \
- -I$(top_srcdir)/gen \
- -I$(top_srcdir)/lib/common \
- -I$(top_srcdir)/lib/common/sys \
- -I$(top_srcdir)/lib/common/framing \
- $(APR_CXXFLAGS)
-
-lib_LTLIBRARIES = libqpidclient.la
-libqpidclient_la_LIBADD = ../common/libqpidcommon.la
-libqpidclient_la_LDFLAGS = -version-info $(LIBTOOL_VERSION_INFO_ARG)
-libqpidclient_la_SOURCES = \
- ClientChannel.cpp \
- ClientExchange.cpp \
- ClientMessage.cpp \
- ClientQueue.cpp \
- Connection.cpp \
- Connector.cpp \
- IncomingMessage.cpp \
- MessageListener.cpp \
- ResponseHandler.cpp \
- ReturnedMessageHandler.cpp
-pkginclude_HEADERS = \
- ClientChannel.h \
- ClientExchange.h \
- ClientMessage.h \
- ClientQueue.h \
- Connection.h \
- Connector.h \
- IncomingMessage.h \
- MessageListener.h \
- MethodBodyInstances.h \
- ResponseHandler.h \
- ReturnedMessageHandler.h
diff --git a/Final/cpp/lib/client/MessageListener.cpp b/Final/cpp/lib/client/MessageListener.cpp
deleted file mode 100644
index 70d44e7040..0000000000
--- a/Final/cpp/lib/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/Final/cpp/lib/client/MessageListener.h b/Final/cpp/lib/client/MessageListener.h
deleted file mode 100644
index cfb917b4f8..0000000000
--- a/Final/cpp/lib/client/MessageListener.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.
- *
- */
-#include <string>
-
-#ifndef _MessageListener_
-#define _MessageListener_
-
-#include <ClientMessage.h>
-
-namespace qpid {
-namespace client {
-
- /**
- * An interface through which asynchronously delivered messages
- * can be received by an application.
- *
- * @see Channel::consume()
- *
- * \ingroup clientapi
- */
- class MessageListener{
- public:
- virtual ~MessageListener();
- virtual void received(Message& msg) = 0;
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/client/MethodBodyInstances.h b/Final/cpp/lib/client/MethodBodyInstances.h
deleted file mode 100644
index 3ab0c9af8f..0000000000
--- a/Final/cpp/lib/client/MethodBodyInstances.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 <framing/amqp_framing.h>
-
-#ifndef _MethodBodyInstances_h_
-#define _MethodBodyInstances_h_
-
-namespace qpid {
-namespace client {
-
-/**
- * A list of method body instances that can be used to compare against
- * incoming bodies.
- */
-class MethodBodyInstances
-{
-private:
- qpid::framing::ProtocolVersion version;
-public:
- const qpid::framing::BasicCancelOkBody basic_cancel_ok;
- const qpid::framing::BasicConsumeOkBody basic_consume_ok;
- const qpid::framing::BasicDeliverBody basic_deliver;
- const qpid::framing::BasicGetEmptyBody basic_get_empty;
- const qpid::framing::BasicGetOkBody basic_get_ok;
- const qpid::framing::BasicQosOkBody basic_qos_ok;
- const qpid::framing::BasicReturnBody basic_return;
- const qpid::framing::ChannelCloseBody channel_close;
- const qpid::framing::ChannelCloseOkBody channel_close_ok;
- const qpid::framing::ChannelFlowBody channel_flow;
- const qpid::framing::ChannelOpenOkBody channel_open_ok;
- const qpid::framing::ConnectionCloseBody connection_close;
- const qpid::framing::ConnectionCloseOkBody connection_close_ok;
- const qpid::framing::ConnectionOpenOkBody connection_open_ok;
- const qpid::framing::ConnectionRedirectBody connection_redirect;
- const qpid::framing::ConnectionStartBody connection_start;
- const qpid::framing::ConnectionTuneBody connection_tune;
- const qpid::framing::ExchangeDeclareOkBody exchange_declare_ok;
- const qpid::framing::ExchangeDeleteOkBody exchange_delete_ok;
- const qpid::framing::QueueDeclareOkBody queue_declare_ok;
- const qpid::framing::QueueDeleteOkBody queue_delete_ok;
- const qpid::framing::QueueBindOkBody queue_bind_ok;
- const qpid::framing::TxCommitOkBody tx_commit_ok;
- const qpid::framing::TxRollbackOkBody tx_rollback_ok;
- const qpid::framing::TxSelectOkBody tx_select_ok;
-
- MethodBodyInstances(u_int8_t major, u_int8_t minor) :
- version(major, minor),
- basic_cancel_ok(version),
- basic_consume_ok(version),
- basic_deliver(version),
- basic_get_empty(version),
- basic_get_ok(version),
- basic_qos_ok(version),
- basic_return(version),
- channel_close(version),
- channel_close_ok(version),
- channel_flow(version),
- channel_open_ok(version),
- connection_close(version),
- connection_close_ok(version),
- connection_open_ok(version),
- connection_redirect(version),
- connection_start(version),
- connection_tune(version),
- exchange_declare_ok(version),
- exchange_delete_ok(version),
- queue_declare_ok(version),
- queue_delete_ok(version),
- queue_bind_ok(version),
- tx_commit_ok(version),
- tx_rollback_ok(version),
- tx_select_ok(version)
- {}
-
-};
-
-static MethodBodyInstances method_bodies(8, 0);
-
-} // namespace client
-} // namespace qpid
-
-#endif
diff --git a/Final/cpp/lib/client/ResponseHandler.cpp b/Final/cpp/lib/client/ResponseHandler.cpp
deleted file mode 100644
index ac8b4a9ced..0000000000
--- a/Final/cpp/lib/client/ResponseHandler.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 <ResponseHandler.h>
-#include <sys/Monitor.h>
-#include <QpidError.h>
-
-using namespace qpid::sys;
-
-qpid::client::ResponseHandler::ResponseHandler() : waiting(false){}
-
-qpid::client::ResponseHandler::~ResponseHandler(){}
-
-bool qpid::client::ResponseHandler::validate(const qpid::framing::AMQMethodBody& expected){
- return expected.match(response.get());
-}
-
-void qpid::client::ResponseHandler::waitForResponse(){
- Monitor::ScopedLock l(monitor);
- if(waiting){
- monitor.wait();
- }
-}
-
-void qpid::client::ResponseHandler::signalResponse(qpid::framing::AMQMethodBody::shared_ptr _response){
- response = _response;
- Monitor::ScopedLock l(monitor);
- waiting = false;
- monitor.notify();
-}
-
-void qpid::client::ResponseHandler::receive(const qpid::framing::AMQMethodBody& expected){
- Monitor::ScopedLock l(monitor);
- if(waiting){
- monitor.wait();
- }
- if(!validate(expected)){
- THROW_QPID_ERROR(PROTOCOL_ERROR, "Protocol Error");
- }
-}
-
-void qpid::client::ResponseHandler::expect(){
- waiting = true;
-}
diff --git a/Final/cpp/lib/client/ResponseHandler.h b/Final/cpp/lib/client/ResponseHandler.h
deleted file mode 100644
index c3d499d046..0000000000
--- a/Final/cpp/lib/client/ResponseHandler.h
+++ /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 <string>
-#include <framing/amqp_framing.h>
-#include <sys/Monitor.h>
-
-#ifndef _ResponseHandler_
-#define _ResponseHandler_
-
-namespace qpid {
- namespace client {
-
- class ResponseHandler{
- bool waiting;
- qpid::framing::AMQMethodBody::shared_ptr response;
- qpid::sys::Monitor monitor;
-
- public:
- ResponseHandler();
- ~ResponseHandler();
- inline bool isWaiting(){ return waiting; }
- inline qpid::framing::AMQMethodBody::shared_ptr getResponse(){ return response; }
- bool validate(const qpid::framing::AMQMethodBody& expected);
- void waitForResponse();
- void signalResponse(qpid::framing::AMQMethodBody::shared_ptr response);
- void receive(const qpid::framing::AMQMethodBody& expected);
- void expect();//must be called before calling receive
- };
-
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/client/ReturnedMessageHandler.cpp b/Final/cpp/lib/client/ReturnedMessageHandler.cpp
deleted file mode 100644
index ee9f7462ef..0000000000
--- a/Final/cpp/lib/client/ReturnedMessageHandler.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 <ReturnedMessageHandler.h>
-
-qpid::client::ReturnedMessageHandler::~ReturnedMessageHandler() {}
diff --git a/Final/cpp/lib/client/ReturnedMessageHandler.h b/Final/cpp/lib/client/ReturnedMessageHandler.h
deleted file mode 100644
index 137f0b2e17..0000000000
--- a/Final/cpp/lib/client/ReturnedMessageHandler.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.
- *
- */
-#include <string>
-
-#ifndef _ReturnedMessageHandler_
-#define _ReturnedMessageHandler_
-
-#include <ClientMessage.h>
-
-namespace qpid {
-namespace client {
-
- /**
- * An interface through which returned messages can be received by
- * an application.
- *
- * @see Channel::setReturnedMessageHandler()
- *
- * \ingroup clientapi
- */
- class ReturnedMessageHandler{
- public:
- virtual ~ReturnedMessageHandler();
- virtual void returned(Message& msg) = 0;
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/CommonOptions.cpp b/Final/cpp/lib/common/CommonOptions.cpp
deleted file mode 100644
index 2b6657b4e0..0000000000
--- a/Final/cpp/lib/common/CommonOptions.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 "CommonOptions.h"
-#include <algorithm>
-
-namespace qpid {
-
-namespace program_options {
-
-static const std::string prefix("QPID_");
-
-static char env2optchar(char env) { return (env=='_') ? '-' : tolower(env); }
-
-std::string EnvMapper::operator()(const std::string& env) {
- if (env.substr(0, prefix.size()) == prefix) {
- std::string opt = env.substr(prefix.size());
- transform(opt.begin(), opt.end(), opt.begin(), env2optchar);
- // Ignore env vars that don't match to known options.
- if (opts.find_nothrow(opt, false))
- return opt;
- }
- return std::string();
-}
-
-} // namespace program_options
-
-const int CommonOptions::DEFAULT_PORT=5672;
-
-CommonOptions::CommonOptions() : trace(false), port(DEFAULT_PORT) {}
-
-void CommonOptions::addTo(po::options_description& desc)
-{
- using namespace po;
- desc.add_options()
- ("trace,t", optValue(trace), "Enable debug tracing" )
- ("port,p", optValue(port,"PORT"), "Use PORT for AMQP connections.");
-}
-
-} // namespace qpid
-
diff --git a/Final/cpp/lib/common/CommonOptions.h b/Final/cpp/lib/common/CommonOptions.h
deleted file mode 100644
index 086b9742fb..0000000000
--- a/Final/cpp/lib/common/CommonOptions.h
+++ /dev/null
@@ -1,101 +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 <boost/program_options.hpp>
-#include <boost/format.hpp>
-
-namespace qpid {
-
-/**@Qpid extensions to boost::program_options */
-namespace program_options {
-
-using namespace boost::program_options;
-
-/** @internal Normally only constructed by optValue() */
-template <class T>
-class OptionValue : public typed_value<T> {
- public:
- OptionValue(T& value, const std::string& arg)
- : typed_value<T>(&value), argName(arg) {}
- std::string name() const { return argName; }
- private:
- std::string argName;
-};
-
-/**
- * Like boost::program_options::value() with more convenient signature
- * for updating a value by reference and nicer help formatting.
- *
- *@param value displayed as default in help, updated from options.
- * Must support ostream << operator.
- *@param arg name for arguments in help.
- *
- *@see CommonOptions.cpp for example of use.
- */
-template<class T>
-value_semantic* optValue(T& value, const char* arg) {
- std::string val(boost::lexical_cast<std::string>(value));
- std::string argName(
- val.empty() ? std::string(arg) :
- (boost::format("%s (=%s) ") % arg % val).str());
- return new OptionValue<T>(value, argName);
-}
-
-/** Environment-to-option name mapping.
- * Maps env variable "QPID_SOME_VAR" to option "some-var"
- * Ignores env vars that dont match known options._
- */
-struct EnvMapper {
- EnvMapper(const options_description& o) : opts(o) {}
- std::string operator()(const std::string& env);
- const options_description& opts;
-};
-
-/**
- * Like boost::program_options::bool_switch but takes reference, not pointer.
- */
-inline value_semantic* optValue(bool& value) { return bool_switch(&value); }
-
-} // namespace program_options
-
-namespace po=program_options; // Convenience alias.
-
-/**
- * Common options for client and broker
- */
-struct CommonOptions {
- static const int DEFAULT_PORT;
-
- CommonOptions();
-
- bool trace;
- int port;
-
- /** Add members to program_options to be updated */
- void addTo(po::options_description&);
-};
-
-} // namespace qpid
-
-#endif /*!QPID_COMMONOPTIONS_H*/
diff --git a/Final/cpp/lib/common/Exception.cpp b/Final/cpp/lib/common/Exception.cpp
deleted file mode 100644
index 64d88af1b4..0000000000
--- a/Final/cpp/lib/common/Exception.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 "Exception.h"
-#include <cerrno>
-
-namespace qpid {
-
-std::string strError(int err) {
- char buf[512];
- return std::string(strerror_r(err, buf, sizeof(buf)));
-}
-
-Exception::Exception() throw() {}
-
-Exception::Exception(const std::string& str) throw() : whatStr(str) {}
-
-Exception::Exception(const char* str) throw() : whatStr(str) {}
-
-Exception::~Exception() throw() {}
-
-const char* Exception::what() const throw() { return whatStr.c_str(); }
-
-std::string Exception::toString() const throw() { return whatStr; }
-
-Exception* Exception::clone() const throw() { return new Exception(*this); }
-
-void Exception::throwSelf() const { throw *this; }
-
-} // namespace qpid
diff --git a/Final/cpp/lib/common/Exception.h b/Final/cpp/lib/common/Exception.h
deleted file mode 100644
index 4e26ad42e3..0000000000
--- a/Final/cpp/lib/common/Exception.h
+++ /dev/null
@@ -1,65 +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 <exception>
-#include <string>
-#include <memory>
-#include <boost/shared_ptr.hpp>
-
-namespace qpid
-{
-
-/** Get the error message for error number err. */
-std::string strError(int err);
-
-/**
- * Exception base class for all Qpid exceptions.
- */
-class Exception : public std::exception
-{
- protected:
- std::string whatStr;
-
- public:
- Exception() throw();
- Exception(const std::string& str) throw();
- Exception(const char* str) throw();
- Exception(const std::exception&) throw();
-
- virtual ~Exception() throw();
-
- virtual const char* what() const throw();
- virtual std::string toString() const throw();
-
- virtual Exception* clone() const throw();
- virtual void throwSelf() const;
-
- typedef boost::shared_ptr<Exception> shared_ptr;
-};
-
-
-
-}
-
-#endif /*!_Exception_*/
diff --git a/Final/cpp/lib/common/ExceptionHolder.cpp b/Final/cpp/lib/common/ExceptionHolder.cpp
deleted file mode 100644
index 34079d2f25..0000000000
--- a/Final/cpp/lib/common/ExceptionHolder.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 "ExceptionHolder.h"
-
-namespace qpid {
-
-ExceptionHolder::ExceptionHolder(const std::exception& e) {
- const Exception* ex = dynamic_cast<const Exception*>(&e);
- if (ex) {
- reset(ex->clone());
- } else {
- reset(new Exception(e.what()));
- }
-}
-
-}
diff --git a/Final/cpp/lib/common/ExceptionHolder.h b/Final/cpp/lib/common/ExceptionHolder.h
deleted file mode 100644
index e4679e7828..0000000000
--- a/Final/cpp/lib/common/ExceptionHolder.h
+++ /dev/null
@@ -1,65 +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 <Exception.h>
-#include <boost/shared_ptr.hpp>
-
-namespace qpid {
-
-/**
- * Holder for a heap-allocated exc eption that can be stack allocated
- * and thrown safely.
- *
- * Basically this is a shared_ptr with the Exception functions added
- * so the catcher need not be aware that it is a pointer rather than a
- * reference.
- *
- * shared_ptr is chosen over auto_ptr because it has normal
- * copy semantics.
- */
-class ExceptionHolder : public Exception, public boost::shared_ptr<Exception>
-{
- public:
- typedef boost::shared_ptr<Exception> shared_ptr;
-
- ExceptionHolder() throw() {}
- ExceptionHolder(Exception* p) throw() : shared_ptr(p) {}
- ExceptionHolder(shared_ptr p) throw() : shared_ptr(p) {}
-
- ExceptionHolder(const Exception& e) throw() : shared_ptr(e.clone()) {}
- ExceptionHolder(const std::exception& e);
-
- ~ExceptionHolder() throw() {}
-
- const char* what() const throw() { return (*this)->what(); }
- std::string toString() const throw() { return (*this)->toString(); }
- virtual Exception* clone() const throw() { return (*this)->clone(); }
- virtual void throwSelf() const { (*this)->throwSelf(); }
-};
-
-} // namespace qpid
-
-
-
-#endif /*!_qpid_ExceptionHolder_h*/
diff --git a/Final/cpp/lib/common/Makefile.am b/Final/cpp/lib/common/Makefile.am
deleted file mode 100644
index b2e2de2cf1..0000000000
--- a/Final/cpp/lib/common/Makefile.am
+++ /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.
-#
-AM_CXXFLAGS = $(WARNING_CFLAGS)
-
-INCLUDES = \
- -I$(top_srcdir)/gen \
- -I$(top_srcdir)/lib/common/sys \
- -I$(top_srcdir)/lib/common/framing \
- $(APR_CXXFLAGS)
-
-apr = sys/apr
-apr_src = \
- $(apr)/APRAcceptor.cpp \
- $(apr)/APRBase.cpp \
- $(apr)/APRPool.cpp \
- $(apr)/APRSocket.cpp \
- $(apr)/LFProcessor.cpp \
- $(apr)/LFSessionContext.cpp \
- $(apr)/Socket.cpp \
- $(apr)/Thread.cpp
-apr_hdr = \
- $(apr)/APRBase.h \
- $(apr)/APRPool.h \
- $(apr)/APRSocket.h \
- $(apr)/LFProcessor.h \
- $(apr)/LFSessionContext.h
-
-posix = sys/posix
-posix_src = \
- $(posix)/PosixAcceptor.cpp \
- $(posix)/Socket.cpp \
- $(posix)/Thread.cpp \
- $(posix)/check.cpp \
- $(posix)/EventChannel.cpp \
- $(posix)/EventChannelThreads.cpp
-posix_hdr = \
- $(posix)/check.h \
- $(posix)/EventChannel.h \
- $(posix)/EventChannelThreads.h
-
-EXTRA_DIST=$(posix_src) $(posix_hdr)
-platform_src = $(apr_src)
-platform_hdr = $(apr_hdr)
-
-framing = framing
-gen = $(srcdir)/../../gen
-
-lib_LTLIBRARIES = libqpidcommon.la
-libqpidcommon_la_LIBADD = \
- $(APR_LIBS) \
- $(LIB_DLOPEN) \
- $(LIB_CLOCK_GETTIME) \
- -lboost_program_options
-
-libqpidcommon_la_LDFLAGS = \
- -version-info \
- $(LIBTOOL_VERSION_INFO_ARG)
-
-libqpidcommon_la_SOURCES = \
- $(platform_src) \
- $(framing)/AMQBody.cpp \
- $(framing)/AMQContentBody.cpp \
- $(framing)/AMQFrame.cpp \
- $(framing)/AMQHeaderBody.cpp \
- $(framing)/AMQHeartbeatBody.cpp \
- $(framing)/AMQMethodBody.cpp \
- $(framing)/BasicHeaderProperties.cpp \
- $(framing)/BodyHandler.cpp \
- $(framing)/Buffer.cpp \
- $(framing)/FieldTable.cpp \
- $(framing)/FramingContent.cpp \
- $(framing)/InitiationHandler.cpp \
- $(framing)/ProtocolInitiation.cpp \
- $(framing)/ProtocolVersion.cpp \
- $(framing)/ProtocolVersionException.cpp \
- $(framing)/Value.cpp \
- $(gen)/AMQP_ClientProxy.cpp \
- $(gen)/AMQP_HighestVersion.h \
- $(gen)/AMQP_MethodVersionMap.cpp \
- $(gen)/AMQP_ServerProxy.cpp \
- Exception.cpp \
- ExceptionHolder.cpp \
- QpidError.cpp \
- CommonOptions.cpp \
- sys/Runnable.cpp \
- sys/Time.cpp
-
-nobase_pkginclude_HEADERS = \
- $(platform_hdr) \
- $(framing)/AMQBody.h \
- $(framing)/AMQContentBody.h \
- $(framing)/AMQDataBlock.h \
- $(framing)/AMQFrame.h \
- $(framing)/AMQHeaderBody.h \
- $(framing)/AMQHeartbeatBody.h \
- $(framing)/AMQMethodBody.h \
- $(framing)/BasicHeaderProperties.h \
- $(framing)/BodyHandler.h \
- $(framing)/Buffer.h \
- $(framing)/FieldTable.h \
- $(framing)/FramingContent.h \
- $(framing)/HeaderProperties.h \
- $(framing)/InitiationHandler.h \
- $(framing)/InputHandler.h \
- $(framing)/OutputHandler.h \
- $(framing)/ProtocolInitiation.h \
- $(framing)/ProtocolVersion.h \
- $(framing)/ProtocolVersionException.h \
- $(framing)/Value.h \
- $(framing)/amqp_framing.h \
- $(framing)/amqp_types.h \
- $(posix_hdr) \
- Exception.h \
- ExceptionHolder.h \
- QpidError.h \
- SharedObject.h \
- CommonOptions.h \
- sys/Acceptor.h \
- sys/AtomicCount.h \
- sys/Module.h \
- sys/Monitor.h \
- sys/Mutex.h \
- sys/Runnable.h \
- sys/SessionContext.h \
- sys/SessionHandler.h \
- sys/SessionHandlerFactory.h \
- sys/ShutdownHandler.h \
- sys/Socket.h \
- sys/Thread.h \
- sys/Time.h \
- sys/TimeoutHandler.h
-
-
-# Force build during dist phase so help2man will work.
-dist-hook: $(lib_LTLIBRARIES)
diff --git a/Final/cpp/lib/common/QpidError.cpp b/Final/cpp/lib/common/QpidError.cpp
deleted file mode 100644
index 7f4f9e2f34..0000000000
--- a/Final/cpp/lib/common/QpidError.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 <QpidError.h>
-#include <sstream>
-
-using namespace qpid;
-
-QpidError::QpidError() : code(0) {}
-
-QpidError::QpidError(int _code, const std::string& _msg,
- const SrcLine& _loc) throw()
- : code(_code), msg(_msg), location(_loc)
-{
- std::ostringstream os;
- os << "Error [" << code << "] " << msg << " ("
- << location.file << ":" << location.line << ")";
- whatStr = os.str();
-}
-
-QpidError::~QpidError() throw() {}
-
-Exception* QpidError::clone() const throw() { return new QpidError(*this); }
-
-void QpidError::throwSelf() const { throw *this; }
-
diff --git a/Final/cpp/lib/common/QpidError.h b/Final/cpp/lib/common/QpidError.h
deleted file mode 100644
index 30d9d27076..0000000000
--- a/Final/cpp/lib/common/QpidError.h
+++ /dev/null
@@ -1,67 +0,0 @@
-#ifndef __QpidError__
-#define __QpidError__
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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 <ostream>
-#include <Exception.h>
-
-namespace qpid {
-
-struct SrcLine {
- public:
- SrcLine(const std::string& file_="", int line_=0) :
- file(file_), line(line_) {}
-
- std::string file;
- int line;
-};
-
-class QpidError : public Exception {
- public:
- const int code;
- const std::string msg;
- const SrcLine location;
-
- QpidError();
- QpidError(int _code, const std::string& _msg, const SrcLine& _loc) throw();
- ~QpidError() throw();
- Exception* clone() const throw();
- void throwSelf() const;
-};
-
-
-} // namespace qpid
-
-#define SRCLINE ::qpid::SrcLine(__FILE__, __LINE__)
-
-#define QPID_ERROR(CODE, MESSAGE) ::qpid::QpidError((CODE), (MESSAGE), SRCLINE)
-
-#define THROW_QPID_ERROR(CODE, MESSAGE) throw QPID_ERROR(CODE,MESSAGE)
-
-const int PROTOCOL_ERROR = 10000;
-const int APR_ERROR = 20000;
-const int FRAMING_ERROR = 30000;
-const int CLIENT_ERROR = 40000;
-const int INTERNAL_ERROR = 50000;
-
-#endif
diff --git a/Final/cpp/lib/common/SharedObject.h b/Final/cpp/lib/common/SharedObject.h
deleted file mode 100644
index 852a036ab9..0000000000
--- a/Final/cpp/lib/common/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/Final/cpp/lib/common/doxygen_mainpage.h b/Final/cpp/lib/common/doxygen_mainpage.h
deleted file mode 100644
index 752fcbf862..0000000000
--- a/Final/cpp/lib/common/doxygen_mainpage.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.
- *
- */
-// This header file is just for doxygen documentation purposes.
-
-/*!\mainpage Qpid C++ Developer Kit.
- *
- *\section intro_sec Introduction
- *
- * The <a href=http://incubator.apache.org/qpid/index.html>Qpid project</a> provides implementations of the <a href="http://amqp.org/">AMQP messaging specification</a> in several programming language.
- *
- * Qpidc provides APIs and libraries to implement AMQP
- * clients in C++. Qpidc clients can interact with any compliant AMQP
- * message broker. The Qpid project also provides an AMQP broker
- * daemon called qpidd that you can use with your qpidc clients.
- *
- *\section install_sec Installation
- *
- * If you are installing from the source distribution
- <pre>
- > ./configure && make
- > make install </pre>
- * This will build and install the client development kit and the broker
- * in standard places. Use
- * <code>./configure --help</code> for more options.
- *
- * You can also install from RPMs with the <code>rpm -i</code> command.
- * You will need
- * - <code>qpidc</code> for core libraries.
- * - <code>qpidc-devel</code> for header files and developer documentation.
- * - <code>qpidd</code> for the broker daemon.
- *
- *\section getstart_sec Getting Started
- *
- * If you have installed in the standard places you should use
- * these compile flags:
- *
- *<code> -I/usr/include/qpidc -I/usr/include/qpidc/framing -I/usr/include/qpidc/sys</code>
- *
- * and these link flags:
- *
- *<code> -lqpidcommon -lqpidclient</code>
- *
- * If you have installed somewhere else you should modify the flags
- * appropriately.
- *
- * See the \ref clientapi "client API module" for more on the client API.
- */
diff --git a/Final/cpp/lib/common/framing/AMQBody.cpp b/Final/cpp/lib/common/framing/AMQBody.cpp
deleted file mode 100644
index b095312a16..0000000000
--- a/Final/cpp/lib/common/framing/AMQBody.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 <AMQBody.h>
-#include <iostream>
-
-std::ostream& qpid::framing::operator<<(std::ostream& out, const qpid::framing::AMQBody& body)
-{
- body.print(out);
- return out;
-}
-
-
-qpid::framing::AMQBody::~AMQBody() {}
-
-void qpid::framing::AMQBody::print(std::ostream& out) const {
- out << "unknown body";
-}
diff --git a/Final/cpp/lib/common/framing/AMQBody.h b/Final/cpp/lib/common/framing/AMQBody.h
deleted file mode 100644
index 5547d3c506..0000000000
--- a/Final/cpp/lib/common/framing/AMQBody.h
+++ /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 <boost/shared_ptr.hpp>
-#include <amqp_types.h>
-#include <Buffer.h>
-
-#ifndef _AMQBody_
-#define _AMQBody_
-
-namespace qpid {
- namespace framing {
-
- class AMQBody
- {
- public:
- typedef boost::shared_ptr<AMQBody> shared_ptr;
-
- virtual ~AMQBody();
- virtual u_int32_t size() const = 0;
- virtual u_int8_t type() const = 0;
- virtual void encode(Buffer& buffer) const = 0;
- virtual void decode(Buffer& buffer, u_int32_t size) = 0;
- virtual void print(std::ostream& out) const;
- };
-
- std::ostream& operator<<(std::ostream& out, const AMQBody& body) ;
-
- enum body_types {METHOD_BODY = 1, HEADER_BODY = 2, CONTENT_BODY = 3, HEARTBEAT_BODY = 8};
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/AMQContentBody.cpp b/Final/cpp/lib/common/framing/AMQContentBody.cpp
deleted file mode 100644
index 4f51dca243..0000000000
--- a/Final/cpp/lib/common/framing/AMQContentBody.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 <AMQContentBody.h>
-#include <iostream>
-
-qpid::framing::AMQContentBody::AMQContentBody(){
-}
-
-qpid::framing::AMQContentBody::AMQContentBody(const string& _data) : data(_data){
-}
-
-u_int32_t qpid::framing::AMQContentBody::size() const{
- return data.size();
-}
-void qpid::framing::AMQContentBody::encode(Buffer& buffer) const{
- buffer.putRawData(data);
-}
-void qpid::framing::AMQContentBody::decode(Buffer& buffer, u_int32_t _size){
- buffer.getRawData(data, _size);
-}
-
-void qpid::framing::AMQContentBody::print(std::ostream& out) const
-{
- out << "content (" << size() << " bytes)";
-}
diff --git a/Final/cpp/lib/common/framing/AMQContentBody.h b/Final/cpp/lib/common/framing/AMQContentBody.h
deleted file mode 100644
index 172228671a..0000000000
--- a/Final/cpp/lib/common/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 : virtual public AMQBody
-{
- string data;
-
-public:
- typedef boost::shared_ptr<AMQContentBody> shared_ptr;
-
- AMQContentBody();
- AMQContentBody(const string& data);
- inline virtual ~AMQContentBody(){}
- inline u_int8_t type() const { return CONTENT_BODY; };
- inline string& getData(){ return data; }
- u_int32_t size() const;
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer, u_int32_t size);
- void print(std::ostream& out) const;
-};
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/AMQDataBlock.h b/Final/cpp/lib/common/framing/AMQDataBlock.h
deleted file mode 100644
index ac91c52164..0000000000
--- a/Final/cpp/lib/common/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) = 0;
- virtual bool decode(Buffer& buffer) = 0;
- virtual u_int32_t size() const = 0;
-};
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/AMQFrame.cpp b/Final/cpp/lib/common/framing/AMQFrame.cpp
deleted file mode 100644
index 6fa5b9ae51..0000000000
--- a/Final/cpp/lib/common/framing/AMQFrame.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 <AMQFrame.h>
-#include <QpidError.h>
-
-using namespace qpid::framing;
-
-
-AMQP_MethodVersionMap AMQFrame::versionMap;
-
-
-AMQFrame::AMQFrame(qpid::framing::ProtocolVersion& _version):
-version(_version)
-{}
-
-
-AMQFrame::AMQFrame(qpid::framing::ProtocolVersion& _version, u_int16_t _channel, AMQBody* _body) :
-version(_version), channel(_channel), body(_body)
-{}
-
-
-AMQFrame::AMQFrame(qpid::framing::ProtocolVersion& _version, u_int16_t _channel, AMQBody::shared_ptr& _body) :
-version(_version), channel(_channel), body(_body)
-{}
-
-AMQFrame::~AMQFrame() {}
-
-u_int16_t AMQFrame::getChannel(){
- return channel;
-}
-
-AMQBody::shared_ptr& AMQFrame::getBody(){
- return body;
-}
-
-void AMQFrame::encode(Buffer& buffer)
-{
- buffer.putOctet(body->type());
- buffer.putShort(channel);
- buffer.putLong(body->size());
- body->encode(buffer);
- buffer.putOctet(0xCE);
-}
-
-AMQBody::shared_ptr AMQFrame::createMethodBody(Buffer& buffer){
- u_int16_t classId = buffer.getShort();
- u_int16_t methodId = buffer.getShort();
- AMQBody::shared_ptr body(versionMap.createMethodBody(classId, methodId, version.getMajor(), version.getMinor()));
- return body;
-}
-
-u_int32_t AMQFrame::size() const{
- if(!body.get()) THROW_QPID_ERROR(INTERNAL_ERROR, "Attempt to get size of frame with no body set!");
- return 1/*type*/ + 2/*channel*/ + 4/*body size*/ + body->size() + 1/*0xCE*/;
-}
-
-bool AMQFrame::decode(Buffer& buffer)
-{
- if(buffer.available() < 7) return false;
- buffer.record();
- u_int32_t bufSize = decodeHead(buffer);
-
- if(buffer.available() < bufSize + 1){
- buffer.restore();
- return false;
- }
- decodeBody(buffer, bufSize);
- u_int8_t end = buffer.getOctet();
- if(end != 0xCE) THROW_QPID_ERROR(FRAMING_ERROR, "Frame end not found");
- return true;
-}
-
-u_int32_t AMQFrame::decodeHead(Buffer& buffer){
- type = buffer.getOctet();
- channel = buffer.getShort();
- return buffer.getLong();
-}
-
-void AMQFrame::decodeBody(Buffer& buffer, uint32_t bufSize)
-{
- switch(type)
- {
- case METHOD_BODY:
- body = createMethodBody(buffer);
- break;
- case HEADER_BODY:
- body = AMQBody::shared_ptr(new AMQHeaderBody());
- break;
- case CONTENT_BODY:
- body = AMQBody::shared_ptr(new AMQContentBody());
- break;
- case HEARTBEAT_BODY:
- body = AMQBody::shared_ptr(new AMQHeartbeatBody());
- break;
- default:
- string msg("Unknown body type: ");
- msg += type;
- THROW_QPID_ERROR(FRAMING_ERROR, msg);
- }
- body->decode(buffer, bufSize);
-}
-
-std::ostream& qpid::framing::operator<<(std::ostream& out, const AMQFrame& t)
-{
- out << "Frame[channel=" << t.channel << "; ";
- if (t.body.get() == 0)
- out << "empty";
- else
- out << *t.body;
- out << "]";
- return out;
-}
-
diff --git a/Final/cpp/lib/common/framing/AMQFrame.h b/Final/cpp/lib/common/framing/AMQFrame.h
deleted file mode 100644
index d3c769087a..0000000000
--- a/Final/cpp/lib/common/framing/AMQFrame.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.
- *
- */
-/*#include <qpid/framing/amqp_methods.h>*/
-#include <amqp_types.h>
-#include <AMQBody.h>
-#include <AMQDataBlock.h>
-#include <AMQMethodBody.h>
-#include <AMQHeaderBody.h>
-#include <AMQContentBody.h>
-#include <AMQHeartbeatBody.h>
-#include <AMQP_MethodVersionMap.h>
-#include <AMQP_HighestVersion.h>
-#include <Buffer.h>
-
-#ifndef _AMQFrame_
-#define _AMQFrame_
-
-namespace qpid {
- namespace framing {
-
-
- class AMQFrame : virtual public AMQDataBlock
- {
- static AMQP_MethodVersionMap versionMap;
- qpid::framing::ProtocolVersion version;
-
- u_int16_t channel;
- u_int8_t type;//used if the body is decoded separately from the 'head'
- AMQBody::shared_ptr body;
- AMQBody::shared_ptr createMethodBody(Buffer& buffer);
-
- public:
- AMQFrame(qpid::framing::ProtocolVersion& _version = highestProtocolVersion);
- AMQFrame(qpid::framing::ProtocolVersion& _version, u_int16_t channel, AMQBody* body);
- AMQFrame(qpid::framing::ProtocolVersion& _version, u_int16_t channel, AMQBody::shared_ptr& body);
- virtual ~AMQFrame();
- virtual void encode(Buffer& buffer);
- virtual bool decode(Buffer& buffer);
- virtual u_int32_t size() const;
- u_int16_t getChannel();
- AMQBody::shared_ptr& getBody();
-
- u_int32_t decodeHead(Buffer& buffer);
- void decodeBody(Buffer& buffer, uint32_t size);
-
- friend std::ostream& operator<<(std::ostream& out, const AMQFrame& body);
- };
-
- }
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/AMQHeaderBody.cpp b/Final/cpp/lib/common/framing/AMQHeaderBody.cpp
deleted file mode 100644
index 3653073f29..0000000000
--- a/Final/cpp/lib/common/framing/AMQHeaderBody.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 <AMQHeaderBody.h>
-#include <QpidError.h>
-#include <BasicHeaderProperties.h>
-
-qpid::framing::AMQHeaderBody::AMQHeaderBody(int classId) : weight(0), contentSize(0){
- createProperties(classId);
-}
-
-qpid::framing::AMQHeaderBody::AMQHeaderBody() : properties(0), weight(0), contentSize(0){
-}
-
-qpid::framing::AMQHeaderBody::~AMQHeaderBody(){
- delete properties;
-}
-
-u_int32_t qpid::framing::AMQHeaderBody::size() const{
- return 12 + properties->size();
-}
-
-void qpid::framing::AMQHeaderBody::encode(Buffer& buffer) const {
- buffer.putShort(properties->classId());
- buffer.putShort(weight);
- buffer.putLongLong(contentSize);
- properties->encode(buffer);
-}
-
-void qpid::framing::AMQHeaderBody::decode(Buffer& buffer, u_int32_t bufSize){
- u_int16_t classId = buffer.getShort();
- weight = buffer.getShort();
- contentSize = buffer.getLongLong();
- createProperties(classId);
- properties->decode(buffer, bufSize - 12);
-}
-
-void qpid::framing::AMQHeaderBody::createProperties(int classId){
- switch(classId){
- case BASIC:
- properties = new qpid::framing::BasicHeaderProperties();
- break;
- default:
- THROW_QPID_ERROR(FRAMING_ERROR, "Unknown header class");
- }
-}
-
-void qpid::framing::AMQHeaderBody::print(std::ostream& out) const
-{
- out << "header (" << size() << " bytes)" << " content_size=" << getContentSize();
- const BasicHeaderProperties* props =
- dynamic_cast<const BasicHeaderProperties*>(getProperties());
- if (props) {
- out << ", message_id=" << props->getMessageId();
- out << ", delivery_mode=" << (int) props->getDeliveryMode();
- out << ", headers=" << const_cast<BasicHeaderProperties*>(props)->getHeaders();
- }
-}
diff --git a/Final/cpp/lib/common/framing/AMQHeaderBody.h b/Final/cpp/lib/common/framing/AMQHeaderBody.h
deleted file mode 100644
index 31cf7d575e..0000000000
--- a/Final/cpp/lib/common/framing/AMQHeaderBody.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.
- *
- */
-#include <amqp_types.h>
-#include <AMQBody.h>
-#include <Buffer.h>
-#include <HeaderProperties.h>
-
-#ifndef _AMQHeaderBody_
-#define _AMQHeaderBody_
-
-namespace qpid {
-namespace framing {
-
-class AMQHeaderBody : virtual public AMQBody
-{
- HeaderProperties* properties;
- u_int16_t weight;
- u_int64_t contentSize;
-
- void createProperties(int classId);
-public:
- typedef boost::shared_ptr<AMQHeaderBody> shared_ptr;
-
- AMQHeaderBody(int classId);
- AMQHeaderBody();
- inline u_int8_t type() const { return HEADER_BODY; }
- HeaderProperties* getProperties(){ return properties; }
- const HeaderProperties* getProperties() const { return properties; }
- inline u_int64_t getContentSize() const { return contentSize; }
- inline void setContentSize(u_int64_t _size) { contentSize = _size; }
- virtual ~AMQHeaderBody();
- virtual u_int32_t size() const;
- virtual void encode(Buffer& buffer) const;
- virtual void decode(Buffer& buffer, u_int32_t size);
- virtual void print(std::ostream& out) const;
-};
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/AMQHeartbeatBody.cpp b/Final/cpp/lib/common/framing/AMQHeartbeatBody.cpp
deleted file mode 100644
index 63f83a3d29..0000000000
--- a/Final/cpp/lib/common/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/Final/cpp/lib/common/framing/AMQHeartbeatBody.h b/Final/cpp/lib/common/framing/AMQHeartbeatBody.h
deleted file mode 100644
index a2315119e4..0000000000
--- a/Final/cpp/lib/common/framing/AMQHeartbeatBody.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.
- *
- */
-#include <amqp_types.h>
-#include <AMQBody.h>
-#include <Buffer.h>
-
-#ifndef _AMQHeartbeatBody_
-#define _AMQHeartbeatBody_
-
-namespace qpid {
-namespace framing {
-
-class AMQHeartbeatBody : virtual public AMQBody
-{
-public:
- typedef boost::shared_ptr<AMQHeartbeatBody> shared_ptr;
-
- virtual ~AMQHeartbeatBody();
- inline u_int32_t size() const { return 0; }
- inline u_int8_t type() const { return HEARTBEAT_BODY; }
- inline void encode(Buffer& ) const {}
- inline void decode(Buffer& , u_int32_t /*size*/) {}
- virtual void print(std::ostream& out) const;
-};
-
-}
-}
-
-#endif
diff --git a/Final/cpp/lib/common/framing/AMQMethodBody.cpp b/Final/cpp/lib/common/framing/AMQMethodBody.cpp
deleted file mode 100644
index 525310f3d4..0000000000
--- a/Final/cpp/lib/common/framing/AMQMethodBody.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 <AMQMethodBody.h>
-#include <QpidError.h>
-
-void qpid::framing::AMQMethodBody::encode(Buffer& buffer) const{
- buffer.putShort(amqpClassId());
- buffer.putShort(amqpMethodId());
- encodeContent(buffer);
-}
-
-void qpid::framing::AMQMethodBody::decode(Buffer& buffer, u_int32_t /*size*/){
- decodeContent(buffer);
-}
-
-bool qpid::framing::AMQMethodBody::match(AMQMethodBody* other) const{
- return other != 0 && other->amqpClassId() == amqpClassId() && other->amqpMethodId() == amqpMethodId();
-}
-
-void qpid::framing::AMQMethodBody::invoke(AMQP_ServerOperations& /*target*/, u_int16_t /*channel*/){
- THROW_QPID_ERROR(PROTOCOL_ERROR, "Method not supported by AMQP Server.");
-}
-
-
-std::ostream& qpid::framing::operator<<(std::ostream& out, const AMQMethodBody& m){
- m.print(out);
- return out;
-}
diff --git a/Final/cpp/lib/common/framing/AMQMethodBody.h b/Final/cpp/lib/common/framing/AMQMethodBody.h
deleted file mode 100644
index da25c7c545..0000000000
--- a/Final/cpp/lib/common/framing/AMQMethodBody.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.
- *
- */
-#include <iostream>
-#include <amqp_types.h>
-#include <AMQBody.h>
-#include <Buffer.h>
-#include <AMQP_ServerOperations.h>
-
-#ifndef _AMQMethodBody_
-#define _AMQMethodBody_
-
-namespace qpid {
-namespace framing {
-
-class AMQMethodBody : virtual public AMQBody
-{
-public:
- typedef boost::shared_ptr<AMQMethodBody> shared_ptr;
-
- ProtocolVersion version;
- inline u_int8_t type() const { return METHOD_BODY; }
- inline u_int32_t size() const { return 4 + bodySize(); }
- inline AMQMethodBody(u_int8_t major, u_int8_t minor) : version(major, minor) {}
- inline AMQMethodBody(ProtocolVersion version) : version(version) {}
- inline virtual ~AMQMethodBody() {}
- virtual void print(std::ostream& out) const = 0;
- virtual u_int16_t amqpMethodId() const = 0;
- virtual u_int16_t amqpClassId() const = 0;
- virtual void invoke(AMQP_ServerOperations& target, u_int16_t channel);
- virtual void encodeContent(Buffer& buffer) const = 0;
- virtual void decodeContent(Buffer& buffer) = 0;
- virtual u_int32_t bodySize() const = 0;
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer, u_int32_t size);
- bool match(AMQMethodBody* other) const;
-};
-
-std::ostream& operator<<(std::ostream& out, const AMQMethodBody& body);
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/BasicHeaderProperties.cpp b/Final/cpp/lib/common/framing/BasicHeaderProperties.cpp
deleted file mode 100644
index f673215536..0000000000
--- a/Final/cpp/lib/common/framing/BasicHeaderProperties.cpp
+++ /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.
- *
- */
-#include <BasicHeaderProperties.h>
-
-//TODO: This could be easily generated from the spec
-
-qpid::framing::BasicHeaderProperties::BasicHeaderProperties() : deliveryMode(0), priority(0), timestamp(0){}
-qpid::framing::BasicHeaderProperties::~BasicHeaderProperties(){}
-
-u_int32_t qpid::framing::BasicHeaderProperties::size() const{
- u_int32_t bytes = 2;//flags
- if(contentType.length() > 0) bytes += contentType.length() + 1;
- if(contentEncoding.length() > 0) bytes += contentEncoding.length() + 1;
- if(headers.count() > 0) bytes += headers.size();
- if(deliveryMode != 0) bytes += 1;
- if(priority != 0) bytes += 1;
- if(correlationId.length() > 0) bytes += correlationId.length() + 1;
- if(replyTo.length() > 0) bytes += replyTo.length() + 1;
- if(expiration.length() > 0) bytes += expiration.length() + 1;
- if(messageId.length() > 0) bytes += messageId.length() + 1;
- if(timestamp != 0) bytes += 8;
- if(type.length() > 0) bytes += type.length() + 1;
- if(userId.length() > 0) bytes += userId.length() + 1;
- if(appId.length() > 0) bytes += appId.length() + 1;
- if(clusterId.length() > 0) bytes += clusterId.length() + 1;
-
- return bytes;
-}
-
-void qpid::framing::BasicHeaderProperties::encode(qpid::framing::Buffer& buffer) const{
- u_int16_t flags = getFlags();
- buffer.putShort(flags);
-
- if(contentType.length() > 0) buffer.putShortString(contentType);
- if(contentEncoding.length() > 0) buffer.putShortString(contentEncoding);
- if(headers.count() > 0) buffer.putFieldTable(headers);
- if(deliveryMode != 0) buffer.putOctet(deliveryMode);
- if(priority != 0) buffer.putOctet(priority);
- if(correlationId.length() > 0) buffer.putShortString(correlationId);
- if(replyTo.length() > 0) buffer.putShortString(replyTo);
- if(expiration.length() > 0) buffer.putShortString(expiration);
- if(messageId.length() > 0) buffer.putShortString(messageId);
- if(timestamp != 0) buffer.putLongLong(timestamp);;
- if(type.length() > 0) buffer.putShortString(type);
- if(userId.length() > 0) buffer.putShortString(userId);
- if(appId.length() > 0) buffer.putShortString(appId);
- if(clusterId.length() > 0) buffer.putShortString(clusterId);
-}
-
-void qpid::framing::BasicHeaderProperties::decode(qpid::framing::Buffer& buffer, u_int32_t /*size*/){
- u_int16_t flags = buffer.getShort();
- if(flags & (1 << 15)) buffer.getShortString(contentType);
- if(flags & (1 << 14)) buffer.getShortString(contentEncoding);
- if(flags & (1 << 13)) buffer.getFieldTable(headers);
- if(flags & (1 << 12)) deliveryMode = buffer.getOctet();
- if(flags & (1 << 11)) priority = buffer.getOctet();
- if(flags & (1 << 10)) buffer.getShortString(correlationId);
- if(flags & (1 << 9)) buffer.getShortString(replyTo);
- if(flags & (1 << 8)) buffer.getShortString(expiration);
- if(flags & (1 << 7)) buffer.getShortString(messageId);
- if(flags & (1 << 6)) timestamp = buffer.getLongLong();
- if(flags & (1 << 5)) buffer.getShortString(type);
- if(flags & (1 << 4)) buffer.getShortString(userId);
- if(flags & (1 << 3)) buffer.getShortString(appId);
- if(flags & (1 << 2)) buffer.getShortString(clusterId);
-}
-
-u_int16_t qpid::framing::BasicHeaderProperties::getFlags() const{
- u_int16_t flags(0);
- if(contentType.length() > 0) flags |= (1 << 15);
- if(contentEncoding.length() > 0) flags |= (1 << 14);
- if(headers.count() > 0) flags |= (1 << 13);
- if(deliveryMode != 0) flags |= (1 << 12);
- if(priority != 0) flags |= (1 << 11);
- if(correlationId.length() > 0) flags |= (1 << 10);
- if(replyTo.length() > 0) flags |= (1 << 9);
- if(expiration.length() > 0) flags |= (1 << 8);
- if(messageId.length() > 0) flags |= (1 << 7);
- if(timestamp != 0) flags |= (1 << 6);
- if(type.length() > 0) flags |= (1 << 5);
- if(userId.length() > 0) flags |= (1 << 4);
- if(appId.length() > 0) flags |= (1 << 3);
- if(clusterId.length() > 0) flags |= (1 << 2);
- return flags;
-}
diff --git a/Final/cpp/lib/common/framing/BasicHeaderProperties.h b/Final/cpp/lib/common/framing/BasicHeaderProperties.h
deleted file mode 100644
index bcd81b4776..0000000000
--- a/Final/cpp/lib/common/framing/BasicHeaderProperties.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include <amqp_types.h>
-#include <Buffer.h>
-#include <FieldTable.h>
-#include <HeaderProperties.h>
-
-#ifndef _BasicHeaderProperties_
-#define _BasicHeaderProperties_
-
-namespace qpid {
-namespace framing {
- enum delivery_mode {TRANSIENT = 1, PERSISTENT = 2};
-
- //TODO: This could be easily generated from the spec
- class BasicHeaderProperties : public HeaderProperties
- {
- string contentType;
- string contentEncoding;
- FieldTable headers;
- u_int8_t deliveryMode;
- u_int8_t priority;
- string correlationId;
- string replyTo;
- string expiration;
- string messageId;
- u_int64_t timestamp;
- string type;
- string userId;
- string appId;
- string clusterId;
-
- u_int16_t getFlags() const;
-
- public:
- BasicHeaderProperties();
- virtual ~BasicHeaderProperties();
- virtual u_int32_t size() const;
- virtual void encode(Buffer& buffer) const;
- virtual void decode(Buffer& buffer, u_int32_t size);
-
- inline virtual u_int8_t classId() { return BASIC; }
-
- inline const string& getContentType() const { return contentType; }
- inline const string& getContentEncoding() const { return contentEncoding; }
- inline FieldTable& getHeaders() { return headers; }
- inline u_int8_t getDeliveryMode() const { return deliveryMode; }
- inline u_int8_t getPriority() const { return priority; }
- inline const string& getCorrelationId() const {return correlationId; }
- inline const string& getReplyTo() const { return replyTo; }
- inline const string& getExpiration() const { return expiration; }
- inline const string& getMessageId() const {return messageId; }
- inline u_int64_t getTimestamp() const { return timestamp; }
- inline const string& getType() const { return type; }
- inline const string& getUserId() const { return userId; }
- inline const string& getAppId() const { return appId; }
- inline const string& getClusterId() const { return clusterId; }
-
- void inline setContentType(const string& _type){ contentType = _type; }
- void inline setContentEncoding(const string& encoding){ contentEncoding = encoding; }
- void inline setHeaders(const FieldTable& _headers){ headers = _headers; }
- void inline setDeliveryMode(u_int8_t mode){ deliveryMode = mode; }
- void inline setPriority(u_int8_t _priority){ priority = _priority; }
- void inline setCorrelationId(const string& _correlationId){ correlationId = _correlationId; }
- void inline setReplyTo(const string& _replyTo){ replyTo = _replyTo;}
- void inline setExpiration(const string& _expiration){ expiration = _expiration; }
- void inline setMessageId(const string& _messageId){ messageId = _messageId; }
- void inline setTimestamp(u_int64_t _timestamp){ timestamp = _timestamp; }
- void inline setType(const string& _type){ type = _type; }
- void inline setUserId(const string& _userId){ userId = _userId; }
- void inline setAppId(const string& _appId){appId = _appId; }
- void inline setClusterId(const string& _clusterId){ clusterId = _clusterId; }
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/BodyHandler.cpp b/Final/cpp/lib/common/framing/BodyHandler.cpp
deleted file mode 100644
index 8ccfb222df..0000000000
--- a/Final/cpp/lib/common/framing/BodyHandler.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 <boost/shared_ptr.hpp>
-#include <BodyHandler.h>
-
-using namespace qpid::framing;
-using namespace boost;
-
-BodyHandler::~BodyHandler() {}
-
-void BodyHandler::handleBody(AMQBody::shared_ptr& body){
-
- switch(body->type())
- {
-
- case METHOD_BODY:
- handleMethod(dynamic_pointer_cast<AMQMethodBody, AMQBody>(body));
- break;
-
- case HEADER_BODY:
- handleHeader(dynamic_pointer_cast<AMQHeaderBody, AMQBody>(body));
- break;
-
- case CONTENT_BODY:
- handleContent(dynamic_pointer_cast<AMQContentBody, AMQBody>(body));
- break;
-
- case HEARTBEAT_BODY:
- handleHeartbeat(dynamic_pointer_cast<AMQHeartbeatBody, AMQBody>(body));
- break;
-
- default:
- throw UnknownBodyType(body->type());
- }
-
-}
diff --git a/Final/cpp/lib/common/framing/BodyHandler.h b/Final/cpp/lib/common/framing/BodyHandler.h
deleted file mode 100644
index 3923258d1c..0000000000
--- a/Final/cpp/lib/common/framing/BodyHandler.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.
- *
- */
-#include <string>
-
-#ifndef _BodyHandler_
-#define _BodyHandler_
-
-#include <AMQMethodBody.h>
-#include <AMQHeaderBody.h>
-#include <AMQContentBody.h>
-#include <AMQHeartbeatBody.h>
-
-namespace qpid {
-namespace framing {
-
- class BodyHandler{
- public:
- virtual ~BodyHandler();
- virtual void handleMethod(AMQMethodBody::shared_ptr body) = 0;
- virtual void handleHeader(AMQHeaderBody::shared_ptr body) = 0;
- virtual void handleContent(AMQContentBody::shared_ptr body) = 0;
- virtual void handleHeartbeat(AMQHeartbeatBody::shared_ptr body) = 0;
-
- void handleBody(AMQBody::shared_ptr& body);
- };
-
- class UnknownBodyType{
- public:
- const u_int16_t type;
- inline UnknownBodyType(u_int16_t _type) : type(_type){}
- };
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/Buffer.cpp b/Final/cpp/lib/common/framing/Buffer.cpp
deleted file mode 100644
index 43815c2f1d..0000000000
--- a/Final/cpp/lib/common/framing/Buffer.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 <Buffer.h>
-#include <FramingContent.h>
-#include <FieldTable.h>
-
-qpid::framing::Buffer::Buffer(u_int32_t _size) : size(_size), owner(true), position(0), limit(_size){
- data = new char[size];
-}
-
-qpid::framing::Buffer::Buffer(char* _data, u_int32_t _size) : size(_size), owner(false), data(_data), position(0), limit(_size){
-}
-
-qpid::framing::Buffer::~Buffer(){
- if(owner) delete[] data;
-}
-
-void qpid::framing::Buffer::flip(){
- limit = position;
- position = 0;
-}
-
-void qpid::framing::Buffer::clear(){
- limit = size;
- position = 0;
-}
-
-void qpid::framing::Buffer::compact(){
- u_int32_t p = limit - position;
- //copy p chars from position to 0
- memmove(data, data + position, p);
- limit = size;
- position = p;
-}
-
-void qpid::framing::Buffer::record(){
- r_position = position;
- r_limit = limit;
-}
-
-void qpid::framing::Buffer::restore(){
- position = r_position;
- limit = r_limit;
-}
-
-u_int32_t qpid::framing::Buffer::available(){
- return limit - position;
-}
-
-char* qpid::framing::Buffer::start(){
- return data + position;
-}
-
-void qpid::framing::Buffer::move(u_int32_t bytes){
- position += bytes;
-}
-
-void qpid::framing::Buffer::putOctet(u_int8_t i){
- data[position++] = i;
-}
-
-void qpid::framing::Buffer::putShort(u_int16_t i){
- u_int16_t b = i;
- data[position++] = (u_int8_t) (0xFF & (b >> 8));
- data[position++] = (u_int8_t) (0xFF & b);
-}
-
-void qpid::framing::Buffer::putLong(u_int32_t i){
- u_int32_t b = i;
- data[position++] = (u_int8_t) (0xFF & (b >> 24));
- data[position++] = (u_int8_t) (0xFF & (b >> 16));
- data[position++] = (u_int8_t) (0xFF & (b >> 8));
- data[position++] = (u_int8_t) (0xFF & b);
-}
-
-void qpid::framing::Buffer::putLongLong(u_int64_t i){
- u_int32_t hi = i >> 32;
- u_int32_t lo = i;
- putLong(hi);
- putLong(lo);
-}
-
-u_int8_t qpid::framing::Buffer::getOctet(){
- return (u_int8_t) data[position++];
-}
-
-u_int16_t qpid::framing::Buffer::getShort(){
- u_int16_t hi = (unsigned char) data[position++];
- hi = hi << 8;
- hi |= (unsigned char) data[position++];
- return hi;
-}
-
-u_int32_t qpid::framing::Buffer::getLong(){
- u_int32_t a = (unsigned char) data[position++];
- u_int32_t b = (unsigned char) data[position++];
- u_int32_t c = (unsigned char) data[position++];
- u_int32_t d = (unsigned char) data[position++];
- a = a << 24;
- a |= b << 16;
- a |= c << 8;
- a |= d;
- return a;
-}
-
-u_int64_t qpid::framing::Buffer::getLongLong(){
- u_int64_t hi = getLong();
- u_int64_t lo = getLong();
- hi = hi << 32;
- return hi | lo;
-}
-
-
-void qpid::framing::Buffer::putShortString(const string& s){
- u_int8_t len = s.length();
- putOctet(len);
- s.copy(data + position, len);
- position += len;
-}
-
-void qpid::framing::Buffer::putLongString(const string& s){
- u_int32_t len = s.length();
- putLong(len);
- s.copy(data + position, len);
- position += len;
-}
-
-void qpid::framing::Buffer::getShortString(string& s){
- u_int8_t len = getOctet();
- s.assign(data + position, len);
- position += len;
-}
-
-void qpid::framing::Buffer::getLongString(string& s){
- u_int32_t len = getLong();
- s.assign(data + position, len);
- position += len;
-}
-
-void qpid::framing::Buffer::putFieldTable(const FieldTable& t){
- t.encode(*this);
-}
-
-void qpid::framing::Buffer::getFieldTable(FieldTable& t){
- t.decode(*this);
-}
-
-void qpid::framing::Buffer::putContent(const Content& c){
- c.encode(*this);
-}
-
-void qpid::framing::Buffer::getContent(Content& c){
- c.decode(*this);
-}
-
-void qpid::framing::Buffer::putRawData(const string& s){
- u_int32_t len = s.length();
- s.copy(data + position, len);
- position += len;
-}
-
-void qpid::framing::Buffer::getRawData(string& s, u_int32_t len){
- s.assign(data + position, len);
- position += len;
-}
diff --git a/Final/cpp/lib/common/framing/Buffer.h b/Final/cpp/lib/common/framing/Buffer.h
deleted file mode 100644
index b07c2a2ced..0000000000
--- a/Final/cpp/lib/common/framing/Buffer.h
+++ /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 <amqp_types.h>
-
-#ifndef _Buffer_
-#define _Buffer_
-
-namespace qpid {
-namespace framing {
-
-class Content;
-class FieldTable;
-
-class Buffer
-{
- const u_int32_t size;
- const bool owner;//indicates whether the data is owned by this instance
- char* data;
- u_int32_t position;
- u_int32_t limit;
- u_int32_t r_position;
- u_int32_t r_limit;
-
-public:
-
- Buffer(u_int32_t size);
- Buffer(char* data, u_int32_t size);
- ~Buffer();
-
- void flip();
- void clear();
- void compact();
- void record();
- void restore();
- u_int32_t available();
- char* start();
- void move(u_int32_t bytes);
-
- void putOctet(u_int8_t i);
- void putShort(u_int16_t i);
- void putLong(u_int32_t i);
- void putLongLong(u_int64_t i);
-
- u_int8_t getOctet();
- u_int16_t getShort();
- u_int32_t getLong();
- u_int64_t getLongLong();
-
- void putShortString(const string& s);
- void putLongString(const string& s);
- void getShortString(string& s);
- void getLongString(string& s);
-
- void putFieldTable(const FieldTable& t);
- void getFieldTable(FieldTable& t);
-
- void putContent(const Content& c);
- void getContent(Content& c);
-
- void putRawData(const string& s);
- void getRawData(string& s, u_int32_t size);
-
-};
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/FieldTable.cpp b/Final/cpp/lib/common/framing/FieldTable.cpp
deleted file mode 100644
index cf16e87272..0000000000
--- a/Final/cpp/lib/common/framing/FieldTable.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 <FieldTable.h>
-#include <QpidError.h>
-#include <Buffer.h>
-#include <Value.h>
-#include <assert.h>
-
-namespace qpid {
-namespace framing {
-
-FieldTable::~FieldTable() {}
-
-u_int32_t FieldTable::size() const {
- u_int32_t len(4);
- for(ValueMap::const_iterator i = values.begin(); i != values.end(); ++i) {
- // 2 = shortstr_len_byyte + type_char_byte
- len += 2 + (i->first).size() + (i->second)->size();
- }
- 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.getMap().begin();
- if (i != t.getMap().end()) out << *i++;
- while (i != t.getMap().end())
- {
- out << "," << *i++;
- }
- return out << "}";
-}
-
-void FieldTable::setString(const std::string& name, const std::string& value){
- values[name] = ValuePtr(new StringValue(value));
-}
-
-void FieldTable::setInt(const std::string& name, int value){
- values[name] = ValuePtr(new IntegerValue(value));
-}
-
-void FieldTable::setTimestamp(const std::string& name, u_int64_t value){
- values[name] = ValuePtr(new TimeValue(value));
-}
-
-void FieldTable::setTable(const std::string& name, const FieldTable& value){
- values[name] = ValuePtr(new FieldTableValue(value));
-}
-
-namespace {
-template <class T> T default_value() { return T(); }
-template <> int default_value<int>() { return 0; }
-template <> u_int64_t default_value<u_int64_t>() { return 0; }
-}
-
-template <class T>
-T FieldTable::getValue(const std::string& name) const
-{
- ValueMap::const_iterator i = values.find(name);
- if (i == values.end()) return default_value<T>();
- const ValueOps<T> *vt = dynamic_cast<const ValueOps<T>*>(i->second.get());
- return vt->getValue();
-}
-
-std::string FieldTable::getString(const std::string& name) const {
- return getValue<std::string>(name);
-}
-
-int FieldTable::getInt(const std::string& name) const {
- return getValue<int>(name);
-}
-
-u_int64_t FieldTable::getTimestamp(const std::string& name) const {
- return getValue<u_int64_t>(name);
-}
-
-void FieldTable::getTable(const std::string& name, FieldTable& value) const {
- value = getValue<FieldTable>(name);
-}
-
-void FieldTable::encode(Buffer& buffer) const{
- buffer.putLong(size() - 4);
- for (ValueMap::const_iterator i = values.begin(); i!=values.end(); ++i) {
- buffer.putShortString(i->first);
- buffer.putOctet(i->second->getType());
- i->second->encode(buffer);
- }
-}
-
-void FieldTable::decode(Buffer& buffer){
- u_int32_t len = buffer.getLong();
- u_int32_t available = buffer.available();
- if (available < len)
- THROW_QPID_ERROR(FRAMING_ERROR, "Not enough data for field table.");
- u_int32_t leftover = available - len;
- while(buffer.available() > leftover){
- std::string name;
- buffer.getShortString(name);
- std::auto_ptr<Value> value(Value::decode_value(buffer));
- values[name] = ValuePtr(value.release());
- }
-}
-
-
-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)
-{
- values.erase(values.find(name));
-}
-
-}
-}
diff --git a/Final/cpp/lib/common/framing/FieldTable.h b/Final/cpp/lib/common/framing/FieldTable.h
deleted file mode 100644
index 6fa10ab108..0000000000
--- a/Final/cpp/lib/common/framing/FieldTable.h
+++ /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 <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 Value;
-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<Value> ValuePtr;
- typedef std::map<std::string, ValuePtr> ValueMap;
-
- ~FieldTable();
- u_int32_t size() const;
- int count() const;
- void setString(const std::string& name, const std::string& value);
- void setInt(const std::string& name, int value);
- void setTimestamp(const std::string& name, u_int64_t value);
- void setTable(const std::string& name, const FieldTable& value);
- //void setDecimal(string& name, xxx& value);
- std::string getString(const std::string& name) const;
- int getInt(const std::string& name) const;
- u_int64_t getTimestamp(const std::string& name) const;
- void getTable(const std::string& name, FieldTable& value) const;
- //void getDecimal(string& name, xxx& value);
- void erase(const std::string& name);
-
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer);
-
- bool operator==(const FieldTable& other) const;
-
- // TODO aconway 2006-09-26: Yeuch! Rework FieldTable to have
- // a map-like interface.
- const ValueMap& getMap() const { return values; }
- ValueMap& getMap() { return values; }
-
- private:
- friend std::ostream& operator<<(std::ostream& out, const FieldTable& body);
- ValueMap values;
- template<class T> T getValue(const std::string& name) const;
-};
-
-class FieldNotFoundException{};
-class UnknownFieldName : public FieldNotFoundException{};
-class IncorrectFieldType : public FieldNotFoundException{};
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/FramingContent.cpp b/Final/cpp/lib/common/framing/FramingContent.cpp
deleted file mode 100644
index e5f50b5075..0000000000
--- a/Final/cpp/lib/common/framing/FramingContent.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 <Buffer.h>
-#include <FramingContent.h>
-
-namespace qpid
-{
-namespace framing
-{
-
-Content::~Content() {}
-
-void Content::encode(Buffer&) const
-{
-}
-
-void Content::decode(Buffer&)
-{
-}
-
-
-} // namespace framing
-} // namespace qpid
diff --git a/Final/cpp/lib/common/framing/FramingContent.h b/Final/cpp/lib/common/framing/FramingContent.h
deleted file mode 100644
index 1ab3ba468b..0000000000
--- a/Final/cpp/lib/common/framing/FramingContent.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 _Content_
-#define _Content_
-
-namespace qpid
-{
-namespace framing
-{
-
-/*
- * TODO: New Content class required for AMQP 0-9. This is a stub only.
- */
-class Content
-{
- public:
- ~Content();
-
- void encode(Buffer& buffer) const;
- void decode(Buffer& buffer);
-
-};
-
-} // namespace framing
-} // namespace qpid
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/HeaderProperties.h b/Final/cpp/lib/common/framing/HeaderProperties.h
deleted file mode 100644
index 7a8c65549d..0000000000
--- a/Final/cpp/lib/common/framing/HeaderProperties.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 <Buffer.h>
-
-#ifndef _HeaderProperties_
-#define _HeaderProperties_
-
-namespace qpid {
-namespace framing {
-
- enum header_classes{BASIC = 60};
-
- class HeaderProperties
- {
-
- public:
- inline virtual ~HeaderProperties(){}
- virtual u_int8_t classId() = 0;
- virtual u_int32_t size() const = 0;
- virtual void encode(Buffer& buffer) const = 0;
- virtual void decode(Buffer& buffer, u_int32_t size) = 0;
- };
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/InitiationHandler.cpp b/Final/cpp/lib/common/framing/InitiationHandler.cpp
deleted file mode 100644
index dd92c9859b..0000000000
--- a/Final/cpp/lib/common/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/Final/cpp/lib/common/framing/InitiationHandler.h b/Final/cpp/lib/common/framing/InitiationHandler.h
deleted file mode 100644
index d94fc58d2c..0000000000
--- a/Final/cpp/lib/common/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(ProtocolInitiation* header) = 0;
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/InputHandler.h b/Final/cpp/lib/common/framing/InputHandler.h
deleted file mode 100644
index 4e2d4bcc9b..0000000000
--- a/Final/cpp/lib/common/framing/InputHandler.h
+++ /dev/null
@@ -1,39 +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 <AMQFrame.h>
-#include <boost/noncopyable.hpp>
-
-namespace qpid {
-namespace framing {
-
-class InputHandler : private boost::noncopyable {
- public:
- virtual ~InputHandler() {}
- virtual void received(AMQFrame* frame) = 0;
-};
-
-}}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/OutputHandler.h b/Final/cpp/lib/common/framing/OutputHandler.h
deleted file mode 100644
index 2e01e34df2..0000000000
--- a/Final/cpp/lib/common/framing/OutputHandler.h
+++ /dev/null
@@ -1,39 +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 <AMQFrame.h>
-
-namespace qpid {
-namespace framing {
-
-class OutputHandler : private boost::noncopyable {
- public:
- virtual ~OutputHandler() {}
- virtual void send(AMQFrame* frame) = 0;
-};
-
-}}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/ProtocolInitiation.cpp b/Final/cpp/lib/common/framing/ProtocolInitiation.cpp
deleted file mode 100644
index 471f736a7d..0000000000
--- a/Final/cpp/lib/common/framing/ProtocolInitiation.cpp
+++ /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 <ProtocolInitiation.h>
-
-qpid::framing::ProtocolInitiation::ProtocolInitiation(){}
-
-qpid::framing::ProtocolInitiation::ProtocolInitiation(u_int8_t _major, u_int8_t _minor) : version(_major, _minor) {}
-
-qpid::framing::ProtocolInitiation::ProtocolInitiation(const qpid::framing::ProtocolVersion& p) : version(p) {}
-
-qpid::framing::ProtocolInitiation::~ProtocolInitiation(){}
-
-void qpid::framing::ProtocolInitiation::encode(Buffer& buffer){
- 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 qpid::framing::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;
- }
-}
-
-//TODO: this should prbably be generated from the spec at some point to keep the version numbers up to date
diff --git a/Final/cpp/lib/common/framing/ProtocolInitiation.h b/Final/cpp/lib/common/framing/ProtocolInitiation.h
deleted file mode 100644
index 003c3bba81..0000000000
--- a/Final/cpp/lib/common/framing/ProtocolInitiation.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.
- *
- */
-#include <amqp_types.h>
-#include <Buffer.h>
-#include <AMQDataBlock.h>
-#include <ProtocolVersion.h>
-
-#ifndef _ProtocolInitiation_
-#define _ProtocolInitiation_
-
-namespace qpid {
-namespace framing {
-
-class ProtocolInitiation : virtual public AMQDataBlock
-{
-private:
- ProtocolVersion version;
-
-public:
- ProtocolInitiation();
- ProtocolInitiation(u_int8_t major, u_int8_t minor);
- ProtocolInitiation(const ProtocolVersion& p);
- virtual ~ProtocolInitiation();
- virtual void encode(Buffer& buffer);
- virtual bool decode(Buffer& buffer);
- inline virtual u_int32_t size() const { return 8; }
- 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; }
-};
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/framing/ProtocolVersion.cpp b/Final/cpp/lib/common/framing/ProtocolVersion.cpp
deleted file mode 100644
index 69ff89ec32..0000000000
--- a/Final/cpp/lib/common/framing/ProtocolVersion.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 <ProtocolVersion.h>
-#include <sstream>
-
-using namespace qpid::framing;
-
-ProtocolVersion::ProtocolVersion() {}
-
-ProtocolVersion::ProtocolVersion(u_int8_t _major, u_int8_t _minor) :
- major_(_major),
- minor_(_minor)
-{}
-
-ProtocolVersion::ProtocolVersion(const ProtocolVersion::ProtocolVersion& p):
- major_(p.major_),
- minor_(p.minor_)
-{}
-
-ProtocolVersion::~ProtocolVersion()
-{}
-
-bool ProtocolVersion::equals(u_int8_t _major, u_int8_t _minor) const
-{
- return major_ == _major && minor_ == _minor;
-}
-
-bool ProtocolVersion::equals(const ProtocolVersion::ProtocolVersion& p) const
-{
- return major_ == p.major_ && minor_ == p.minor_;
-}
-
-const std::string ProtocolVersion::toString() const
-{
- std::stringstream ss;
- ss << major_ << "-" << minor_;
- return ss.str();
-}
-
-ProtocolVersion::ProtocolVersion ProtocolVersion::operator=(const ProtocolVersion& p)
-{
- major_ = p.major_;
- minor_ = p.minor_;
- return *this;
-}
-
diff --git a/Final/cpp/lib/common/framing/ProtocolVersion.h b/Final/cpp/lib/common/framing/ProtocolVersion.h
deleted file mode 100644
index 331cf53555..0000000000
--- a/Final/cpp/lib/common/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:
- u_int8_t major_;
- u_int8_t minor_;
-
-public:
- ProtocolVersion();
- ProtocolVersion(u_int8_t _major, u_int8_t _minor);
- ProtocolVersion(const ProtocolVersion& p);
- virtual ~ProtocolVersion();
-
- inline u_int8_t getMajor() const { return major_; }
- inline void setMajor(u_int8_t major) { major_ = major; }
- inline u_int8_t getMinor() const { return minor_; }
- inline void setMinor(u_int8_t minor) { minor_ = minor; }
- virtual bool equals(u_int8_t _major, u_int8_t _minor) const;
- virtual bool equals(const ProtocolVersion& p) const;
- virtual const std::string toString() const;
- ProtocolVersion operator=(const ProtocolVersion& p);
-};
-
-} // namespace framing
-} // namespace qpid
-
-
-#endif // ifndef _ProtocolVersion_
diff --git a/Final/cpp/lib/common/framing/ProtocolVersionException.cpp b/Final/cpp/lib/common/framing/ProtocolVersionException.cpp
deleted file mode 100644
index 8249a88f4b..0000000000
--- a/Final/cpp/lib/common/framing/ProtocolVersionException.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 <ProtocolVersionException.h>
-#include <sstream>
-
-using namespace qpid::framing;
-
-ProtocolVersionException::ProtocolVersionException() throw ()
-{
-}
-
-ProtocolVersionException::ProtocolVersionException(const std::string& str) throw () : Exception(str)
-{
-}
-
-ProtocolVersionException::ProtocolVersionException(const char* str) throw () : Exception(str)
-{
-}
-
-ProtocolVersionException::ProtocolVersionException(const ProtocolVersion& versionFound_, const std::string& str) throw () : Exception(str)
-
-{
- versionFound = versionFound_;
-}
-
-ProtocolVersionException::ProtocolVersionException(const ProtocolVersion& versionFound_, const char* str) throw () : Exception(str)
-
-{
- versionFound = versionFound_;
-}
-
-ProtocolVersionException::~ProtocolVersionException() throw ()
-{
-}
-
-const char* ProtocolVersionException::what() const throw()
-{
- std::stringstream ss;
- ss << "ProtocolVersionException: AMQP Version " << versionFound.toString() << " found: " << whatStr;
- return ss.str().c_str();
-}
-
-std::string ProtocolVersionException::toString() const throw()
-{
- std::stringstream ss;
- ss << "ProtocolVersionException: AMQP Version " << versionFound.toString() << " found: " << whatStr;
- return ss.str();
-}
diff --git a/Final/cpp/lib/common/framing/ProtocolVersionException.h b/Final/cpp/lib/common/framing/ProtocolVersionException.h
deleted file mode 100644
index 4494d87064..0000000000
--- a/Final/cpp/lib/common/framing/ProtocolVersionException.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 _ProtocolVersionException_
-#define _ProtocolVersionException_
-
-#include <Exception.h>
-#include <ProtocolVersion.h>
-#include <string>
-#include <vector>
-
-namespace qpid
-{
-namespace framing
-{
-
-class ProtocolVersionException : virtual public qpid::Exception
-{
-protected:
- ProtocolVersion versionFound;
-
-public:
- ProtocolVersionException() throw ();
- ProtocolVersionException(const std::string& str) throw ();
- ProtocolVersionException(const char* str) throw ();
- ProtocolVersionException(const ProtocolVersion& versionFound_, const std::string& str) throw ();
- ProtocolVersionException(const ProtocolVersion& versionFound_, const char* str) throw ();
- virtual ~ProtocolVersionException() throw ();
-
- virtual const char* what() const throw();
- virtual std::string toString() const throw();
-}; // class ProtocolVersionException
-
-} // namespace framing
-} // namespace qpid
-
-#endif //ifndef _ProtocolVersionException_
diff --git a/Final/cpp/lib/common/framing/Value.cpp b/Final/cpp/lib/common/framing/Value.cpp
deleted file mode 100644
index 9b1f3bbc94..0000000000
--- a/Final/cpp/lib/common/framing/Value.cpp
+++ /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.
- *
- */
-#include <Value.h>
-#include <Buffer.h>
-#include <FieldTable.h>
-#include <QpidError.h>
-#include <sstream>
-
-namespace qpid {
-namespace framing {
-
-Value::~Value() {}
-
-void StringValue::encode(Buffer& buffer){
- buffer.putLongString(value);
-}
-void StringValue::decode(Buffer& buffer){
- buffer.getLongString(value);
-}
-
-void IntegerValue::encode(Buffer& buffer){
- buffer.putLong((u_int32_t) value);
-}
-void IntegerValue::decode(Buffer& buffer){
- value = buffer.getLong();
-}
-
-void TimeValue::encode(Buffer& buffer){
- buffer.putLongLong(value);
-}
-void TimeValue::decode(Buffer& buffer){
- value = buffer.getLongLong();
-}
-
-void DecimalValue::encode(Buffer& buffer){
- buffer.putOctet(value.decimals);
- buffer.putLong(value.value);
-}
-void DecimalValue::decode(Buffer& buffer){
- value = Decimal(buffer.getLong(), buffer.getOctet());
-}
-
-void FieldTableValue::encode(Buffer& buffer){
- buffer.putFieldTable(value);
-}
-void FieldTableValue::decode(Buffer& buffer){
- buffer.getFieldTable(value);
-}
-
-std::auto_ptr<Value> Value::decode_value(Buffer& buffer)
-{
- std::auto_ptr<Value> value;
- u_int8_t type = buffer.getOctet();
- switch(type){
- case 'S':
- value.reset(new StringValue());
- break;
- case 'I':
- value.reset(new IntegerValue());
- break;
- case 'D':
- value.reset(new DecimalValue());
- break;
- case 'T':
- value.reset(new TimeValue());
- break;
- case 'F':
- value.reset(new FieldTableValue());
- break;
-
- //non-standard types, introduced in java client for JMS compliance
- case 'x':
- value.reset(new BinaryValue());
- break;
- default:
- std::stringstream out;
- out << "Unknown field table value type: " << type;
- THROW_QPID_ERROR(FRAMING_ERROR, out.str());
- }
- value->decode(buffer);
- return value;
-}
-
-EmptyValue::~EmptyValue() {}
-
-void EmptyValue::print(std::ostream& out) const
-{
- out << "<empty field value>";
-}
-
-std::ostream& operator<<(std::ostream& out, const Value& v) {
- v.print(out);
- return out;
-}
-
-std::ostream& operator<<(std::ostream& out, const Decimal& d)
-{
- return out << "Decimal(" << d.value << "," << d.decimals << ")";
-}
-
-}}
-
-
-
diff --git a/Final/cpp/lib/common/framing/Value.h b/Final/cpp/lib/common/framing/Value.h
deleted file mode 100644
index e7ae865a70..0000000000
--- a/Final/cpp/lib/common/framing/Value.h
+++ /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 <iostream>
-#include <vector>
-#include <amqp_types.h>
-#include <FieldTable.h>
-
-#ifndef _Value_
-#define _Value_
-
-namespace qpid {
-namespace framing {
-
-class Buffer;
-
-/**
- * Represents a decimal value.
- * No arithmetic functionality for now, we only care about encoding/decoding.
- */
-struct Decimal {
- u_int32_t value;
- u_int8_t decimals;
-
- Decimal(u_int32_t value_=0, u_int8_t decimals_=0) : value(value_), decimals(decimals_) {}
- bool operator==(const Decimal& d) const {
- return decimals == d.decimals && value == d.value;
- }
- bool operator!=(const Decimal& d) const { return !(*this == d); }
-};
-
-std::ostream& operator<<(std::ostream& out, const Decimal& d);
-
-/**
- * Polymorpic base class for values.
- */
-class Value {
- public:
- virtual ~Value();
- virtual u_int32_t size() const = 0;
- virtual char getType() const = 0;
- virtual void encode(Buffer& buffer) = 0;
- virtual void decode(Buffer& buffer) = 0;
- virtual bool operator==(const Value&) const = 0;
- bool operator!=(const Value& v) const { return !(*this == v); }
- virtual void print(std::ostream& out) const = 0;
-
- /** Create a new value by decoding from the buffer */
- static std::auto_ptr<Value> decode_value(Buffer& buffer);
-};
-
-std::ostream& operator<<(std::ostream& out, const Value& d);
-
-
-/**
- * Template for common operations on Value sub-classes.
- */
-template <class T>
-class ValueOps : public Value
-{
- protected:
- T value;
- public:
- ValueOps() {}
- ValueOps(const T& v) : value(v) {}
- const T& getValue() const { return value; }
- T& getValue() { return value; }
-
- virtual bool operator==(const Value& v) const {
- const ValueOps<T>* vo = dynamic_cast<const ValueOps<T>*>(&v);
- if (vo == 0) return false;
- else return value == vo->value;
- }
-
- void print(std::ostream& out) const { out << value; }
-};
-
-
-class StringValue : public ValueOps<std::string> {
- public:
- StringValue(const std::string& v) : ValueOps<std::string>(v) {}
- StringValue() {}
- virtual u_int32_t size() const { return 4 + value.length(); }
- virtual char getType() const { return 'S'; }
- virtual void encode(Buffer& buffer);
- virtual void decode(Buffer& buffer);
-};
-
-class IntegerValue : public ValueOps<int> {
- public:
- IntegerValue(int v) : ValueOps<int>(v) {}
- IntegerValue(){}
- virtual u_int32_t size() const { return 4; }
- virtual char getType() const { return 'I'; }
- virtual void encode(Buffer& buffer);
- virtual void decode(Buffer& buffer);
-};
-
-class TimeValue : public ValueOps<u_int64_t> {
- public:
- TimeValue(u_int64_t v) : ValueOps<u_int64_t>(v){}
- TimeValue(){}
- virtual u_int32_t size() const { return 8; }
- virtual char getType() const { return 'T'; }
- virtual void encode(Buffer& buffer);
- virtual void decode(Buffer& buffer);
-};
-
-class DecimalValue : public ValueOps<Decimal> {
- public:
- DecimalValue(const Decimal& d) : ValueOps<Decimal>(d) {}
- DecimalValue(u_int32_t value_=0, u_int8_t decimals_=0) :
- ValueOps<Decimal>(Decimal(value_, decimals_)){}
- virtual u_int32_t size() const { return 5; }
- virtual char getType() const { return 'D'; }
- virtual void encode(Buffer& buffer);
- virtual void decode(Buffer& buffer);
-};
-
-
-class FieldTableValue : public ValueOps<FieldTable> {
- public:
- FieldTableValue(const FieldTable& v) : ValueOps<FieldTable>(v){}
- FieldTableValue(){}
- virtual u_int32_t size() const { return 4 + value.size(); }
- virtual char getType() const { return 'F'; }
- virtual void encode(Buffer& buffer);
- virtual void decode(Buffer& buffer);
-};
-
-class EmptyValue : public Value {
- public:
- ~EmptyValue();
- virtual u_int32_t size() const { return 0; }
- virtual char getType() const { return 0; }
- virtual void encode(Buffer& ) {}
- virtual void decode(Buffer& ) {}
- virtual bool operator==(const Value& v) const {
- return dynamic_cast<const EmptyValue*>(&v);
- }
- virtual void print(std::ostream& out) const;
-};
-
-//non-standard types, introduced in java client for JMS compliance
-class BinaryValue : public StringValue {
- public:
- BinaryValue(const std::string& v) : StringValue(v) {}
- BinaryValue() {}
- virtual char getType() const { return 'x'; }
-};
-
-}} // qpid::framing
-
-#endif
diff --git a/Final/cpp/lib/common/framing/amqp_framing.h b/Final/cpp/lib/common/framing/amqp_framing.h
deleted file mode 100644
index 62f87352f8..0000000000
--- a/Final/cpp/lib/common/framing/amqp_framing.h
+++ /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 <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 <AMQP_MethodVersionMap.h>
-#include <InputHandler.h>
-#include <OutputHandler.h>
-#include <InitiationHandler.h>
-#include <ProtocolInitiation.h>
-#include <BasicHeaderProperties.h>
-#include <ProtocolVersion.h>
-#include <ProtocolVersionException.h>
diff --git a/Final/cpp/lib/common/framing/amqp_types.h b/Final/cpp/lib/common/framing/amqp_types.h
deleted file mode 100644
index 3d8e9632c0..0000000000
--- a/Final/cpp/lib/common/framing/amqp_types.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.
- *
- */
-#include <string>
-#ifdef _WINDOWS
-#include "windows.h"
-typedef unsigned char u_int8_t;
-typedef unsigned short u_int16_t;
-typedef unsigned int u_int32_t;
-typedef unsigned __int64 u_int64_t;
-#endif
-#ifndef _WINDOWS
-#include "stdint.h"
-#endif
-
-#ifndef AMQP_TYPES_H
-#define AMQP_TYPES_H
-
-namespace qpid
-{
-namespace framing
-{
-
-using std::string;
-
-}
-}
-#endif
diff --git a/Final/cpp/lib/common/sys/Acceptor.h b/Final/cpp/lib/common/sys/Acceptor.h
deleted file mode 100644
index e6bc27a593..0000000000
--- a/Final/cpp/lib/common/sys/Acceptor.h
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef _sys_Acceptor_h
-#define _sys_Acceptor_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>
-#include <SharedObject.h>
-
-namespace qpid {
-namespace sys {
-
-class SessionHandlerFactory;
-
-class Acceptor : public qpid::SharedObject<Acceptor>
-{
- public:
- static Acceptor::shared_ptr create(int16_t port, int backlog, int threads, bool trace = false);
- virtual ~Acceptor() = 0;
- virtual int16_t getPort() const = 0;
- virtual void run(qpid::sys::SessionHandlerFactory* factory) = 0;
- virtual void shutdown() = 0;
-};
-
-}}
-
-
-
-#endif /*!_sys_Acceptor_h*/
diff --git a/Final/cpp/lib/common/sys/AtomicCount.h b/Final/cpp/lib/common/sys/AtomicCount.h
deleted file mode 100644
index b3d099192f..0000000000
--- a/Final/cpp/lib/common/sys/AtomicCount.h
+++ /dev/null
@@ -1,74 +0,0 @@
-#ifndef _posix_AtomicCount_h
-#define _posix_AtomicCount_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/detail/atomic_count.hpp>
-#include <boost/noncopyable.hpp>
-
-namespace qpid {
-namespace sys {
-
-/**
- * Atomic counter.
- */
-class AtomicCount : boost::noncopyable {
- public:
- class ScopedDecrement : boost::noncopyable {
- public:
- /** Decrement counter in constructor and increment in destructor. */
- ScopedDecrement(AtomicCount& c) : count(c) { value = --count; }
- ~ScopedDecrement() { ++count; }
- /** Return the value returned by the decrement. */
- operator long() { return value; }
- private:
- AtomicCount& count;
- long value;
- };
-
- class ScopedIncrement : boost::noncopyable {
- public:
- /** Increment counter in constructor and increment in destructor. */
- ScopedIncrement(AtomicCount& c) : count(c) { ++count; }
- ~ScopedIncrement() { --count; }
- private:
- AtomicCount& count;
- };
-
- 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/Final/cpp/lib/common/sys/Module.h b/Final/cpp/lib/common/sys/Module.h
deleted file mode 100644
index 64ed309afb..0000000000
--- a/Final/cpp/lib/common/sys/Module.h
+++ /dev/null
@@ -1,163 +0,0 @@
-#ifndef _sys_Module_h
-#define _sys_Module_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>
-#include <QpidError.h>
-
-namespace qpid {
-namespace sys {
-#if USE_APR
-#include <apr_dso.h>
- typedef apr_dso_handle_t* dso_handle_t;
-#else
- typedef void* dso_handle_t;
-#endif
-
- template <class T> class Module : private boost::noncopyable
- {
- typedef T* create_t();
- typedef void destroy_t(T*);
-
- dso_handle_t handle;
- destroy_t* destroy;
- T* ptr;
-
- void load(const std::string& name);
- void unload();
- void* getSymbol(const std::string& name);
-
- public:
- Module(const std::string& name);
- T* operator->();
- T* get();
- ~Module() throw();
- };
-
-}
-}
-
-using namespace qpid::sys;
-
-template <class T> Module<T>::Module(const std::string& module) : destroy(0), ptr(0)
-{
- load(module);
- //TODO: need a better strategy for symbol names to allow multiple
- //modules to be loaded without clashes...
-
- //Note: need the double cast to avoid errors in casting from void* to function pointer with -pedantic
- create_t* create = reinterpret_cast<create_t*>(reinterpret_cast<intptr_t>(getSymbol("create")));
- destroy = reinterpret_cast<destroy_t*>(reinterpret_cast<intptr_t>(getSymbol("destroy")));
- ptr = create();
-}
-
-template <class T> T* Module<T>::operator->()
-{
- return ptr;
-}
-
-template <class T> T* Module<T>::get()
-{
- return ptr;
-}
-
-template <class T> Module<T>::~Module() throw()
-{
- try {
- if (handle && ptr) {
- destroy(ptr);
- }
- if (handle) unload();
- } catch (std::exception& e) {
- std::cout << "Error while destroying module: " << e.what() << std::endl;
- }
- destroy = 0;
- handle = 0;
- ptr = 0;
-}
-
-// APR ================================================================
-#if USE_APR
-
-#include <apr/APRBase.h>
-#include <apr/APRPool.h>
-
-template <class T> void Module<T>::load(const std::string& name)
-{
- apr_pool_t* pool = APRPool::get();
- CHECK_APR_SUCCESS(apr_dso_load(&handle, name.c_str(), pool));
- APRPool::free(pool);
-}
-
-template <class T> void Module<T>::unload()
-{
- CHECK_APR_SUCCESS(apr_dso_unload(handle));
-}
-
-template <class T> void* Module<T>::getSymbol(const std::string& name)
-{
- apr_dso_handle_sym_t symbol;
- CHECK_APR_SUCCESS(apr_dso_sym(&symbol, handle, name.c_str()));
- return (void*) symbol;
-}
-
-// POSIX================================================================
-#else
-
-#include <dlfcn.h>
-
-template <class T> void Module<T>::load(const std::string& name)
-{
- dlerror();
- handle = dlopen(name.c_str(), RTLD_NOW);
- const char* error = dlerror();
- if (error) {
- THROW_QPID_ERROR(INTERNAL_ERROR, error);
- }
-}
-
-template <class T> void Module<T>::unload()
-{
- dlerror();
- dlclose(handle);
- const char* error = dlerror();
- if (error) {
- THROW_QPID_ERROR(INTERNAL_ERROR, error);
- }
-}
-
-template <class T> void* Module<T>::getSymbol(const std::string& name)
-{
- dlerror();
- void* sym = dlsym(handle, name.c_str());
- const char* error = dlerror();
- if (error) {
- THROW_QPID_ERROR(INTERNAL_ERROR, error);
- }
- return sym;
-}
-
-#endif //if USE_APR
-
-#endif //ifndef _sys_Module_h
-
diff --git a/Final/cpp/lib/common/sys/Monitor.h b/Final/cpp/lib/common/sys/Monitor.h
deleted file mode 100644
index c615a97aa3..0000000000
--- a/Final/cpp/lib/common/sys/Monitor.h
+++ /dev/null
@@ -1,129 +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 <sys/errno.h>
-#include <boost/noncopyable.hpp>
-#include <sys/Mutex.h>
-#include <sys/Time.h>
-
-#ifdef USE_APR
-# include <apr_thread_cond.h>
-#endif
-
-namespace qpid {
-namespace sys {
-
-/**
- * A monitor is a condition variable and a mutex
- */
-class Monitor : public Mutex
-{
- public:
- inline Monitor();
- inline ~Monitor();
- inline void wait();
- inline bool wait(const Time& absoluteTime);
- inline void notify();
- inline void notifyAll();
-
- private:
-#ifdef USE_APR
- apr_thread_cond_t* condition;
-#else
- pthread_cond_t condition;
-#endif
-};
-
-
-// APR ================================================================
-#ifdef USE_APR
-
-Monitor::Monitor() {
- apr_pool_t* pool = APRPool::get();
- CHECK_APR_SUCCESS(apr_thread_cond_create(&condition, pool));
- APRPool::free(pool);
-}
-
-Monitor::~Monitor() {
- CHECK_APR_SUCCESS(apr_thread_cond_destroy(condition));
-}
-
-void Monitor::wait() {
- CHECK_APR_SUCCESS(apr_thread_cond_wait(condition, mutex));
-}
-
-bool Monitor::wait(const Time& absoluteTime){
- // APR uses microseconds.
- apr_status_t status =
- apr_thread_cond_timedwait(condition, mutex, absoluteTime/TIME_USEC);
- if(status != APR_TIMEUP) CHECK_APR_SUCCESS(status);
- return status == 0;
-}
-
-void Monitor::notify(){
- CHECK_APR_SUCCESS(apr_thread_cond_signal(condition));
-}
-
-void Monitor::notifyAll(){
- CHECK_APR_SUCCESS(apr_thread_cond_broadcast(condition));
-}
-
-#else
-// POSIX ================================================================
-
-Monitor::Monitor() {
- QPID_POSIX_THROW_IF(pthread_cond_init(&condition, 0));
-}
-
-Monitor::~Monitor() {
- QPID_POSIX_THROW_IF(pthread_cond_destroy(&condition));
-}
-
-void Monitor::wait() {
- QPID_POSIX_THROW_IF(pthread_cond_wait(&condition, &mutex));
-}
-
-bool Monitor::wait(const Time& absoluteTime){
- struct timespec ts;
- toTimespec(ts, absoluteTime);
- int status = pthread_cond_timedwait(&condition, &mutex, &ts);
- if (status != 0) {
- if (status == ETIMEDOUT) return false;
- throw QPID_POSIX_ERROR(status);
- }
- return true;
-}
-
-void Monitor::notify(){
- QPID_POSIX_THROW_IF(pthread_cond_signal(&condition));
-}
-
-void Monitor::notifyAll(){
- QPID_POSIX_THROW_IF(pthread_cond_broadcast(&condition));
-}
-#endif /*USE_APR*/
-
-
-}}
-#endif /*!_sys_Monitor_h*/
diff --git a/Final/cpp/lib/common/sys/Mutex.h b/Final/cpp/lib/common/sys/Mutex.h
deleted file mode 100644
index ae1d6369af..0000000000
--- a/Final/cpp/lib/common/sys/Mutex.h
+++ /dev/null
@@ -1,158 +0,0 @@
-#ifndef _sys_Mutex_h
-#define _sys_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.
- *
- */
-
-#ifdef USE_APR
-# include <apr_thread_mutex.h>
-# include <apr_pools.h>
-# include "apr/APRBase.h"
-# include "apr/APRPool.h"
-#else
-# include <pthread.h>
-# include <posix/check.h>
-#endif
-#include <boost/noncopyable.hpp>
-
-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;
-};
-
-/**
- * Mutex lock.
- */
-class Mutex : private boost::noncopyable {
- public:
- typedef ScopedLock<Mutex> ScopedLock;
-
- inline Mutex();
- inline ~Mutex();
- inline void lock();
- inline void unlock();
- inline void trylock();
-
- protected:
-#ifdef USE_APR
- apr_thread_mutex_t* mutex;
- apr_pool_t* pool;
-#else
- pthread_mutex_t mutex;
-#endif
-};
-
-#ifdef USE_APR
-// APR ================================================================
-
-Mutex::Mutex() {
- pool = APRPool::get();
- CHECK_APR_SUCCESS(apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_NESTED, pool));
-}
-
-Mutex::~Mutex(){
- CHECK_APR_SUCCESS(apr_thread_mutex_destroy(mutex));
- APRPool::free(pool);
-}
-
-void Mutex::lock() {
- CHECK_APR_SUCCESS(apr_thread_mutex_lock(mutex));
-}
-void Mutex::unlock() {
- CHECK_APR_SUCCESS(apr_thread_mutex_unlock(mutex));
-}
-
-void Mutex::trylock() {
- CHECK_APR_SUCCESS(apr_thread_mutex_trylock(mutex));
-}
-
-#else
-// POSIX ================================================================
-
-/**
- * PODMutex is a POD, can be static-initialized with
- * PODMutex m = QPID_PODMUTEX_INITIALIZER
- */
-struct PODMutex
-{
- typedef ScopedLock<PODMutex> ScopedLock;
-
- inline void lock();
- inline void unlock();
- inline void trylock();
-
- // Must be public to be a POD:
- pthread_mutex_t mutex;
-};
-
-#define QPID_MUTEX_INITIALIZER { PTHREAD_MUTEX_INITIALIZER }
-
-
-void PODMutex::lock() {
- QPID_POSIX_THROW_IF(pthread_mutex_lock(&mutex));
-}
-void PODMutex::unlock() {
- QPID_POSIX_THROW_IF(pthread_mutex_unlock(&mutex));
-}
-
-void PODMutex::trylock() {
- QPID_POSIX_THROW_IF(pthread_mutex_trylock(&mutex));
-}
-
-
-Mutex::Mutex() {
- QPID_POSIX_THROW_IF(pthread_mutex_init(&mutex, 0));
-}
-
-Mutex::~Mutex(){
- QPID_POSIX_THROW_IF(pthread_mutex_destroy(&mutex));
-}
-
-void Mutex::lock() {
- QPID_POSIX_THROW_IF(pthread_mutex_lock(&mutex));
-}
-void Mutex::unlock() {
- QPID_POSIX_THROW_IF(pthread_mutex_unlock(&mutex));
-}
-
-void Mutex::trylock() {
- QPID_POSIX_THROW_IF(pthread_mutex_trylock(&mutex));
-}
-
-#endif // USE_APR
-
-}}
-
-
-
-#endif /*!_sys_Mutex_h*/
diff --git a/Final/cpp/lib/common/sys/Runnable.cpp b/Final/cpp/lib/common/sys/Runnable.cpp
deleted file mode 100644
index c3174b9bc8..0000000000
--- a/Final/cpp/lib/common/sys/Runnable.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 "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/Final/cpp/lib/common/sys/Runnable.h b/Final/cpp/lib/common/sys/Runnable.h
deleted file mode 100644
index fb3927c612..0000000000
--- a/Final/cpp/lib/common/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/Final/cpp/lib/common/sys/SessionContext.h b/Final/cpp/lib/common/sys/SessionContext.h
deleted file mode 100644
index 671e00774f..0000000000
--- a/Final/cpp/lib/common/sys/SessionContext.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.
- *
- */
-#ifndef _SessionContext_
-#define _SessionContext_
-
-#include <OutputHandler.h>
-
-namespace qpid {
-namespace sys {
-
-/**
- * Provides the output handler associated with a connection.
- */
-class SessionContext : public virtual qpid::framing::OutputHandler
-{
- public:
- virtual void close() = 0;
-};
-
-}}
-
-
-#endif
diff --git a/Final/cpp/lib/common/sys/SessionHandler.h b/Final/cpp/lib/common/sys/SessionHandler.h
deleted file mode 100644
index 76f79d421d..0000000000
--- a/Final/cpp/lib/common/sys/SessionHandler.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 _SessionHandler_
-#define _SessionHandler_
-
-#include <InputHandler.h>
-#include <InitiationHandler.h>
-#include <ProtocolInitiation.h>
-#include <sys/TimeoutHandler.h>
-
-namespace qpid {
-namespace sys {
-
- class SessionHandler :
- public qpid::framing::InitiationHandler,
- public qpid::framing::InputHandler,
- public TimeoutHandler
- {
- public:
- virtual void closed() = 0;
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/sys/SessionHandlerFactory.h b/Final/cpp/lib/common/sys/SessionHandlerFactory.h
deleted file mode 100644
index 2a01aebcb0..0000000000
--- a/Final/cpp/lib/common/sys/SessionHandlerFactory.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 _SessionHandlerFactory_
-#define _SessionHandlerFactory_
-
-#include <boost/noncopyable.hpp>
-
-namespace qpid {
-namespace sys {
-
-class SessionContext;
-class SessionHandler;
-
-/**
- * Callback interface used by the Acceptor to
- * create a SessionHandler for each new connection.
- */
-class SessionHandlerFactory : private boost::noncopyable
-{
- public:
- virtual SessionHandler* create(SessionContext* ctxt) = 0;
- virtual ~SessionHandlerFactory(){}
-};
-
-}}
-
-
-#endif
diff --git a/Final/cpp/lib/common/sys/ShutdownHandler.h b/Final/cpp/lib/common/sys/ShutdownHandler.h
deleted file mode 100644
index 88baecb5b6..0000000000
--- a/Final/cpp/lib/common/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/Final/cpp/lib/common/sys/Socket.h b/Final/cpp/lib/common/sys/Socket.h
deleted file mode 100644
index b5f74847c2..0000000000
--- a/Final/cpp/lib/common/sys/Socket.h
+++ /dev/null
@@ -1,89 +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 <string>
-#include <sys/Time.h>
-
-#ifdef USE_APR
-# include <apr_network_io.h>
-#endif
-
-namespace qpid {
-namespace sys {
-
-class Socket
-{
- public:
- /** Create an initialized TCP socket */
- static Socket createTcp();
-
- /** Create a socket wrapper for descriptor. */
-#ifdef USE_APR
- Socket(apr_socket_t* descriptor = 0);
-#else
- Socket(int descriptor = 0);
-#endif
-
- /** Set timeout for read and write */
- void setTimeout(Time interval);
- void setTcpNoDelay(bool on);
-
- void connect(const std::string& host, int port);
-
- void close();
-
- enum { SOCKET_TIMEOUT=-2, SOCKET_EOF=-3 } ErrorCode;
-
- /** Returns bytes sent or an ErrorCode value < 0. */
- ssize_t send(const void* data, size_t size);
-
- /**
- * Returns bytes received, an ErrorCode value < 0 or 0
- * if the connection closed in an orderly manner.
- */
- ssize_t recv(void* data, size_t size);
-
- /** 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(int port = 0, int backlog = 10);
-
- /** Get file descriptor */
- int fd();
-
- private:
-#ifdef USE_APR
- apr_socket_t* socket;
-#else
- void init() const;
- mutable int socket; // Initialized on demand.
-#endif
-};
-
-}}
-
-
-#endif /*!_sys_Socket_h*/
diff --git a/Final/cpp/lib/common/sys/Thread.h b/Final/cpp/lib/common/sys/Thread.h
deleted file mode 100644
index c14c7cc6ad..0000000000
--- a/Final/cpp/lib/common/sys/Thread.h
+++ /dev/null
@@ -1,150 +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 <sys/Runnable.h>
-
-#ifdef USE_APR
-# include <apr_thread_proc.h>
-# include <apr_portable.h>
-# include <apr/APRPool.h>
-# include <apr/APRBase.h>
-#else
-# include <posix/check.h>
-# include <pthread.h>
-#endif
-
-namespace qpid {
-namespace sys {
-
-class Thread
-{
- public:
- inline static Thread current();
- inline static void yield();
-
- inline Thread();
- inline Thread(qpid::sys::Runnable*);
- inline Thread(qpid::sys::Runnable&);
- ~Thread();
- inline void join();
- inline long id();
-
- private:
-#ifdef USE_APR
- static void* APR_THREAD_FUNC runRunnable(apr_thread_t* thread, void *data);
- inline Thread(apr_thread_t* t);
- apr_thread_t* thread;
-#else
- static void* runRunnable(void* runnable);
- inline Thread(pthread_t);
- pthread_t thread;
-#endif
-};
-
-
-Thread::Thread() : thread(0) {}
-
-// APR ================================================================
-#ifdef USE_APR
-
-Thread::Thread(Runnable* runnable) {
- apr_pool_t* tmp_pool = APRPool::get();
- CHECK_APR_SUCCESS(
- apr_thread_create(&thread, 0, runRunnable, runnable, tmp_pool));
- APRPool::free(tmp_pool);
-}
-
-Thread::Thread(Runnable& runnable) {
- apr_pool_t* tmp_pool = APRPool::get();
- CHECK_APR_SUCCESS(
- apr_thread_create(&thread, 0, runRunnable, &runnable, tmp_pool));
- APRPool::free(tmp_pool);
-}
-
-void Thread::join(){
- apr_status_t status;
- if (thread != 0)
- CHECK_APR_SUCCESS(apr_thread_join(&status, thread));
-}
-
-long Thread::id() {
- return long(thread);
-}
-
-Thread::Thread(apr_thread_t* t) : thread(t) {}
-
-Thread Thread::current(){
- apr_pool_t* tmp_pool = APRPool::get();
- apr_thread_t* thr;
- apr_os_thread_t osthr = apr_os_thread_current();
- CHECK_APR_SUCCESS(apr_os_thread_put(&thr, &osthr, tmp_pool));
- APRPool::free(tmp_pool);
- return Thread(thr);
-}
-
-void Thread::yield()
-{
- apr_thread_yield();
-}
-
-
-// POSIX ================================================================
-#else
-
-Thread::Thread(Runnable* runnable) {
- QPID_POSIX_THROW_IF(pthread_create(&thread, NULL, runRunnable, runnable));
-}
-
-Thread::Thread(Runnable& runnable) {
- QPID_POSIX_THROW_IF(pthread_create(&thread, NULL, runRunnable, &runnable));
-}
-
-void Thread::join(){
- QPID_POSIX_THROW_IF(pthread_join(thread, 0));
-}
-
-long Thread::id() {
- return long(thread);
-}
-
-Thread::~Thread() {
-}
-
-Thread::Thread(pthread_t thr) : thread(thr) {}
-
-Thread Thread::current() {
- return Thread(pthread_self());
-}
-
-void Thread::yield()
-{
- QPID_POSIX_THROW_IF(pthread_yield());
-}
-
-
-#endif
-
-}}
-
-#endif /*!_sys_Thread_h*/
diff --git a/Final/cpp/lib/common/sys/Time.cpp b/Final/cpp/lib/common/sys/Time.cpp
deleted file mode 100644
index ad6185b966..0000000000
--- a/Final/cpp/lib/common/sys/Time.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 "Time.h"
-
-namespace qpid {
-namespace sys {
-
-// APR ================================================================
-#if USE_APR
-
-Time now() { return apr_time_now() * TIME_USEC; }
-
-// POSIX================================================================
-#else
-
-Time now() {
- struct timespec ts;
- clock_gettime(CLOCK_REALTIME, &ts);
- return toTime(ts);
-}
-
-struct timespec toTimespec(const Time& t) {
- struct timespec ts;
- toTimespec(ts, t);
- return ts;
-}
-
-struct timespec& toTimespec(struct timespec& ts, const Time& t) {
- ts.tv_sec = t / TIME_SEC;
- ts.tv_nsec = t % TIME_SEC;
- return ts;
-}
-
-Time toTime(const struct timespec& ts) {
- return ts.tv_sec*TIME_SEC + ts.tv_nsec;
-}
-
-
-#endif
-}}
-
diff --git a/Final/cpp/lib/common/sys/Time.h b/Final/cpp/lib/common/sys/Time.h
deleted file mode 100644
index 3dd46741d8..0000000000
--- a/Final/cpp/lib/common/sys/Time.h
+++ /dev/null
@@ -1,58 +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 <stdint.h>
-
-#ifdef USE_APR
-# include <apr_time.h>
-#else
-# include <time.h>
-#endif
-
-namespace qpid {
-namespace sys {
-
-/** Time in nanoseconds */
-typedef int64_t Time;
-
-Time now();
-
-/** Nanoseconds per second. */
-const Time TIME_SEC = 1000*1000*1000;
-/** Nanoseconds per millisecond */
-const Time TIME_MSEC = 1000*1000;
-/** Nanoseconds per microseconds. */
-const Time TIME_USEC = 1000;
-/** Nanoseconds per nanosecond. */
-const Time TIME_NSEC = 1;
-
-#ifndef USE_APR
-struct timespec toTimespec(const Time& t);
-struct timespec& toTimespec(struct timespec& ts, const Time& t);
-Time toTime(const struct timespec& ts);
-#endif
-
-}}
-
-#endif /*!_sys_Time_h*/
diff --git a/Final/cpp/lib/common/sys/TimeoutHandler.h b/Final/cpp/lib/common/sys/TimeoutHandler.h
deleted file mode 100644
index 0c10709bbf..0000000000
--- a/Final/cpp/lib/common/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/Final/cpp/lib/common/sys/apr/APRAcceptor.cpp b/Final/cpp/lib/common/sys/apr/APRAcceptor.cpp
deleted file mode 100644
index a427542fc3..0000000000
--- a/Final/cpp/lib/common/sys/apr/APRAcceptor.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.
- *
- */
-#include <sys/Acceptor.h>
-#include <sys/SessionHandlerFactory.h>
-#include <apr_pools.h>
-#include "LFProcessor.h"
-#include "LFSessionContext.h"
-#include "APRBase.h"
-#include "APRPool.h"
-
-namespace qpid {
-namespace sys {
-
-class APRAcceptor : public Acceptor
-{
- public:
- APRAcceptor(int16_t port, int backlog, int threads, bool trace);
- ~APRAcceptor();
- virtual int16_t getPort() const;
- virtual void run(qpid::sys::SessionHandlerFactory* factory);
- virtual void shutdown();
-
- private:
- void shutdownImpl();
-
- private:
- int16_t port;
- bool trace;
- LFProcessor processor;
- apr_socket_t* socket;
- volatile bool running;
- Mutex shutdownLock;
- apr_pool_t* pool;
-};
-
-// Define generic Acceptor::create() to return APRAcceptor.
-Acceptor::shared_ptr Acceptor::create(int16_t port, int backlog, int threads, bool trace)
-{
- return Acceptor::shared_ptr(new APRAcceptor(port, backlog, threads, trace));
-}
-// Must define Acceptor virtual dtor.
-Acceptor::~Acceptor() {
-}
-
-APRAcceptor::~APRAcceptor() {
- APRPool::free(pool);
-}
-
-APRAcceptor::APRAcceptor(int16_t port_, int backlog, int threads, bool trace_) :
- port(port_),
- trace(trace_),
- processor(threads, 1000, 5000000)
-{
- pool = APRPool::get();
- apr_sockaddr_t* address;
- CHECK_APR_SUCCESS(apr_sockaddr_info_get(&address, APR_ANYADDR, APR_UNSPEC, port, APR_IPV4_ADDR_OK, pool));
- CHECK_APR_SUCCESS(apr_socket_create(&socket, APR_INET, SOCK_STREAM, APR_PROTO_TCP, pool));
- CHECK_APR_SUCCESS(apr_socket_opt_set(socket, APR_SO_REUSEADDR, 1));
- CHECK_APR_SUCCESS(apr_socket_bind(socket, address));
- CHECK_APR_SUCCESS(apr_socket_listen(socket, backlog));
-}
-
-int16_t APRAcceptor::getPort() const {
- apr_sockaddr_t* address;
- CHECK_APR_SUCCESS(apr_socket_addr_get(&address, APR_LOCAL, socket));
- return address->port;
-}
-
-void APRAcceptor::run(SessionHandlerFactory* factory) {
- running = true;
- processor.start();
- std::cout << "Listening on port " << getPort() << "..." << std::endl;
- while(running){
- apr_socket_t* client;
- apr_status_t status = apr_socket_accept(&client, socket, pool);
- if(status == APR_SUCCESS){
- //make this socket non-blocking:
- CHECK_APR_SUCCESS(apr_socket_timeout_set(client, 0));
- CHECK_APR_SUCCESS(apr_socket_opt_set(client, APR_SO_NONBLOCK, 1));
- CHECK_APR_SUCCESS(apr_socket_opt_set(client, APR_TCP_NODELAY, 1));
- CHECK_APR_SUCCESS(apr_socket_opt_set(client, APR_SO_SNDBUF, 32768));
- CHECK_APR_SUCCESS(apr_socket_opt_set(client, APR_SO_RCVBUF, 32768));
- LFSessionContext* session = new LFSessionContext(client, &processor, trace);
- session->init(factory->create(session));
- }else{
- Mutex::ScopedLock locker(shutdownLock);
- if(running) {
- if(status != APR_EINTR){
- std::cout << "ERROR: " << get_desc(status) << std::endl;
- }
- shutdownImpl();
- }
- }
- }
-}
-
-void APRAcceptor::shutdown() {
- Mutex::ScopedLock locker(shutdownLock);
- if (running) {
- shutdownImpl();
- }
-}
-
-void APRAcceptor::shutdownImpl() {
- Mutex::ScopedLock locker(shutdownLock);
- running = false;
- processor.stop();
- CHECK_APR_SUCCESS(apr_socket_close(socket));
-}
-
-
-}}
diff --git a/Final/cpp/lib/common/sys/apr/APRBase.cpp b/Final/cpp/lib/common/sys/apr/APRBase.cpp
deleted file mode 100644
index 861071499f..0000000000
--- a/Final/cpp/lib/common/sys/apr/APRBase.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 <iostream>
-#include <QpidError.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()){
- std::cout << "WARNING: APR initialization triggered concurrently with termination." << std::endl;
- }
-}
-
-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/Final/cpp/lib/common/sys/apr/APRBase.h b/Final/cpp/lib/common/sys/apr/APRBase.h
deleted file mode 100644
index 6a866a554a..0000000000
--- a/Final/cpp/lib/common/sys/apr/APRBase.h
+++ /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.
- *
- */
-#ifndef _APRBase_
-#define _APRBase_
-
-#include <string>
-#include <apr_thread_mutex.h>
-#include <apr_errno.h>
-#include <QpidError.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){
- const int size = 50;
- char tmp[size];
- std::string msg(apr_strerror(status, tmp, size));
- throw qpid::QpidError(APR_ERROR + ((int) status), msg,
- qpid::SrcLine(file, line));
- }
-}
-
-
-
-
-#endif
diff --git a/Final/cpp/lib/common/sys/apr/APRPool.cpp b/Final/cpp/lib/common/sys/apr/APRPool.cpp
deleted file mode 100644
index 91481faf09..0000000000
--- a/Final/cpp/lib/common/sys/apr/APRPool.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 "APRPool.h"
-#include "APRBase.h"
-#include <boost/pool/detail/singleton.hpp>
-#include <iostream>
-#include <sstream>
-
-
-using namespace qpid::sys;
-
-APRPool::APRPool(){
- APRBase::increment();
- allocated_pools = new std::stack<apr_pool_t*>();
- CHECK_APR_SUCCESS(apr_pool_create(&pool, NULL));
- CHECK_APR_SUCCESS(apr_thread_mutex_create(&poolGuard, APR_THREAD_MUTEX_NESTED, pool));
-}
-
-APRPool::~APRPool(){
- while(allocated_pools->size() > 0) {
- apr_pool_t* pool = allocated_pools->top();
- allocated_pools->pop();
- apr_pool_destroy(pool);
- }
- apr_pool_destroy(pool);
- apr_thread_mutex_destroy(poolGuard);
- delete allocated_pools;
- APRBase::decrement();
-}
-
-void APRPool::free_pool(apr_pool_t* pool) {
- CHECK_APR_SUCCESS(apr_thread_mutex_lock(poolGuard));
- allocated_pools->push(pool);
- CHECK_APR_SUCCESS(apr_thread_mutex_unlock(poolGuard));
-}
-
-apr_pool_t* APRPool::allocate_pool() {
- CHECK_APR_SUCCESS(apr_thread_mutex_lock(poolGuard));
- apr_pool_t* retval;
- if (allocated_pools->size() == 0) {
- CHECK_APR_SUCCESS(apr_pool_create(&retval, pool));
- }
- else {
- retval = allocated_pools->top();
- allocated_pools->pop();
- }
- CHECK_APR_SUCCESS(apr_thread_mutex_unlock(poolGuard));
- return retval;
-}
-
-apr_pool_t* APRPool::get() {
- return
- boost::details::pool::singleton_default<APRPool>::instance().allocate_pool();
-}
-
-void APRPool::free(apr_pool_t* pool) {
- boost::details::pool::singleton_default<APRPool>::instance().free_pool(pool);
-}
-
diff --git a/Final/cpp/lib/common/sys/apr/APRPool.h b/Final/cpp/lib/common/sys/apr/APRPool.h
deleted file mode 100644
index c22338599e..0000000000
--- a/Final/cpp/lib/common/sys/apr/APRPool.h
+++ /dev/null
@@ -1,61 +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>
-#include <apr_thread_mutex.h>
-#include <stack>
-
-namespace qpid {
-namespace sys {
-/**
- * Singleton APR memory pool.
- */
-class APRPool : private boost::noncopyable {
- public:
- APRPool();
- ~APRPool();
-
- apr_pool_t* allocate_pool();
-
- void free_pool(apr_pool_t* pool);
-
- /** Allocate pool */
- static apr_pool_t* get();
-
- /** Free pool */
- static void free(apr_pool_t* pool);
-
- private:
- apr_pool_t* pool;
- apr_thread_mutex_t* poolGuard;
- std::stack<apr_pool_t*>* allocated_pools;
-};
-
-}}
-
-
-
-
-
-#endif /*!_APRPool_*/
diff --git a/Final/cpp/lib/common/sys/apr/APRSocket.cpp b/Final/cpp/lib/common/sys/apr/APRSocket.cpp
deleted file mode 100644
index f68d51d8e4..0000000000
--- a/Final/cpp/lib/common/sys/apr/APRSocket.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 "APRBase.h"
-#include "APRSocket.h"
-#include <assert.h>
-#include <iostream>
-
-using namespace qpid::sys;
-using namespace qpid::framing;
-
-APRSocket::APRSocket(apr_socket_t* _socket) : socket(_socket), closed(false){
-
-}
-
-void APRSocket::read(qpid::framing::Buffer& buffer){
- apr_size_t bytes;
- bytes = buffer.available();
- apr_status_t s = apr_socket_recv(socket, buffer.start(), &bytes);
- buffer.move(bytes);
- if(APR_STATUS_IS_TIMEUP(s)){
- //timed out
- }else if(APR_STATUS_IS_EOF(s)){
- close();
- }
-}
-
-void APRSocket::write(qpid::framing::Buffer& buffer){
- apr_size_t bytes;
- do{
- bytes = buffer.available();
- apr_socket_send(socket, buffer.start(), &bytes);
- buffer.move(bytes);
- }while(bytes > 0);
-}
-
-void APRSocket::close(){
- if(!closed){
- CHECK_APR_SUCCESS(apr_socket_close(socket));
- closed = true;
- }
-}
-
-bool APRSocket::isOpen(){
- return !closed;
-}
-
-u_int8_t APRSocket::read(){
- char data[1];
- apr_size_t bytes = 1;
- apr_status_t s = apr_socket_recv(socket, data, &bytes);
- if(APR_STATUS_IS_EOF(s) || bytes == 0){
- return 0;
- }else{
- return *data;
- }
-}
-
-APRSocket::~APRSocket(){
-}
diff --git a/Final/cpp/lib/common/sys/apr/APRSocket.h b/Final/cpp/lib/common/sys/apr/APRSocket.h
deleted file mode 100644
index 53f1055c6a..0000000000
--- a/Final/cpp/lib/common/sys/apr/APRSocket.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 _APRSocket_
-#define _APRSocket_
-
-#include <apr_network_io.h>
-#include <Buffer.h>
-
-namespace qpid {
-namespace sys {
-
- class APRSocket
- {
- apr_socket_t* const socket;
- volatile bool closed;
- public:
- APRSocket(apr_socket_t* socket);
- void read(qpid::framing::Buffer& b);
- void write(qpid::framing::Buffer& b);
- void close();
- bool isOpen();
- u_int8_t read();
- ~APRSocket();
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/sys/apr/LFProcessor.cpp b/Final/cpp/lib/common/sys/apr/LFProcessor.cpp
deleted file mode 100644
index 22b601e688..0000000000
--- a/Final/cpp/lib/common/sys/apr/LFProcessor.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 <sstream>
-#include <QpidError.h>
-#include "LFProcessor.h"
-#include "APRBase.h"
-#include "APRPool.h"
-#include "LFSessionContext.h"
-
-using namespace qpid::sys;
-using qpid::QpidError;
-
-// TODO aconway 2006-10-12: stopped is read outside locks.
-//
-
-LFProcessor::LFProcessor(int _workers, int _size, int _timeout) :
- size(_size),
- timeout(_timeout),
- signalledCount(0),
- current(0),
- count(0),
- workerCount(_workers),
- hasLeader(false),
- workers(new Thread[_workers]),
- stopped(false)
-{
- pool = APRPool::get();
- CHECK_APR_SUCCESS(apr_pollset_create(&pollset, size, pool, APR_POLLSET_THREADSAFE));
-}
-
-
-LFProcessor::~LFProcessor(){
- if (!stopped) stop();
- delete[] workers;
- CHECK_APR_SUCCESS(apr_pollset_destroy(pollset));
- APRPool::free(pool);
-}
-
-void LFProcessor::start(){
- for(int i = 0; i < workerCount; i++){
- workers[i] = Thread(this);
- }
-}
-
-void LFProcessor::add(const apr_pollfd_t* const fd){
- CHECK_APR_SUCCESS(apr_pollset_add(pollset, fd));
- Monitor::ScopedLock l(countLock);
- sessions.push_back(reinterpret_cast<LFSessionContext*>(fd->client_data));
- count++;
-}
-
-void LFProcessor::remove(const apr_pollfd_t* const fd){
- CHECK_APR_SUCCESS(apr_pollset_remove(pollset, fd));
- Monitor::ScopedLock l(countLock);
- sessions.erase(find(sessions.begin(), sessions.end(), reinterpret_cast<LFSessionContext*>(fd->client_data)));
- count--;
-}
-
-void LFProcessor::reactivate(const apr_pollfd_t* const fd){
- CHECK_APR_SUCCESS(apr_pollset_add(pollset, fd));
-}
-
-void LFProcessor::deactivate(const apr_pollfd_t* const fd){
- CHECK_APR_SUCCESS(apr_pollset_remove(pollset, fd));
-}
-
-void LFProcessor::update(const apr_pollfd_t* const fd){
- CHECK_APR_SUCCESS(apr_pollset_remove(pollset, fd));
- CHECK_APR_SUCCESS(apr_pollset_add(pollset, fd));
-}
-
-bool LFProcessor::full(){
- Mutex::ScopedLock locker(countLock);
- return count == size;
-}
-
-bool LFProcessor::empty(){
- Mutex::ScopedLock locker(countLock);
- return count == 0;
-}
-
-void LFProcessor::poll() {
- apr_status_t status = APR_EGENERAL;
- do{
- current = 0;
- if(!stopped){
- status = apr_pollset_poll(pollset, timeout, &signalledCount, &signalledFDs);
- }
- }while(status != APR_SUCCESS && !stopped);
-}
-
-void LFProcessor::run(){
- try{
- while(!stopped){
- const apr_pollfd_t* event = 0;
- LFSessionContext* session = 0;
- {
- Monitor::ScopedLock l(leadLock);
- waitToLead();
- event = getNextEvent();
- if(!event) return;
- session = reinterpret_cast<LFSessionContext*>(
- event->client_data);
- session->startProcessing();
- relinquishLead();
- }
-
- //process event:
- if(event->rtnevents & APR_POLLIN) session->read();
- if(event->rtnevents & APR_POLLOUT) session->write();
-
- if(session->isClosed()){
- session->handleClose();
- Monitor::ScopedLock l(countLock);
- sessions.erase(find(sessions.begin(),sessions.end(), session));
- count--;
- }else{
- session->stopProcessing();
- }
- }
- }catch(std::exception e){
- std::cout << e.what() << std::endl;
- }
-}
-
-void LFProcessor::waitToLead(){
- while(hasLeader && !stopped) leadLock.wait();
- hasLeader = !stopped;
-}
-
-void LFProcessor::relinquishLead(){
- hasLeader = false;
- leadLock.notify();
-}
-
-const apr_pollfd_t* LFProcessor::getNextEvent(){
- while(true){
- if(stopped){
- return 0;
- }else if(current < signalledCount){
- //use result of previous poll if one is available
- return signalledFDs + (current++);
- }else{
- //else poll to get new events
- poll();
- }
- }
-}
-
-void LFProcessor::stop(){
- stopped = true;
- {
- Monitor::ScopedLock l(leadLock);
- leadLock.notifyAll();
- }
- for(int i = 0; i < workerCount; i++){
- workers[i].join();
- }
- for(iterator i = sessions.begin(); i < sessions.end(); i++){
- (*i)->shutdown();
- }
-}
-
diff --git a/Final/cpp/lib/common/sys/apr/LFProcessor.h b/Final/cpp/lib/common/sys/apr/LFProcessor.h
deleted file mode 100644
index 0f4850ee08..0000000000
--- a/Final/cpp/lib/common/sys/apr/LFProcessor.h
+++ /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.
- *
- */
-#ifndef _LFProcessor_
-#define _LFProcessor_
-
-#include <apr_poll.h>
-#include <iostream>
-#include <vector>
-#include <sys/Monitor.h>
-#include <sys/Runnable.h>
-#include <sys/Thread.h>
-
-namespace qpid {
-namespace sys {
-
- class LFSessionContext;
-
- /**
- * This class processes a poll set using the leaders-followers
- * pattern for thread synchronization: the leader will poll and on
- * the poll returning, it will remove a session, promote a
- * follower to leadership, then process the session.
- */
- class LFProcessor : private virtual qpid::sys::Runnable
- {
- typedef std::vector<LFSessionContext*>::iterator iterator;
-
- const int size;
- const apr_interval_time_t timeout;
- apr_pollset_t* pollset;
- int signalledCount;
- int current;
- const apr_pollfd_t* signalledFDs;
- int count;
- const int workerCount;
- bool hasLeader;
- qpid::sys::Thread* workers;
- qpid::sys::Monitor leadLock;
- qpid::sys::Mutex countLock;
- std::vector<LFSessionContext*> sessions;
- volatile bool stopped;
- apr_pool_t* pool;
-
- const apr_pollfd_t* getNextEvent();
- void waitToLead();
- void relinquishLead();
- void poll();
- virtual void run();
-
- public:
- LFProcessor(int workers, int size, int timeout);
- /**
- * Add the fd to the poll set. Relies on the client_data being
- * an instance of LFSessionContext.
- */
- void add(const apr_pollfd_t* const fd);
- /**
- * Remove the fd from the poll set.
- */
- void remove(const apr_pollfd_t* const fd);
- /**
- * Signal that the fd passed in, already part of the pollset,
- * has had its flags altered.
- */
- void update(const apr_pollfd_t* const fd);
- /**
- * Add an fd back to the poll set after deactivation.
- */
- void reactivate(const apr_pollfd_t* const fd);
- /**
- * Temporarily remove the fd from the poll set. Called when processing
- * is about to begin.
- */
- void deactivate(const apr_pollfd_t* const fd);
- /**
- * Indicates whether the capacity of this processor has been
- * reached (or whether it can still handle further fd's).
- */
- bool full();
- /**
- * Indicates whether there are any fd's registered.
- */
- bool empty();
- /**
- * Stop processing.
- */
- void stop();
- /**
- * Start processing.
- */
- void start();
- /**
- * Is processing stopped?
- */
- bool isStopped();
-
- ~LFProcessor();
- };
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/sys/apr/LFSessionContext.cpp b/Final/cpp/lib/common/sys/apr/LFSessionContext.cpp
deleted file mode 100644
index 8a7ce18136..0000000000
--- a/Final/cpp/lib/common/sys/apr/LFSessionContext.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 "LFSessionContext.h"
-#include "APRBase.h"
-#include "APRPool.h"
-#include <QpidError.h>
-#include <assert.h>
-
-using namespace qpid::sys;
-using namespace qpid::sys;
-using namespace qpid::framing;
-
-LFSessionContext::LFSessionContext(apr_socket_t* _socket,
- LFProcessor* const _processor,
- bool _debug) :
- debug(_debug),
- socket(_socket),
- initiated(false),
- in(65536),
- out(65536),
- processor(_processor),
- processing(false),
- closing(false)
-{
-
- fd.p = APRPool::get();
- fd.desc_type = APR_POLL_SOCKET;
- fd.reqevents = APR_POLLIN;
- fd.client_data = this;
- fd.desc.s = _socket;
-
- out.flip();
-}
-
-LFSessionContext::~LFSessionContext(){
-
-}
-
-void LFSessionContext::read(){
- socket.read(in);
- in.flip();
- if(initiated){
- AMQFrame frame;
- try{
- while(frame.decode(in)){
- if(debug) log("RECV", &frame);
- handler->received(&frame);
- }
- }catch(QpidError error){
- std::cout << "Error [" << error.code << "] " << error.msg
- << " (" << error.location.file << ":" << error.location.line
- << ")" << std::endl;
- }
- }else{
- ProtocolInitiation protocolInit;
- if(protocolInit.decode(in)){
- handler->initiated(&protocolInit);
- initiated = true;
- if(debug) std::cout << "INIT [" << &socket << "]" << std::endl;
- }
- }
- in.compact();
-}
-
-void LFSessionContext::write(){
- bool done = isClosed();
- while(!done){
- if(out.available() > 0){
- socket.write(out);
- if(out.available() > 0){
-
- //incomplete write, leave flags to receive notification of readiness to write
- done = true;//finished processing for now, but write is still in progress
- }
- }else{
- //do we have any frames to write?
- Mutex::ScopedLock l(writeLock);
- if(!framesToWrite.empty()){
- out.clear();
- bool encoded(false);
- AMQFrame* frame = framesToWrite.front();
- while(frame && out.available() >= frame->size()){
- encoded = true;
- frame->encode(out);
- if(debug) log("SENT", frame);
- delete frame;
- framesToWrite.pop();
- frame = framesToWrite.empty() ? 0 : framesToWrite.front();
- }
- if(!encoded) THROW_QPID_ERROR(FRAMING_ERROR, "Could not write frame, too large for buffer.");
- out.flip();
- }else{
- //reset flags, don't care about writability anymore
- fd.reqevents = APR_POLLIN;
- done = true;
-
- if(closing){
- socket.close();
- }
- }
- }
- }
-}
-
-void LFSessionContext::send(AMQFrame* frame){
- Mutex::ScopedLock l(writeLock);
- if(!closing){
- framesToWrite.push(frame);
- if(!(fd.reqevents & APR_POLLOUT)){
- fd.reqevents |= APR_POLLOUT;
- if(!processing){
- processor->update(&fd);
- }
- }
- }
-}
-
-void LFSessionContext::startProcessing(){
- Mutex::ScopedLock l(writeLock);
- processing = true;
- processor->deactivate(&fd);
-}
-
-void LFSessionContext::stopProcessing(){
- Mutex::ScopedLock l(writeLock);
- processor->reactivate(&fd);
- processing = false;
-}
-
-void LFSessionContext::close(){
- Mutex::ScopedLock l(writeLock);
- closing = true;
- if(!processing){
- //allow pending frames to be written to socket
- fd.reqevents = APR_POLLOUT;
- processor->update(&fd);
- }
-}
-
-void LFSessionContext::handleClose(){
- handler->closed();
- APRPool::free(fd.p);
- if (debug) std::cout << "Session closed [" << &socket << "]" << std::endl;
- delete handler;
- delete this;
-}
-
-void LFSessionContext::shutdown(){
- socket.close();
- handleClose();
-}
-
-void LFSessionContext::init(SessionHandler* _handler){
- handler = _handler;
- processor->add(&fd);
-}
-
-void LFSessionContext::log(const std::string& desc, AMQFrame* const frame){
- Mutex::ScopedLock l(logLock);
- std::cout << desc << " [" << &socket << "]: " << *frame << std::endl;
-}
-
-Mutex LFSessionContext::logLock;
diff --git a/Final/cpp/lib/common/sys/apr/LFSessionContext.h b/Final/cpp/lib/common/sys/apr/LFSessionContext.h
deleted file mode 100644
index eeb8279d9a..0000000000
--- a/Final/cpp/lib/common/sys/apr/LFSessionContext.h
+++ /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.
- *
- */
-#ifndef _LFSessionContext_
-#define _LFSessionContext_
-
-#include <queue>
-
-#include <apr_network_io.h>
-#include <apr_poll.h>
-#include <apr_time.h>
-
-#include <AMQFrame.h>
-#include <Buffer.h>
-#include <sys/Monitor.h>
-#include <sys/SessionContext.h>
-#include <sys/SessionHandler.h>
-
-#include "APRSocket.h"
-#include "LFProcessor.h"
-
-namespace qpid {
-namespace sys {
-
-
-class LFSessionContext : public virtual qpid::sys::SessionContext
-{
- const bool debug;
- APRSocket socket;
- bool initiated;
-
- qpid::framing::Buffer in;
- qpid::framing::Buffer out;
-
- qpid::sys::SessionHandler* handler;
- LFProcessor* const processor;
-
- apr_pollfd_t fd;
-
- std::queue<qpid::framing::AMQFrame*> framesToWrite;
- qpid::sys::Mutex writeLock;
-
- bool processing;
- bool closing;
-
- static qpid::sys::Mutex logLock;
- void log(const std::string& desc,
- qpid::framing::AMQFrame* const frame);
-
-
- public:
- LFSessionContext(apr_socket_t* socket,
- LFProcessor* const processor,
- bool debug = false);
- virtual ~LFSessionContext();
- virtual void send(qpid::framing::AMQFrame* frame);
- virtual void close();
- void read();
- void write();
- void init(qpid::sys::SessionHandler* handler);
- void startProcessing();
- void stopProcessing();
- void handleClose();
- void shutdown();
- inline apr_pollfd_t* const getFd(){ return &fd; }
- inline bool isClosed(){ return !socket.isOpen(); }
-};
-
-}
-}
-
-
-#endif
diff --git a/Final/cpp/lib/common/sys/apr/Socket.cpp b/Final/cpp/lib/common/sys/apr/Socket.cpp
deleted file mode 100644
index c2abf50c5f..0000000000
--- a/Final/cpp/lib/common/sys/apr/Socket.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 <sys/Socket.h>
-#include <apr/APRBase.h>
-#include <apr/APRPool.h>
-
-#include <iostream>
-
-using namespace qpid::sys;
-
-Socket Socket::createTcp() {
- Socket s;
- apr_pool_t* pool = APRPool::get();
- CHECK_APR_SUCCESS(
- apr_socket_create(
- &s.socket, APR_INET, SOCK_STREAM, APR_PROTO_TCP,
- pool));
- APRPool::free(pool);
- return s;
-}
-
-Socket::Socket(apr_socket_t* s) {
- socket = s;
-}
-
-void Socket::setTimeout(Time interval) {
- apr_socket_timeout_set(socket, interval/TIME_USEC);
-}
-
-void Socket::connect(const std::string& host, int port) {
- apr_sockaddr_t* address;
- apr_pool_t* pool = APRPool::get();
- CHECK_APR_SUCCESS(
- apr_sockaddr_info_get(
- &address, host.c_str(), APR_UNSPEC, port, APR_IPV4_ADDR_OK,
- pool));
- CHECK_APR_SUCCESS(apr_socket_connect(socket, address));
- APRPool::free(pool);
-}
-
-void Socket::close() {
- if (socket == 0) return;
- CHECK_APR_SUCCESS(apr_socket_shutdown(socket, APR_SHUTDOWN_READWRITE));
- CHECK_APR_SUCCESS(apr_socket_close(socket));
- socket = 0;
-}
-
-ssize_t Socket::send(const void* data, size_t size)
-{
- 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)
-{
- 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;
-}
-
-void Socket::setTcpNoDelay(bool on)
-{
- CHECK_APR_SUCCESS(apr_socket_opt_set(socket, APR_TCP_NODELAY, on ? 1 : 0));
-}
-
diff --git a/Final/cpp/lib/common/sys/apr/Thread.cpp b/Final/cpp/lib/common/sys/apr/Thread.cpp
deleted file mode 100644
index 997ff03ab3..0000000000
--- a/Final/cpp/lib/common/sys/apr/Thread.cpp
+++ /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 <sys/Thread.h>
-#include "APRPool.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;
-}
-
-Thread::~Thread() {
-}
-
-
diff --git a/Final/cpp/lib/common/sys/posix/EventChannel.cpp b/Final/cpp/lib/common/sys/posix/EventChannel.cpp
deleted file mode 100644
index 8b91fc1ba6..0000000000
--- a/Final/cpp/lib/common/sys/posix/EventChannel.cpp
+++ /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.
- *
- */
-
-#include <mqueue.h>
-#include <string.h>
-#include <iostream>
-
-#include <sys/errno.h>
-#include <sys/socket.h>
-#include <sys/epoll.h>
-
-#include <typeinfo>
-#include <iostream>
-#include <queue>
-
-#include <boost/ptr_container/ptr_map.hpp>
-#include <boost/current_function.hpp>
-
-#include <QpidError.h>
-#include <sys/Monitor.h>
-
-#include "check.h"
-#include "EventChannel.h"
-
-using namespace std;
-
-
-// Convenience template to zero out a struct.
-template <class S> struct ZeroStruct : public S {
- ZeroStruct() { memset(this, 0, sizeof(*this)); }
-};
-
-namespace qpid {
-namespace sys {
-
-
-/**
- * EventHandler wraps an epoll file descriptor. Acts as private
- * interface between EventChannel and subclasses.
- *
- * Also implements Event interface for events that are not associated
- * with a file descriptor and are passed via the message queue.
- */
-class EventHandler : public Event, private Monitor
-{
- public:
- EventHandler(int epollSize = 256);
- ~EventHandler();
-
- int getEpollFd() { return epollFd; }
- void epollAdd(int fd, uint32_t epollEvents, Event* event);
- void epollMod(int fd, uint32_t epollEvents, Event* event);
- void epollDel(int fd);
-
- void mqPut(Event* event);
- Event* mqGet();
-
- protected:
- // Should never be called, only complete.
- void prepare(EventHandler&) { assert(0); }
- Event* complete(EventHandler& eh);
-
- private:
- int epollFd;
- std::string mqName;
- int mqFd;
- std::queue<Event*> mqEvents;
-};
-
-EventHandler::EventHandler(int epollSize)
-{
- epollFd = epoll_create(epollSize);
- if (epollFd < 0) throw QPID_POSIX_ERROR(errno);
-
- // Create a POSIX message queue for non-fd events.
- // We write one byte and never read it is always ready for read
- // when we add it to epoll.
- //
- ZeroStruct<struct mq_attr> attr;
- attr.mq_maxmsg = 1;
- attr.mq_msgsize = 1;
- do {
- char tmpnam[L_tmpnam];
- tmpnam_r(tmpnam);
- mqName = tmpnam + 4; // Skip "tmp/"
- mqFd = mq_open(
- mqName.c_str(), O_CREAT|O_EXCL|O_RDWR|O_NONBLOCK, S_IRWXU, &attr);
- if (mqFd < 0) throw QPID_POSIX_ERROR(errno);
- } while (mqFd == EEXIST); // Name already taken, try again.
-
- static char zero = '\0';
- mq_send(mqFd, &zero, 1, 0);
- epollAdd(mqFd, 0, this);
-}
-
-EventHandler::~EventHandler() {
- mq_close(mqFd);
- mq_unlink(mqName.c_str());
-}
-
-void EventHandler::mqPut(Event* event) {
- ScopedLock l(*this);
- assert(event != 0);
- mqEvents.push(event);
- epollMod(mqFd, EPOLLIN|EPOLLONESHOT, this);
-}
-
-Event* EventHandler::mqGet() {
- ScopedLock l(*this);
- if (mqEvents.empty())
- return 0;
- Event* event = mqEvents.front();
- mqEvents.pop();
- if(!mqEvents.empty())
- epollMod(mqFd, EPOLLIN|EPOLLONESHOT, this);
- return event;
-}
-
-void EventHandler::epollAdd(int fd, uint32_t epollEvents, Event* event)
-{
- ZeroStruct<struct epoll_event> ee;
- ee.data.ptr = event;
- ee.events = epollEvents;
- if (epoll_ctl(epollFd, EPOLL_CTL_ADD, fd, &ee) < 0)
- throw QPID_POSIX_ERROR(errno);
-}
-
-void EventHandler::epollMod(int fd, uint32_t epollEvents, Event* event)
-{
- ZeroStruct<struct epoll_event> ee;
- ee.data.ptr = event;
- ee.events = epollEvents;
- if (epoll_ctl(epollFd, EPOLL_CTL_MOD, fd, &ee) < 0)
- throw QPID_POSIX_ERROR(errno);
-}
-
-void EventHandler::epollDel(int fd) {
- if (epoll_ctl(epollFd, EPOLL_CTL_DEL, fd, 0) < 0)
- throw QPID_POSIX_ERROR(errno);
-}
-
-Event* EventHandler::complete(EventHandler& eh)
-{
- assert(&eh == this);
- Event* event = mqGet();
- return event==0 ? 0 : event->complete(eh);
-}
-
-// ================================================================
-// EventChannel
-
-EventChannel::shared_ptr EventChannel::create() {
- return shared_ptr(new EventChannel());
-}
-
-EventChannel::EventChannel() : handler(new EventHandler()) {}
-
-EventChannel::~EventChannel() {}
-
-void EventChannel::postEvent(Event& e)
-{
- e.prepare(*handler);
-}
-
-Event* EventChannel::getEvent()
-{
- static const int infiniteTimeout = -1;
- ZeroStruct<struct epoll_event> epollEvent;
-
- // Loop until we can complete the event. Some events may re-post
- // themselves and return 0 from complete, e.g. partial reads. //
- Event* event = 0;
- while (event == 0) {
- int eventCount = epoll_wait(handler->getEpollFd(),
- &epollEvent, 1, infiniteTimeout);
- if (eventCount < 0) {
- if (errno != EINTR) {
- // TODO aconway 2006-11-28: Proper handling/logging of errors.
- cerr << BOOST_CURRENT_FUNCTION << " ignoring error "
- << PosixError::getMessage(errno) << endl;
- assert(0);
- }
- }
- else if (eventCount == 1) {
- event = reinterpret_cast<Event*>(epollEvent.data.ptr);
- assert(event != 0);
- try {
- event = event->complete(*handler);
- }
- catch (const Exception& e) {
- if (event)
- event->setError(e);
- }
- catch (const std::exception& e) {
- if (event)
- event->setError(e);
- }
- }
- }
- return event;
-}
-
-Event::~Event() {}
-
-void Event::prepare(EventHandler& handler)
-{
- handler.mqPut(this);
-}
-
-bool Event::hasError() const {
- return error;
-}
-
-void Event::throwIfError() throw (Exception) {
- if (hasError())
- error.throwSelf();
-}
-
-Event* Event::complete(EventHandler&)
-{
- return this;
-}
-
-void Event::dispatch()
-{
- try {
- if (!callback.empty())
- callback();
- } catch (const std::exception&) {
- throw;
- } catch (...) {
- throw QPID_ERROR(INTERNAL_ERROR, "Unknown exception.");
- }
-}
-
-void Event::setError(const ExceptionHolder& e) {
- error = e;
-}
-
-void ReadEvent::prepare(EventHandler& handler)
-{
- handler.epollAdd(descriptor, EPOLLIN | EPOLLONESHOT, this);
-}
-
-ssize_t ReadEvent::doRead() {
- ssize_t n = ::read(descriptor, static_cast<char*>(buffer) + received,
- size - received);
- if (n > 0) received += n;
- return n;
-}
-
-Event* ReadEvent::complete(EventHandler& handler)
-{
- // Read as much as possible without blocking.
- ssize_t n = doRead();
- while (n > 0 && received < size) doRead();
-
- if (received == size) {
- handler.epollDel(descriptor);
- received = 0; // Reset for re-use.
- return this;
- }
- else if (n <0 && (errno == EAGAIN)) {
- // Keep polling for more.
- handler.epollMod(descriptor, EPOLLIN | EPOLLONESHOT, this);
- return 0;
- }
- else {
- // Unexpected EOF or error. Throw ENODATA for EOF.
- handler.epollDel(descriptor);
- received = 0; // Reset for re-use.
- throw QPID_POSIX_ERROR((n < 0) ? errno : ENODATA);
- }
-}
-
-void WriteEvent::prepare(EventHandler& handler)
-{
- handler.epollAdd(descriptor, EPOLLOUT | EPOLLONESHOT, this);
-}
-
-Event* WriteEvent::complete(EventHandler& handler)
-{
- ssize_t n = write(descriptor, static_cast<const char*>(buffer) + written,
- size - written);
- if (n < 0) throw QPID_POSIX_ERROR(errno);
- written += n;
- if(written < size) {
- // Keep polling.
- handler.epollMod(descriptor, EPOLLOUT | EPOLLONESHOT, this);
- return 0;
- }
- written = 0; // Reset for re-use.
- handler.epollDel(descriptor);
- return this;
-}
-
-void AcceptEvent::prepare(EventHandler& handler)
-{
- handler.epollAdd(descriptor, EPOLLIN | EPOLLONESHOT, this);
-}
-
-Event* AcceptEvent::complete(EventHandler& handler)
-{
- handler.epollDel(descriptor);
- accepted = ::accept(descriptor, 0, 0);
- if (accepted < 0) throw QPID_POSIX_ERROR(errno);
- return this;
-}
-
-}}
diff --git a/Final/cpp/lib/common/sys/posix/EventChannel.h b/Final/cpp/lib/common/sys/posix/EventChannel.h
deleted file mode 100644
index 56c1d1549d..0000000000
--- a/Final/cpp/lib/common/sys/posix/EventChannel.h
+++ /dev/null
@@ -1,179 +0,0 @@
-#ifndef _sys_EventChannel_h
-#define _sys_EventChannel_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 <SharedObject.h>
-#include <ExceptionHolder.h>
-#include <boost/function.hpp>
-#include <memory>
-
-namespace qpid {
-namespace sys {
-
-class Event;
-class EventHandler;
-class EventChannel;
-
-/**
- * Base class for all Events.
- */
-class Event
-{
- public:
- /** Type for callback when event is dispatched */
- typedef boost::function0<void> Callback;
-
- /**
- * Create an event with optional callback.
- * Instances of Event are sent directly through the channel.
- * Derived classes define additional waiting behaviour.
- *@param cb A callback functor that is invoked when dispatch() is called.
- */
- Event(Callback cb = 0) : callback(cb) {}
-
- virtual ~Event();
-
- /** Call the callback provided to the constructor, if any. */
- void dispatch();
-
- /** True if there was an error processing this event */
- bool hasError() const;
-
- /** If hasError() throw the corresponding exception. */
- void throwIfError() throw(Exception);
-
- protected:
- virtual void prepare(EventHandler&);
- virtual Event* complete(EventHandler&);
- void setError(const ExceptionHolder& e);
-
- Callback callback;
- ExceptionHolder error;
-
- friend class EventChannel;
- friend class EventHandler;
-};
-
-template <class BufT>
-class IOEvent : public Event {
- public:
- void getDescriptor() const { return descriptor; }
- size_t getSize() const { return size; }
- BufT getBuffer() const { return buffer; }
-
- protected:
- IOEvent(int fd, Callback cb, size_t sz, BufT buf) :
- Event(cb), descriptor(fd), buffer(buf), size(sz) {}
-
- int descriptor;
- BufT buffer;
- size_t size;
-};
-
-/** Asynchronous read event */
-class ReadEvent : public IOEvent<void*>
-{
- public:
- explicit ReadEvent(int fd=-1, void* buf=0, size_t sz=0, Callback cb=0) :
- IOEvent<void*>(fd, cb, sz, buf), received(0) {}
-
- private:
- void prepare(EventHandler&);
- Event* complete(EventHandler&);
- ssize_t doRead();
-
- size_t received;
-};
-
-/** Asynchronous write event */
-class WriteEvent : public IOEvent<const void*>
-{
- public:
- explicit WriteEvent(int fd=-1, const void* buf=0, size_t sz=0,
- Callback cb=0) :
- IOEvent<const void*>(fd, cb, sz, buf), written(0) {}
-
- protected:
- void prepare(EventHandler&);
- Event* complete(EventHandler&);
-
- private:
- ssize_t doWrite();
- size_t written;
-};
-
-/** Asynchronous socket accept event */
-class AcceptEvent : public Event
-{
- public:
- /** Accept a connection on fd. */
- explicit AcceptEvent(int fd=-1, Callback cb=0) :
- Event(cb), descriptor(fd), accepted(0) {}
-
- /** Get descriptor for server socket */
- int getAcceptedDesscriptor() const { return accepted; }
-
- private:
- void prepare(EventHandler&);
- Event* complete(EventHandler&);
-
- int descriptor;
- int accepted;
-};
-
-
-class QueueSet;
-
-/**
- * Channel to post and wait for events.
- */
-class EventChannel : public qpid::SharedObject<EventChannel>
-{
- public:
- static shared_ptr create();
-
- ~EventChannel();
-
- /** Post an event to the channel. */
- void postEvent(Event& event);
-
- /** Post an event to the channel. Must not be 0. */
- void postEvent(Event* event) { postEvent(*event); }
-
- /**
- * Wait for the next complete event.
- *@return Pointer to event. Will never return 0.
- */
- Event* getEvent();
-
- private:
- EventChannel();
- boost::shared_ptr<EventHandler> handler;
-};
-
-
-}}
-
-
-
-#endif /*!_sys_EventChannel_h*/
diff --git a/Final/cpp/lib/common/sys/posix/EventChannelAcceptor.cpp b/Final/cpp/lib/common/sys/posix/EventChannelAcceptor.cpp
deleted file mode 100644
index 7cd6f60902..0000000000
--- a/Final/cpp/lib/common/sys/posix/EventChannelAcceptor.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 <iostream>
-
-#include <boost/assert.hpp>
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/ptr_container/ptr_deque.hpp>
-#include <boost/bind.hpp>
-#include <boost/scoped_ptr.hpp>
-
-#include <sys/SessionContext.h>
-#include <sys/SessionHandler.h>
-#include <sys/SessionHandlerFactory.h>
-#include <sys/Acceptor.h>
-#include <sys/Socket.h>
-#include <framing/Buffer.h>
-#include <framing/AMQFrame.h>
-#include <Exception.h>
-
-#include "EventChannelConnection.h"
-
-namespace qpid {
-namespace sys {
-
-using namespace qpid::framing;
-using namespace std;
-
-class EventChannelAcceptor : public Acceptor {
- public:
-
-
- EventChannelAcceptor(
- int16_t port_, int backlog, int nThreads, bool trace_
- );
-
- int getPort() const;
-
- void run(SessionHandlerFactory& factory);
-
- void shutdown();
-
- private:
-
- void accept();
-
- Mutex lock;
- Socket listener;
- const int port;
- const bool isTrace;
- bool isRunning;
- boost::ptr_vector<EventChannelConnection> connections;
- AcceptEvent acceptEvent;
- SessionHandlerFactory* factory;
- bool isShutdown;
- EventChannelThreads::shared_ptr threads;
-};
-
-Acceptor::shared_ptr Acceptor::create(
- int16_t port, int backlog, int threads, bool trace)
-{
- return Acceptor::shared_ptr(
- new EventChannelAcceptor(port, backlog, threads, trace));
-}
-
-// Must define Acceptor virtual dtor.
-Acceptor::~Acceptor() {}
-
-EventChannelAcceptor::EventChannelAcceptor(
- int16_t port_, int backlog, int nThreads, bool trace_
-) : listener(Socket::createTcp()),
- port(listener.listen(int(port_), backlog)),
- isTrace(trace_),
- isRunning(false),
- acceptEvent(listener.fd(),
- boost::bind(&EventChannelAcceptor::accept, this)),
- factory(0),
- isShutdown(false),
- threads(EventChannelThreads::create(EventChannel::create(), nThreads))
-{ }
-
-int EventChannelAcceptor::getPort() const {
- return port; // Immutable no need for lock.
-}
-
-void EventChannelAcceptor::run(SessionHandlerFactory& f) {
- {
- Mutex::ScopedLock l(lock);
- if (!isRunning && !isShutdown) {
- isRunning = true;
- factory = &f;
- threads->post(acceptEvent);
- }
- }
- threads->join(); // Wait for shutdown.
-}
-
-void EventChannelAcceptor::shutdown() {
- bool doShutdown = false;
- {
- Mutex::ScopedLock l(lock);
- doShutdown = !isShutdown; // I'm the shutdown thread.
- isShutdown = true;
- }
- if (doShutdown) {
- ::close(acceptEvent.getDescriptor());
- threads->shutdown();
- for_each(connections.begin(), connections.end(),
- boost::bind(&EventChannelConnection::close, _1));
- }
- threads->join();
-}
-
-void EventChannelAcceptor::accept()
-{
- // No lock, we only post one accept event at a time.
- if (isShutdown)
- return;
- if (acceptEvent.getException()) {
- Exception::log(*acceptEvent.getException(),
- "EventChannelAcceptor::accept");
- shutdown();
- return;
- }
- // TODO aconway 2006-11-29: Need to reap closed connections also.
- int fd = acceptEvent.getAcceptedDesscriptor();
- connections.push_back(
- new EventChannelConnection(threads, *factory, fd, fd, isTrace));
- threads->post(acceptEvent); // Keep accepting.
-}
-
-}} // namespace qpid::sys
diff --git a/Final/cpp/lib/common/sys/posix/EventChannelConnection.cpp b/Final/cpp/lib/common/sys/posix/EventChannelConnection.cpp
deleted file mode 100644
index 85014b7bd4..0000000000
--- a/Final/cpp/lib/common/sys/posix/EventChannelConnection.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 <iostream>
-
-#include <boost/bind.hpp>
-#include <boost/assert.hpp>
-
-#include "EventChannelConnection.h"
-#include "sys/SessionHandlerFactory.h"
-#include "QpidError.h"
-
-using namespace std;
-using namespace qpid;
-using namespace qpid::framing;
-
-namespace qpid {
-namespace sys {
-
-const size_t EventChannelConnection::bufferSize = 65536;
-
-EventChannelConnection::EventChannelConnection(
- EventChannelThreads::shared_ptr threads_,
- SessionHandlerFactory& factory_,
- int rfd,
- int wfd,
- bool isTrace_
-) :
- readFd(rfd),
- writeFd(wfd ? wfd : rfd),
- readCallback(boost::bind(&EventChannelConnection::closeOnException,
- this, &EventChannelConnection::endInitRead)),
-
- isWriting(false),
- isClosed(false),
- threads(threads_),
- handler(factory_.create(this)),
- in(bufferSize),
- out(bufferSize),
- isTrace(isTrace_)
-{
- BOOST_ASSERT(readFd > 0);
- BOOST_ASSERT(writeFd > 0);
- closeOnException(&EventChannelConnection::startRead);
-}
-
-
-void EventChannelConnection::send(std::auto_ptr<AMQFrame> frame) {
- {
- Monitor::ScopedLock lock(monitor);
- assert(frame.get());
- writeFrames.push_back(frame.release());
- }
- closeOnException(&EventChannelConnection::startWrite);
-}
-
-void EventChannelConnection::close() {
- {
- Monitor::ScopedLock lock(monitor);
- if (isClosed)
- return;
- isClosed = true;
- }
- ::close(readFd);
- ::close(writeFd);
- {
- Monitor::ScopedLock lock(monitor);
- while (busyThreads > 0)
- monitor.wait();
- }
- handler->closed();
-}
-
-void EventChannelConnection::closeNoThrow() {
- Exception::tryCatchLog<void>(
- boost::bind(&EventChannelConnection::close, this),
- false,
- "Exception closing channel"
- );
-}
-
-/**
- * Call f in a try/catch block and close the connection if
- * an exception is thrown.
- */
-void EventChannelConnection::closeOnException(MemberFnPtr f)
-{
- try {
- Exception::tryCatchLog<void>(
- boost::bind(f, this),
- "Closing connection due to exception"
- );
- return;
- } catch (...) {
- // Exception was already logged by tryCatchLog
- closeNoThrow();
- }
-}
-
-// Post the write event.
-// Always called inside closeOnException.
-// Called by endWrite and send, but only one thread writes at a time.
-//
-void EventChannelConnection::startWrite() {
- FrameQueue::auto_type frame;
- {
- Monitor::ScopedLock lock(monitor);
- // Stop if closed or a write event is already in progress.
- if (isClosed || isWriting)
- return;
- if (writeFrames.empty()) {
- isWriting = false;
- return;
- }
- isWriting = true;
- frame = writeFrames.pop_front();
- }
- // No need to lock here - only one thread can be writing at a time.
- out.clear();
- if (isTrace)
- cout << "Send on socket " << writeFd << ": " << *frame << endl;
- frame->encode(out);
- out.flip();
- writeEvent = WriteEvent(
- writeFd, out.start(), out.available(),
- boost::bind(&EventChannelConnection::closeOnException,
- this, &EventChannelConnection::endWrite));
- threads->post(writeEvent);
-}
-
-// ScopedBusy ctor increments busyThreads.
-// dtor decrements and calls monitor.notifyAll if it reaches 0.
-//
-struct EventChannelConnection::ScopedBusy : public AtomicCount::ScopedIncrement
-{
- ScopedBusy(EventChannelConnection& ecc)
- : AtomicCount::ScopedIncrement(
- ecc.busyThreads, boost::bind(&Monitor::notifyAll, &ecc.monitor))
- {}
-};
-
-// Write event completed.
-// Always called by a channel thread inside closeOnException.
-//
-void EventChannelConnection::endWrite() {
- ScopedBusy(*this);
- {
- Monitor::ScopedLock lock(monitor);
- isWriting = false;
- if (isClosed)
- return;
- writeEvent.throwIfException();
- }
- // Check if there's more in to write in the write queue.
- startWrite();
-}
-
-
-// Post the read event.
-// Always called inside closeOnException.
-// Called from ctor and end[Init]Read, so only one call at a time
-// is possible since we only post one read event at a time.
-//
-void EventChannelConnection::startRead() {
- // Non blocking read, as much as we can swallow.
- readEvent = ReadEvent(
- readFd, in.start(), in.available(), readCallback,true);
- threads->post(readEvent);
-}
-
-// Completion of initial read, expect protocolInit.
-// Always called inside closeOnException in channel thread.
-// Only called by one thread at a time.
-void EventChannelConnection::endInitRead() {
- ScopedBusy(*this);
- if (!isClosed) {
- readEvent.throwIfException();
- in.move(readEvent.getBytesRead());
- in.flip();
- ProtocolInitiation protocolInit;
- if(protocolInit.decode(in)){
- handler->initiated(&protocolInit);
- readCallback = boost::bind(
- &EventChannelConnection::closeOnException,
- this, &EventChannelConnection::endRead);
- }
- in.compact();
- // Continue reading.
- startRead();
- }
-}
-
-// Normal reads, expect a frame.
-// Always called inside closeOnException in channel thread.
-void EventChannelConnection::endRead() {
- ScopedBusy(*this);
- if (!isClosed) {
- readEvent.throwIfException();
- in.move(readEvent.getBytesRead());
- in.flip();
- AMQFrame frame;
- while (frame.decode(in)) {
- // TODO aconway 2006-11-30: received should take Frame&
- if (isTrace)
- cout << "Received on socket " << readFd
- << ": " << frame << endl;
- handler->received(&frame);
- }
- in.compact();
- startRead();
- }
-}
-
-}} // namespace qpid::sys
diff --git a/Final/cpp/lib/common/sys/posix/EventChannelConnection.h b/Final/cpp/lib/common/sys/posix/EventChannelConnection.h
deleted file mode 100644
index da190b0213..0000000000
--- a/Final/cpp/lib/common/sys/posix/EventChannelConnection.h
+++ /dev/null
@@ -1,105 +0,0 @@
-#ifndef _posix_EventChannelConnection_h
-#define _posix_EventChannelConnection_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/ptr_container/ptr_deque.hpp>
-
-#include "EventChannelThreads.h"
-#include "sys/Monitor.h"
-#include "sys/SessionContext.h"
-#include "sys/SessionHandler.h"
-#include "sys/AtomicCount.h"
-#include "framing/AMQFrame.h"
-
-namespace qpid {
-namespace sys {
-
-class SessionHandlerFactory;
-
-/**
- * Implements SessionContext and delegates to a SessionHandler
- * for a connection via the EventChannel.
- *@param readDescriptor file descriptor for reading.
- *@param writeDescriptor file descriptor for writing,
- * by default same as readDescriptor
- */
-class EventChannelConnection : public SessionContext {
- public:
- EventChannelConnection(
- EventChannelThreads::shared_ptr threads,
- SessionHandlerFactory& factory,
- int readDescriptor,
- int writeDescriptor = 0,
- bool isTrace = false
- );
-
- // TODO aconway 2006-11-30: SessionContext::send should take auto_ptr
- virtual void send(qpid::framing::AMQFrame* frame) {
- send(std::auto_ptr<qpid::framing::AMQFrame>(frame));
- }
-
- virtual void send(std::auto_ptr<qpid::framing::AMQFrame> frame);
-
- virtual void close();
-
- private:
- typedef boost::ptr_deque<qpid::framing::AMQFrame> FrameQueue;
- typedef void (EventChannelConnection::*MemberFnPtr)();
- struct ScopedBusy;
-
- void startWrite();
- void endWrite();
- void startRead();
- void endInitRead();
- void endRead();
- void closeNoThrow();
- void closeOnException(MemberFnPtr);
- bool shouldContinue(bool& flag);
-
- static const size_t bufferSize;
-
- Monitor monitor;
-
- int readFd, writeFd;
- ReadEvent readEvent;
- WriteEvent writeEvent;
- Event::Callback readCallback;
- bool isWriting;
- bool isClosed;
- AtomicCount busyThreads;
-
- EventChannelThreads::shared_ptr threads;
- std::auto_ptr<SessionHandler> handler;
- qpid::framing::Buffer in, out;
- FrameQueue writeFrames;
- bool isTrace;
-
- friend struct ScopedBusy;
-};
-
-
-}} // namespace qpid::sys
-
-
-
-#endif /*!_posix_EventChannelConnection_h*/
diff --git a/Final/cpp/lib/common/sys/posix/EventChannelThreads.cpp b/Final/cpp/lib/common/sys/posix/EventChannelThreads.cpp
deleted file mode 100644
index fe8a290729..0000000000
--- a/Final/cpp/lib/common/sys/posix/EventChannelThreads.cpp
+++ /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.
- *
- */
-
-#include "EventChannelThreads.h"
-#include <sys/Runnable.h>
-#include <iostream>
-using namespace std;
-#include <boost/bind.hpp>
-
-namespace qpid {
-namespace sys {
-
-EventChannelThreads::shared_ptr EventChannelThreads::create(
- EventChannel::shared_ptr ec)
-{
- return EventChannelThreads::shared_ptr(new EventChannelThreads(ec));
-}
-
-EventChannelThreads::EventChannelThreads(EventChannel::shared_ptr ec) :
- channel(ec), nWaiting(0), state(RUNNING)
-{
- // TODO aconway 2006-11-15: Estimate initial threads based on CPUs.
- addThread();
-}
-
-EventChannelThreads::~EventChannelThreads() {
- shutdown();
- join();
-}
-
-void EventChannelThreads::shutdown()
-{
- ScopedLock lock(*this);
- if (state != RUNNING) // Already shutting down.
- return;
- for (size_t i = 0; i < workers.size(); ++i) {
- channel->postEvent(terminate);
- }
- state = TERMINATE_SENT;
- notify(); // Wake up one join() thread.
-}
-
-void EventChannelThreads::join()
-{
- {
- ScopedLock lock(*this);
- while (state == RUNNING) // Wait for shutdown to start.
- wait();
- if (state == SHUTDOWN) // Shutdown is complete
- return;
- if (state == JOINING) {
- // Someone else is doing the join.
- while (state != SHUTDOWN)
- wait();
- return;
- }
- // I'm the joining thread
- assert(state == TERMINATE_SENT);
- state = JOINING;
- } // Drop the lock.
-
- for (size_t i = 0; i < workers.size(); ++i) {
- assert(state == JOINING); // Only this thread can change JOINING.
- workers[i].join();
- }
- state = SHUTDOWN;
- notifyAll(); // Notify other join() threaeds.
-}
-
-void EventChannelThreads::addThread() {
- ScopedLock l(*this);
- workers.push_back(Thread(*this));
-}
-
-void EventChannelThreads::run()
-{
- // Start life waiting. Decrement on exit.
- AtomicCount::ScopedIncrement inc(nWaiting);
- try {
- while (true) {
- Event* e = channel->getEvent();
- assert(e != 0);
- if (e == &terminate) {
- return;
- }
- AtomicCount::ScopedDecrement dec(nWaiting);
- // I'm no longer waiting, make sure someone is.
- if (dec == 0)
- addThread();
- e->dispatch();
- }
- }
- catch (const std::exception& e) {
- // TODO aconway 2006-11-15: need better logging across the board.
- std::cerr << "EventChannelThreads::run() caught: " << e.what()
- << std::endl;
- }
- catch (...) {
- std::cerr << "EventChannelThreads::run() caught unknown exception."
- << std::endl;
- }
-}
-
-}}
diff --git a/Final/cpp/lib/common/sys/posix/EventChannelThreads.h b/Final/cpp/lib/common/sys/posix/EventChannelThreads.h
deleted file mode 100644
index e28190e0ed..0000000000
--- a/Final/cpp/lib/common/sys/posix/EventChannelThreads.h
+++ /dev/null
@@ -1,95 +0,0 @@
-#ifndef _posix_EventChannelThreads_h
-#define _sys_EventChannelThreads_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 <Exception.h>
-#include <sys/Time.h>
-#include <sys/Monitor.h>
-#include <sys/Thread.h>
-#include <sys/AtomicCount.h>
-#include "EventChannel.h"
-
-namespace qpid {
-namespace sys {
-
-/**
- Dynamic thread pool serving an EventChannel.
-
- Threads run a loop { e = getEvent(); e->dispatch(); }
- The size of the thread pool is automatically adjusted to optimal size.
-*/
-class EventChannelThreads :
- public qpid::SharedObject<EventChannelThreads>,
- public sys::Monitor, private sys::Runnable
-{
- public:
- /** Create the thread pool and start initial threads. */
- static EventChannelThreads::shared_ptr create(
- EventChannel::shared_ptr channel
- );
-
- ~EventChannelThreads();
-
- /** Post event to the underlying channel */
- void postEvent(Event& event) { channel->postEvent(event); }
-
- /** Post event to the underlying channel Must not be 0. */
- void postEvent(Event* event) { channel->postEvent(event); }
-
- /**
- * Terminate all threads.
- *
- * Returns immediately, use join() to wait till all threads are
- * shut down.
- */
- void shutdown();
-
- /** Wait for all threads to terminate. */
- void join();
-
- private:
- typedef std::vector<sys::Thread> Threads;
- typedef enum {
- RUNNING, TERMINATE_SENT, JOINING, SHUTDOWN
- } State;
-
- EventChannelThreads(EventChannel::shared_ptr underlyingChannel);
- void addThread();
-
- void run();
- bool keepRunning();
- void adjustThreads();
-
- EventChannel::shared_ptr channel;
- Threads workers;
- sys::AtomicCount nWaiting;
- State state;
- Event terminate;
-};
-
-
-}}
-
-
-#endif /*!_sys_EventChannelThreads_h*/
diff --git a/Final/cpp/lib/common/sys/posix/PosixAcceptor.cpp b/Final/cpp/lib/common/sys/posix/PosixAcceptor.cpp
deleted file mode 100644
index 842aa76f36..0000000000
--- a/Final/cpp/lib/common/sys/posix/PosixAcceptor.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 <sys/Acceptor.h>
-#include <Exception.h>
-
-namespace qpid {
-namespace sys {
-
-namespace {
-void fail() { throw qpid::Exception("PosixAcceptor not implemented"); }
-}
-
-class PosixAcceptor : public Acceptor {
- public:
- virtual int16_t getPort() const { fail(); return 0; }
- virtual void run(qpid::sys::SessionHandlerFactory* ) { fail(); }
- virtual void shutdown() { fail(); }
-};
-
-// Define generic Acceptor::create() to return APRAcceptor.
- Acceptor::shared_ptr Acceptor::create(int16_t , int, int, bool)
-{
- return Acceptor::shared_ptr(new PosixAcceptor());
-}
-
-// Must define Acceptor virtual dtor.
-Acceptor::~Acceptor() {}
-
-}}
diff --git a/Final/cpp/lib/common/sys/posix/Socket.cpp b/Final/cpp/lib/common/sys/posix/Socket.cpp
deleted file mode 100644
index e27ced9161..0000000000
--- a/Final/cpp/lib/common/sys/posix/Socket.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 <sys/socket.h>
-#include <sys/errno.h>
-#include <netinet/in.h>
-#include <netdb.h>
-
-#include <boost/format.hpp>
-
-#include <QpidError.h>
-#include <posix/check.h>
-#include <sys/Socket.h>
-
-using namespace qpid::sys;
-
-Socket Socket::createTcp()
-{
- int s = ::socket (PF_INET, SOCK_STREAM, 0);
- if (s < 0) throw QPID_POSIX_ERROR(errno);
- return s;
-}
-
-Socket::Socket(int descriptor) : socket(descriptor) {}
-
-void Socket::setTimeout(Time interval)
-{
- struct timeval tv;
- tv.tv_sec = interval/TIME_SEC;
- tv.tv_usec = (interval%TIME_SEC)/TIME_USEC;
- setsockopt(socket, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
- setsockopt(socket, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv));
-}
-
-void Socket::connect(const std::string& host, int port)
-{
- struct sockaddr_in name;
- name.sin_family = AF_INET;
- name.sin_port = htons(port);
- struct hostent* hp = gethostbyname ( host.c_str() );
- if (hp == 0) throw QPID_POSIX_ERROR(errno);
- memcpy(&name.sin_addr.s_addr, hp->h_addr_list[0], hp->h_length);
- if (::connect(socket, (struct sockaddr*)(&name), sizeof(name)) < 0)
- throw QPID_POSIX_ERROR(errno);
-}
-
-void
-Socket::close()
-{
- if (socket == 0) return;
- if (::close(socket) < 0) throw QPID_POSIX_ERROR(errno);
- socket = 0;
-}
-
-ssize_t
-Socket::send(const void* data, size_t size)
-{
- ssize_t sent = ::send(socket, data, size, 0);
- if (sent < 0) {
- if (errno == ECONNRESET) return SOCKET_EOF;
- if (errno == ETIMEDOUT) return SOCKET_TIMEOUT;
- throw QPID_POSIX_ERROR(errno);
- }
- return sent;
-}
-
-ssize_t
-Socket::recv(void* data, size_t size)
-{
- ssize_t received = ::recv(socket, data, size, 0);
- if (received < 0) {
- if (errno == ETIMEDOUT) return SOCKET_TIMEOUT;
- throw QPID_POSIX_ERROR(errno);
- }
- return received;
-}
-
-int Socket::listen(int port, int backlog)
-{
- 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 QPID_POSIX_ERROR(errno);
- if (::listen(socket, backlog) < 0)
- throw QPID_POSIX_ERROR(errno);
-
- socklen_t namelen = sizeof(name);
- if (::getsockname(socket, (struct sockaddr*)&name, &namelen) < 0)
- throw QPID_POSIX_ERROR(errno);
-
- return ntohs(name.sin_port);
-}
-
-
-int Socket::fd()
-{
- return socket;
-}
-
-void Socket::setTcpNoDelay(bool) {} //not yet implemented
diff --git a/Final/cpp/lib/common/sys/posix/Thread.cpp b/Final/cpp/lib/common/sys/posix/Thread.cpp
deleted file mode 100644
index 7291022dc6..0000000000
--- a/Final/cpp/lib/common/sys/posix/Thread.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 <sys/Thread.h>
-
-void* qpid::sys::Thread::runRunnable(void* p)
-{
- static_cast<Runnable*>(p)->run();
- return 0;
-}
-
-Thread::~Thread() {
-}
diff --git a/Final/cpp/lib/common/sys/posix/check.cpp b/Final/cpp/lib/common/sys/posix/check.cpp
deleted file mode 100644
index 408679caa8..0000000000
--- a/Final/cpp/lib/common/sys/posix/check.cpp
+++ /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.
- *
- */
-
-#include <cerrno>
-#include "check.h"
-
-namespace qpid {
-namespace sys {
-
-std::string
-PosixError::getMessage(int errNo)
-{
- char buf[512];
- return std::string(strerror_r(errNo, buf, sizeof(buf)));
-}
-
-PosixError::PosixError(int errNo, const qpid::SrcLine& loc) throw()
- : qpid::QpidError(INTERNAL_ERROR + errNo, getMessage(errNo), loc)
-{ }
-
-}}
diff --git a/Final/cpp/lib/common/sys/posix/check.h b/Final/cpp/lib/common/sys/posix/check.h
deleted file mode 100644
index 5afbe8f5a8..0000000000
--- a/Final/cpp/lib/common/sys/posix/check.h
+++ /dev/null
@@ -1,62 +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 <cerrno>
-#include <string>
-#include <QpidError.h>
-
-namespace qpid {
-namespace sys {
-
-/**
- * Exception with message from errno.
- */
-class PosixError : public qpid::QpidError
-{
- public:
- static std::string getMessage(int errNo);
-
- PosixError(int errNo, const qpid::SrcLine& location) throw();
-
- ~PosixError() throw() {}
-
- int getErrNo() { return errNo; }
-
- Exception* clone() const throw() { return new PosixError(*this); }
-
- void throwSelf() { throw *this; }
-
- private:
- int errNo;
-};
-
-}}
-
-/** Create a PosixError for the current file/line and errno. */
-#define QPID_POSIX_ERROR(errNo) ::qpid::sys::PosixError(errNo, SRCLINE)
-
-/** Throw a posix error if errNo is non-zero */
-#define QPID_POSIX_THROW_IF(ERRNO) \
- if ((ERRNO) != 0) throw QPID_POSIX_ERROR((ERRNO))
-#endif /*!_posix_check_h*/
diff --git a/Final/cpp/m4/clock_time.m4 b/Final/cpp/m4/clock_time.m4
deleted file mode 100644
index 227a5978e5..0000000000
--- a/Final/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/Final/cpp/m4/compiler-flags.m4 b/Final/cpp/m4/compiler-flags.m4
deleted file mode 100644
index 01cb728f02..0000000000
--- a/Final/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/Final/cpp/m4/cppunit.m4 b/Final/cpp/m4/cppunit.m4
deleted file mode 100644
index f009086f9d..0000000000
--- a/Final/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/Final/cpp/m4/extensions.m4 b/Final/cpp/m4/extensions.m4
deleted file mode 100644
index 143a9e5403..0000000000
--- a/Final/cpp/m4/extensions.m4
+++ /dev/null
@@ -1,58 +0,0 @@
-# serial 4 -*- Autoconf -*-
-# Enable extensions on systems that normally disable them.
-
-# Copyright (C) 2003, 2006 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.
-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/Final/cpp/make-dist b/Final/cpp/make-dist
deleted file mode 100755
index 595b89f969..0000000000
--- a/Final/cpp/make-dist
+++ /dev/null
@@ -1,101 +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/Final/cpp/qpid-autotools-install b/Final/cpp/qpid-autotools-install
deleted file mode 100755
index 19f20ff5e8..0000000000
--- a/Final/cpp/qpid-autotools-install
+++ /dev/null
@@ -1,223 +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.
-#
-# Written by Jim Meyering
-
-VERSION='2007-01-22 19:38' # 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.8.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.22.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
-17353e66aeaac80ae188ea0a3a90609550ce3254 libtool-1.5.22.tar.gz
-32b5bb526de9315d1a319c2ca8eb881d9b835506 m4-1.4.8.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/Final/cpp/qpidc.spec.in b/Final/cpp/qpidc.spec.in
deleted file mode 100644
index b7f06b159f..0000000000
--- a/Final/cpp/qpidc.spec.in
+++ /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.
-#
-#
-# Spec file for Qpid C++ packages: qpidc qpidc-devel, qpidd
-#
-%define daemon qpidd
-
-Name: @PACKAGE@
-Version: @VERSION@
-Release: 5%{?dist}
-Summary: Libraries for Qpid C++ client applications
-Group: System Environment/Libraries
-License: Apache Software License
-URL: http://rhm.et.redhat.com/qpidc/
-Source0: http://rhm.et.redhat.com/download/%{name}-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-BuildRequires: apr-devel
-BuildRequires: boost-devel
-BuildRequires: cppunit-devel
-BuildRequires: doxygen
-BuildRequires: e2fsprogs-devel
-BuildRequires: graphviz
-BuildRequires: help2man
-BuildRequires: libtool
-BuildRequires: pkgconfig
-
-Requires: boost
-
-Requires(post):/sbin/chkconfig
-Requires(preun):/sbin/chkconfig
-Requires(preun):/sbin/service
-Requires(postun):/sbin/service
-
-%description
-Run-time libraries for AMQP client applications developed using Qpid
-C++. Clients exchange messages with an AMQP message broker using
-the AMQP protocol.
-
-%package devel
-Summary: Header files and documentation for developing Qpid C++ clients
-Group: Development/System
-Requires: %name = %version-%release
-Requires: libtool
-Requires: apr-devel
-Requires: boost-devel
-Requires: cppunit-devel
-
-%description devel
-Libraries, header files and documentation for developing AMQP clients
-in C++ using Qpid. Qpid implements the AMQP messaging specification.
-
-%package -n %{daemon}
-Summary: An AMQP message broker daemon
-Group: System Environment/Daemons
-Requires: %name = %version-%release
-
-%description -n %{daemon}
-A message broker daemon that receives stores and routes messages using
-the open AMQP messaging protocol.
-
-%prep
-%setup -q
-
-%build
-%configure --disable-static
-make %{?_smp_mflags}
-# Remove this generated perl file, we don't need it and it upsets rpmlint.
-rm docs/api/html/installdox
-
-%install
-rm -rf %{buildroot}
-make install DESTDIR=%{buildroot}
-install -Dp -m0755 etc/qpidd %{buildroot}%{_initrddir}/qpidd
-rm -f %{buildroot}%_libdir/*.a
-rm -f %{buildroot}%_libdir/*.la
-# There's no qpidd-devel package so no .so for the broker needed.
-rm -f %{buildroot}%_libdir/libqpidbroker.so
-
-
-%clean
-rm -rf %{buildroot}
-
-%check
-make check
-
-%files
-%defattr(-,root,root,-)
-%doc LICENSE NOTICE README
-%_libdir/libqpidcommon.so.0
-%_libdir/libqpidcommon.so.0.1.0
-%_libdir/libqpidclient.so.0
-%_libdir/libqpidclient.so.0.1.0
-
-%files devel
-%defattr(-,root,root,-)
-%_includedir/qpidc
-%_libdir/libqpidcommon.so
-%_libdir/libqpidclient.so
-%doc docs/api/html
-# We don't need this perl script and it causes rpmlint to complain.
-# There is probably a more polite way of calculating the devel docdir.
-
-%files -n %{daemon}
-%_libdir/libqpidbroker.so.0
-%_libdir/libqpidbroker.so.0.1.0
-%_sbindir/%{daemon}
-%{_initrddir}/qpidd
-%doc %_mandir/man1/%{daemon}.*
-
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
-
-%post -n %{daemon}
-# This adds the proper /etc/rc*.d links for the script
-/sbin/chkconfig --add qpidd
-/sbin/ldconfig
-
-%preun -n %{daemon}
-# Check that this is actual deinstallation, not just removing for upgrade.
-if [ $1 = 0 ]; then
- /sbin/service qpidd stop >/dev/null 2>&1 || :
- /sbin/chkconfig --del qpidd
-fi
-
-%postun -n %{daemon}
-if [ "$1" -ge "1" ]; then
- /sbin/service qpidd condrestart >/dev/null 2>&1 || :
-fi
-/sbin/ldconfig
-
-%changelog
-* Mon Apr 30 2007 Alan Conway <aconway@redhat.com> - 0.1-5.M2
-- Added M2 release tag.
-
-* Mon Feb 19 2007 Jim Meyering <meyering@redhat.com> - 0.1-4
-- Address http://bugzilla.redhat.com/220630:
-- Remove redundant "cppunit" build-requires.
-- Add --disable-static.
-
-* Thu Jan 25 2007 Alan Conway <aconway@redhat.com> - 0.1-3
-- Applied Jim Meyerings fixes from http://mail-archives.apache.org/mod_mbox/incubator-qpid-dev/200701.mbox/%3c87hcugzmyp.fsf@rho.meyering.net%3e
-
-* Mon Dec 22 2006 Alan Conway <aconway@redhat.com> - 0.1-1
-- Fixed all rpmlint complaints (with help from David Lutterkort)
-- Added qpidd --daemon behaviour, fix init.rc scripts
-
-* Fri Dec 8 2006 David Lutterkort <dlutter@redhat.com> - 0.1-1
-- Initial version based on Jim Meyering's sketch and discussions with Alan
- Conway
diff --git a/Final/cpp/rpm/Makefile.am b/Final/cpp/rpm/Makefile.am
deleted file mode 100644
index 159a5cd4c2..0000000000
--- a/Final/cpp/rpm/Makefile.am
+++ /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.
-#
-#
-# Build RPMs from the distribution tarball.
-#
-
-abs_top_srcdir=@abs_top_srcdir@
-abs_builddir=@abs_builddir@
-
-SPEC=${top_srcdir}/qpidc.spec
-RPMOPTS=--define "_sourcedir ${abs_top_srcdir}" --define "_topdir ${abs_builddir}" --define "dist .M2"
-
-clean-local:
- -rm -rf BUILD RPMS SOURCES SPECS SRPMS
-
-.PHONY: rpm srpm dist
-
-# Build source and binary RPMs.
-rpm: dist
- rpmbuild $(RPMOPTS) $(RPMEXTRAOPTS) -ba $(SPEC)
- rpmlint RPMS/*/*.rpm
-
-# Build source RPM only.
-srpm: dist
- rpmbuild $(RPMOPTS) -bs $(SPEC)
-
-# Build source distribution and create required subdirs.
-dist:
- cd .. && $(MAKE) $(AM_MAKEFLAGS) dist
- mkdir -p BUILD RPMS SOURCES SPECS SRPMS
diff --git a/Final/cpp/src/Makefile.am b/Final/cpp/src/Makefile.am
deleted file mode 100644
index 6ca6632c77..0000000000
--- a/Final/cpp/src/Makefile.am
+++ /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.
-#
-AM_CXXFLAGS = $(WARNING_CFLAGS)
-
-INCLUDES = \
- -I$(top_srcdir)/gen \
- -I$(top_srcdir)/lib/broker \
- -I$(top_srcdir)/lib/common \
- -I$(top_srcdir)/lib/common/framing \
- -I$(top_srcdir)/lib/common/sys
-
-LDADD = \
- ../lib/broker/libqpidbroker.la \
- ../lib/common/libqpidcommon.la \
- -lboost_program_options
-
-sbin_PROGRAMS = qpidd
-qpidd_SOURCES = qpidd.cpp
-
-# Force build of qpidd during dist phase so help2man will work.
-dist-hook: $(sbin_PROGRAMS)
diff --git a/Final/cpp/src/qpidd.cpp b/Final/cpp/src/qpidd.cpp
deleted file mode 100644
index 2672da87d5..0000000000
--- a/Final/cpp/src/qpidd.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 <Broker.h>
-#include <iostream>
-#include <memory>
-#include <config.h>
-#include <fstream>
-#include <signal.h>
-#include <Daemon.h>
-#include <boost/format.hpp>
-
-using boost::format;
-using namespace qpid;
-using namespace qpid::broker;
-using namespace qpid::sys;
-using namespace std;
-
-/** Command line options */
-struct QpiddOptions : public Broker::Options
-{
- bool help;
- bool version;
- bool daemon;
- bool quit;
- bool kill;
- bool check;
- int wait;
- string config;
- po::options_description desc;
-
- QpiddOptions() :
- help(false), version(false), daemon(false),
- quit(false), kill(false), check(false), wait(10),
- config("/etc/qpidd.conf"),
- desc("Options")
- {
- using namespace po;
- desc.add_options()
- ("daemon,d", optValue(daemon), "Run as a daemon.")
- ("quit,q", optValue(quit), "Stop the running daemon politely.")
- ("kill,k", optValue(kill), "Kill the running daemon harshly.")
- ("check,c", optValue(check), "If daemon is running print PID and return 0.")
- ("wait", optValue(wait, "SECONDS"), "Maximum wait for daemon response.");
- po::options_description brokerOpts;
- Broker::Options::addTo(desc);
- desc.add_options()
- ("config", optValue(config, "FILE"), "Configuation file")
- ("help,h", optValue(help), "Print help message")
- ("version,v", optValue(version), "Print version information");
- }
-
- void parse(int argc, char* argv[]) {
- po::variables_map vm;
- // Earlier sources get precedence.
- po::store(po::parse_command_line(argc, argv, desc), vm);
- try {
- po::store(po::parse_environment(desc, po::EnvMapper(desc)), vm);
- }
- catch (const logic_error& e) {
- throw logic_error(string("parsing environment variables: ")
- + e.what());
- }
- po::notify(vm); // So we can use the value of config.
- try {
- ifstream conf(config.c_str());
- po::store(po::parse_config_file(conf, desc), vm);
- }
- catch (const logic_error& e) {
- throw logic_error(string("parsing config file: ")+ e.what());
- }
- po::notify(vm);
-};
-
- void usage(ostream& out) const {
- out << "Usage: qpidd [OPTIONS]" << endl << endl
- << desc << endl;
- };
-};
-
-ostream& operator<<(ostream& out, const QpiddOptions& config) {
- config.usage(out); return out;
-}
-
-// Globals
-Broker::shared_ptr brokerPtr;
-QpiddOptions options;
-
-void shutdownHandler(int /*signal*/){
- brokerPtr->shutdown();
-}
-
-struct QpiddDaemon : public Daemon {
- /** Code for parent process */
- void parent() {
- uint16_t port = wait(options.wait);
- if (options.port == 0)
- cout << port << endl;
- }
-
- /** Code for forked child process */
- void child() {
- brokerPtr = Broker::create(options);
- uint16_t port=brokerPtr->getPort();
- ready(port); // Notify parent.
- brokerPtr->run();
- }
-};
-
-
-int main(int argc, char* argv[])
-{
- try {
- options.parse(argc, argv);
-
- // Options that just print information.
- if(options.help || options.version) {
- if (options.version)
- cout << "qpidd (" << PACKAGE_NAME << ") version "
- << PACKAGE_VERSION << endl;
- else if (options.help)
- options.usage(cout);
- return 0;
- }
-
- // Options that affect a running daemon.
- if (options.check || options.quit) {
- pid_t pid = Daemon::getPid(options.port);
- if (pid < 0)
- return 1;
- if (options.check)
- cout << pid << endl;
- if (options.quit && kill(pid, SIGINT) < 0)
- throw Exception("Failed to stop daemon: " + strError(errno));
- return 0;
- }
-
- // Starting the broker.
-
- // Signal handling
- signal(SIGINT,shutdownHandler);
- signal(SIGTERM,shutdownHandler);
- signal(SIGHUP,SIG_IGN); // TODO aconway 2007-07-18: reload config.
-
- signal(SIGCHLD,SIG_IGN);
- signal(SIGTSTP,SIG_IGN);
- signal(SIGTTOU,SIG_IGN);
- signal(SIGTTIN,SIG_IGN);
-
- if (options.daemon) {
- // Fork the daemon
- QpiddDaemon d;
- d.fork();
- }
- else { // Non-daemon broker.
- brokerPtr = Broker::create(options);
- if (options.port == 0)
- cout << uint16_t(brokerPtr->getPort()) << endl;
- brokerPtr->run();
- }
- return 0;
- }
- catch(const exception& e) {
- cerr << e.what() << endl;
- }
- return 1;
-}
diff --git a/Final/cpp/tests/.vg-supp b/Final/cpp/tests/.vg-supp
deleted file mode 100644
index bb73c53744..0000000000
--- a/Final/cpp/tests/.vg-supp
+++ /dev/null
@@ -1,2481 +0,0 @@
-{
- x17984_1
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsmj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_2
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid6broker6BrokerEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid6broker6BrokerEEC1IS3_EEPT_
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_3
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid6broker15HeadersExchangeEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid6broker8ExchangeEEC1INS2_15HeadersExchangeEEEPT_
- fun:_ZN4qpid6broker16ExchangeRegistry7declareERKSsS3_
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsmj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_4
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid6broker14FanOutExchangeEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid6broker8ExchangeEEC1INS2_14FanOutExchangeEEEPT_
- fun:_ZN4qpid6broker16ExchangeRegistry7declareERKSsS3_
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsmj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_5
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid6broker13TopicExchangeEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid6broker8ExchangeEEC1INS2_13TopicExchangeEEEPT_
- fun:_ZN4qpid6broker16ExchangeRegistry7declareERKSsS3_
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsmj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_6
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid3sys11APRAcceptorEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid3sys8AcceptorEEC1INS2_11APRAcceptorEEEPT_
- fun:_ZN4qpid3sys8Acceptor6createEsiib
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_7
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid3sys7APRBase11getInstanceEv
- fun:_ZN4qpid3sys7APRBase9incrementEv
- fun:_ZN4qpid3sys7APRPoolC1Ev
- fun:_ZN5boost7details4pool17singleton_defaultIN4qpid3sys7APRPoolEE8instanceEv
- fun:_ZN4qpid3sys7APRPool3getEv
- fun:_Z41__static_initialization_and_destruction_0ii
- obj:/home_old/e/work/rh/rhn/messaging-clean/trunk/qpid-help2man/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- obj:/home_old/e/work/rh/rhn/messaging-clean/trunk/qpid-help2man/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_8
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znam
- fun:_ZN4qpid3sys11LFProcessorC1EP10apr_pool_tiii
- fun:_ZN4qpid3sys11APRAcceptorC1Esiib
- fun:_ZN4qpid3sys8Acceptor6createEsiib
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_9
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid7framing5Value12decode_valueERNS0_6BufferE
- fun:_ZN4qpid7framing10FieldTable6decodeERNS0_6BufferE
- fun:_ZN4qpid7framing6Buffer13getFieldTableERNS0_10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody13decodeContentERNS0_6BufferE
- fun:_ZN4qpid7framing13AMQMethodBody6decodeERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid7framing5ValueEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid7framing5ValueEEC1IS3_EEPT_
- fun:_ZN4qpid7framing10FieldTable6decodeERNS0_6BufferE
- fun:_ZN4qpid7framing6Buffer13getFieldTableERNS0_10FieldTableE
-}
-{
- x17984_10
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid6broker14DirectExchangeEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid6broker8ExchangeEEC1INS2_14DirectExchangeEEEPT_
- fun:_ZN4qpid6broker16ExchangeRegistry7declareERKSsS3_
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsmj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_11
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISsE8allocateEmPKv
- fun:_ZNSt12_Vector_baseISsSaISsEE11_M_allocateEm
- fun:_ZNSt12_Vector_baseISsSaISsEEC2EmRKS0_
- fun:_ZNSt6vectorISsSaISsEEC2ERKS1_
- fun:_ZN4qpid6broker6TokensC2ERKS1_
- fun:_ZN4qpid6broker12TopicPatternC1ERKS1_
- fun:_ZNSt4pairIKN4qpid6broker12TopicPatternESt6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS8_EEEC1ERKSB_
- fun:_ZN9__gnu_cxx13new_allocatorISt4pairIKN4qpid6broker12TopicPatternESt6vectorIN5boost10shared_ptrINS3_5QueueEEESaISA_EEEE9constructEPSD_RKSD_
- fun:_ZNSt8_Rb_treeIN4qpid6broker12TopicPatternESt4pairIKS2_St6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS9_EEESt10_Select1stISC_ESt4lessIS2_ESaISC_EE14_M_create_nodeERKSC_
- fun:_ZNSt8_Rb_treeIN4qpid6broker12TopicPatternESt4pairIKS2_St6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS9_EEESt10_Select1stISC_ESt4lessIS2_ESaISC_EE9_M_insertEPSt18_Rb_tree_node_baseSK_RKSC_
- fun:_ZNSt8_Rb_treeIN4qpid6broker12TopicPatternESt4pairIKS2_St6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS9_EEESt10_Select1stISC_ESt4lessIS2_ESaISC_EE13insert_uniqueERKSC_
- fun:_ZNSt8_Rb_treeIN4qpid6broker12TopicPatternESt4pairIKS2_St6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS9_EEESt10_Select1stISC_ESt4lessIS2_ESaISC_EE13insert_uniqueESt17_Rb_tree_iteratorISC_ERKSC_
- fun:_ZNSt3mapIN4qpid6broker12TopicPatternESt6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS7_EESt4lessIS2_ESaISt4pairIKS2_S9_EEE6insertESt17_Rb_tree_iteratorISE_ERKSE_
- fun:_ZNSt3mapIN4qpid6broker12TopicPatternESt6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS7_EESt4lessIS2_ESaISt4pairIKS2_S9_EEEixERSD_
- fun:_ZN4qpid6broker13TopicExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
-}
-{
- x17984_12
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker16ExchangeRegistry7declareERKSsS3_
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsmj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_13
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIPN5boost10shared_ptrIN4qpid6broker5QueueEEEE8allocateEmPKv
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE15_M_allocate_mapEm
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE17_M_initialize_mapEm
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EEC2ERKS6_m
- fun:_ZNSt5dequeIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EEC1ERKS7_
- fun:_ZNSt5queueIN5boost10shared_ptrIN4qpid6broker5QueueEEESt5dequeIS5_SaIS5_EEEC1ERKS8_
- fun:_ZN4qpid6broker10AutoDeleteC1EPNS0_13QueueRegistryEj
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsmj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_14
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid7framing5Value12decode_valueERNS0_6BufferE
- fun:_ZN4qpid7framing10FieldTable6decodeERNS0_6BufferE
- fun:_ZN4qpid7framing6Buffer13getFieldTableERNS0_10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody13decodeContentERNS0_6BufferE
- fun:_ZN4qpid7framing13AMQMethodBody6decodeERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZNSs4_Rep9_S_createEmmRKSaIcE
- fun:_ZNSs9_M_mutateEmmm
- fun:_ZNSs15_M_replace_safeEmmPKcm
- fun:_ZN4qpid7framing6Buffer13getLongStringERSs
-}
-{
- x17984_15
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEEEE8allocateEmPKv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE11_M_get_nodeEv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE14_M_create_nodeERKS8_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE9_M_insertEPSt18_Rb_tree_node_baseSG_RKS8_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE13insert_uniqueESt17_Rb_tree_iteratorIS8_ERKS8_
- fun:_ZNSt3mapISsN5boost10shared_ptrIN4qpid6broker5QueueEEESt4lessISsESaISt4pairIKSsS5_EEE6insertESt17_Rb_tree_iteratorISA_ERKSA_
- fun:_ZNSt3mapISsN5boost10shared_ptrIN4qpid6broker5QueueEEESt4lessISsESaISt4pairIKSsS5_EEEixERS9_
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
-}
-{
- x17984_16
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIPN4qpid6broker13Configuration6OptionEE8allocateEmPKv
- fun:_ZNSt12_Vector_baseIPN4qpid6broker13Configuration6OptionESaIS4_EE11_M_allocateEm
- fun:_ZNSt6vectorIPN4qpid6broker13Configuration6OptionESaIS4_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS4_S6_EERKS4_
- fun:_ZNSt6vectorIPN4qpid6broker13Configuration6OptionESaIS4_EE9push_backERKS4_
- fun:_ZN4qpid6broker13ConfigurationC1Ev
- fun:main
-}
-{
- x17984_17
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid3sys8Acceptor6createEsiib
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_18
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker14FanOutExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__ZdlPv
- fun:_ZN9__gnu_cxx13new_allocatorIN5boost10shared_ptrIN4qpid6broker5QueueEEEE10deallocateEPS6_m
- fun:_ZNSt12_Vector_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE13_M_deallocateEPS5_m
- fun:_ZNSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS5_S7_EERKS5_
- fun:_ZNSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE9push_backERKS5_
- fun:_ZN4qpid6broker14FanOutExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
-}
-{
- x17984_19
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker15HeadersExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__ZdlPv
- fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEEEE10deallocateEPSB_m
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE11_M_put_nodeEPSt13_Rb_tree_nodeIS8_E
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE12destroy_nodeEPSt13_Rb_tree_nodeIS8_E
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE8_M_eraseEPSt13_Rb_tree_nodeIS8_E
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE8_M_eraseEPSt13_Rb_tree_nodeIS8_E
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EED1Ev
- fun:_ZNSt3mapISsN5boost10shared_ptrIN4qpid7framing5ValueEEESt4lessISsESaISt4pairIKSsS5_EEED1Ev
-}
-{
- x17984_20
- Memcheck:Leak
- fun:_vgrZU_libcZdsoZa_malloc
- fun:apr_allocator_create
- fun:apr_pool_initialize
- fun:apr_initialize
- fun:_ZN4qpid3sys7APRBaseC1Ev
- fun:_ZN4qpid3sys7APRBase11getInstanceEv
- fun:_ZN4qpid3sys7APRBase9incrementEv
- fun:_ZN4qpid3sys7APRPoolC1Ev
- fun:_ZN5boost7details4pool17singleton_defaultIN4qpid3sys7APRPoolEE8instanceEv
- fun:_ZN4qpid3sys7APRPool3getEv
- fun:_Z41__static_initialization_and_destruction_0ii
- obj:/home_old/e/work/rh/rhn/messaging-clean/trunk/qpid-help2man/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- obj:/home_old/e/work/rh/rhn/messaging-clean/trunk/qpid-help2man/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_21
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid7framing5ValueEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid7framing5ValueEEC1IS3_EEPT_
- fun:_ZN4qpid7framing10FieldTable6decodeERNS0_6BufferE
- fun:_ZN4qpid7framing6Buffer13getFieldTableERNS0_10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody13decodeContentERNS0_6BufferE
- fun:_ZN4qpid7framing13AMQMethodBody6decodeERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEEEE8allocateEmPKv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE11_M_get_nodeEv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE14_M_create_nodeERKS8_
-}
-{
- x17984_22
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker13TopicExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__ZdlPv
- fun:_ZN9__gnu_cxx13new_allocatorISsE10deallocateEPSsm
- fun:_ZNSt12_Vector_baseISsSaISsEE13_M_deallocateEPSsm
- fun:_ZNSt12_Vector_baseISsSaISsEED2Ev
- fun:_ZNSt6vectorISsSaISsEED2Ev
- fun:_ZN4qpid6broker6TokensD2Ev
- fun:_ZN4qpid6broker12TopicPatternD1Ev
- fun:_ZN4qpid6broker13TopicExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
-}
-{
- x17984_23
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS2_6broker5QueueEEEEE8allocateEmPKv
- fun:_ZNSt12_Vector_baseISt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS1_6broker5QueueEEEESaIS9_EE11_M_allocateEm
- fun:_ZNSt6vectorISt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS1_6broker5QueueEEEESaIS9_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS9_SB_EERKS9_
- fun:_ZNSt6vectorISt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS1_6broker5QueueEEEESaIS9_EE9push_backERKS9_
- fun:_ZN4qpid6broker15HeadersExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEEEE8allocateEmPKv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE11_M_get_nodeEv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE14_M_create_nodeERKS8_
-}
-{
- x17984_24
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker7Channel8completeERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker14MessageBuilder5routeEv
- fun:_ZN4qpid6broker14MessageBuilder10addContentERN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker7Channel13handleContentEN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl13handleContentEtN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIPN4qpid6broker4TxOpEE8allocateEmPKv
- fun:_ZNSt12_Vector_baseIPN4qpid6broker4TxOpESaIS3_EE11_M_allocateEm
- fun:_ZNSt6vectorIPN4qpid6broker4TxOpESaIS3_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS3_S5_EERKS3_
- fun:_ZNSt6vectorIPN4qpid6broker4TxOpESaIS3_EE9push_backERKS3_
- fun:_ZN4qpid6broker8TxBuffer6enlistEPNS0_4TxOpE
-}
-{
- x17984_25
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_26
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKN4qpid6broker12TopicPatternESt6vectorIN5boost10shared_ptrINS4_5QueueEEESaISB_EEEEE8allocateEmPKv
- fun:_ZNSt8_Rb_treeIN4qpid6broker12TopicPatternESt4pairIKS2_St6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS9_EEESt10_Select1stISC_ESt4lessIS2_ESaISC_EE11_M_get_nodeEv
- fun:_ZNSt8_Rb_treeIN4qpid6broker12TopicPatternESt4pairIKS2_St6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS9_EEESt10_Select1stISC_ESt4lessIS2_ESaISC_EE14_M_create_nodeERKSC_
- fun:_ZNSt8_Rb_treeIN4qpid6broker12TopicPatternESt4pairIKS2_St6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS9_EEESt10_Select1stISC_ESt4lessIS2_ESaISC_EE9_M_insertEPSt18_Rb_tree_node_baseSK_RKSC_
- fun:_ZNSt8_Rb_treeIN4qpid6broker12TopicPatternESt4pairIKS2_St6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS9_EEESt10_Select1stISC_ESt4lessIS2_ESaISC_EE13insert_uniqueERKSC_
- fun:_ZNSt8_Rb_treeIN4qpid6broker12TopicPatternESt4pairIKS2_St6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS9_EEESt10_Select1stISC_ESt4lessIS2_ESaISC_EE13insert_uniqueESt17_Rb_tree_iteratorISC_ERKSC_
- fun:_ZNSt3mapIN4qpid6broker12TopicPatternESt6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS7_EESt4lessIS2_ESaISt4pairIKS2_S9_EEE6insertESt17_Rb_tree_iteratorISE_ERKSE_
- fun:_ZNSt3mapIN4qpid6broker12TopicPatternESt6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS7_EESt4lessIS2_ESaISt4pairIKS2_S9_EEEixERSD_
- fun:_ZN4qpid6broker13TopicExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_27
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIPN4qpid6broker8ConsumerEE8allocateEmPKv
- fun:_ZNSt12_Vector_baseIPN4qpid6broker8ConsumerESaIS3_EE11_M_allocateEm
- fun:_ZNSt6vectorIPN4qpid6broker8ConsumerESaIS3_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS3_S5_EERKS3_
- fun:_ZNSt6vectorIPN4qpid6broker8ConsumerESaIS3_EE9push_backERKS3_
- fun:_ZN4qpid6broker5Queue7consumeEPNS0_8ConsumerEb
- fun:_ZN4qpid6broker7Channel7consumeERSsN5boost10shared_ptrINS0_5QueueEEEbbPNS0_15ConnectionTokenEPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16BasicHandlerImpl7consumeEttRKSsS4_bbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16BasicConsumeBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKSsPN4qpid6broker7Channel12ConsumerImplEEEE8allocateEmPKv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsPN4qpid6broker7Channel12ConsumerImplEESt10_Select1stIS7_ESt4lessISsESaIS7_EE11_M_get_nodeEv
-}
-{
- x17984_28
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKSsN5boost10shared_ptrIN4qpid6broker8ExchangeEEEEEE8allocateEmPKv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker8ExchangeEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE11_M_get_nodeEv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker8ExchangeEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE14_M_create_nodeERKS8_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker8ExchangeEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE9_M_insertEPSt18_Rb_tree_node_baseSG_RKS8_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker8ExchangeEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE13insert_uniqueERKS8_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker8ExchangeEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE13insert_uniqueESt17_Rb_tree_iteratorIS8_ERKS8_
- fun:_ZNSt3mapISsN5boost10shared_ptrIN4qpid6broker8ExchangeEEESt4lessISsESaISt4pairIKSsS5_EEE6insertESt17_Rb_tree_iteratorISA_ERKSA_
- fun:_ZNSt3mapISsN5boost10shared_ptrIN4qpid6broker8ExchangeEEESt4lessISsESaISt4pairIKSsS5_EEEixERS9_
- fun:_ZN4qpid6broker16ExchangeRegistry7declareERKSsS3_
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsmj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_29
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEEEE8allocateEmPKv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE11_M_get_nodeEv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE14_M_create_nodeERKS8_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE13_M_clone_nodeEPKSt13_Rb_tree_nodeIS8_E
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE7_M_copyEPKSt13_Rb_tree_nodeIS8_EPSG_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE7_M_copyEPKSt13_Rb_tree_nodeIS8_EPSG_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EEC1ERKSE_
- fun:_ZNSt3mapISsN5boost10shared_ptrIN4qpid7framing5ValueEEESt4lessISsESaISt4pairIKSsS5_EEEC1ERKSC_
- fun:_ZN4qpid7framing10FieldTableC1ERKS1_
- fun:_ZNSt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS0_6broker5QueueEEEEC1ERKS8_
- fun:_ZSt10_ConstructISt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS1_6broker5QueueEEEES9_EvPT_RKT0_
- fun:_ZSt24__uninitialized_copy_auxIN9__gnu_cxx17__normal_iteratorIPSt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS3_6broker5QueueEEEESt6vectorISB_SaISB_EEEESG_ET0_T_SI_SH_12__false_type
- fun:_ZSt18uninitialized_copyIN9__gnu_cxx17__normal_iteratorIPSt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS3_6broker5QueueEEEESt6vectorISB_SaISB_EEEESG_ET0_T_SI_SH_
- fun:_ZSt22__uninitialized_copy_aIN9__gnu_cxx17__normal_iteratorIPSt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS3_6broker5QueueEEEESt6vectorISB_SaISB_EEEESG_SB_ET0_T_SI_SH_SaIT1_E
- fun:_ZNSt6vectorISt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS1_6broker5QueueEEEESaIS9_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS9_SB_EERKS9_
- fun:_ZNSt6vectorISt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS1_6broker5QueueEEEESaIS9_EE9push_backERKS9_
- fun:_ZN4qpid6broker15HeadersExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
-}
-{
- x17984_30
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIPN4qpid3sys16LFSessionContextEE8allocateEmPKv
- fun:_ZNSt12_Vector_baseIPN4qpid3sys16LFSessionContextESaIS3_EE11_M_allocateEm
- fun:_ZNSt6vectorIPN4qpid3sys16LFSessionContextESaIS3_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS3_S5_EERKS3_
- fun:_ZNSt6vectorIPN4qpid3sys16LFSessionContextESaIS3_EE9push_backERKS3_
- fun:_ZN4qpid3sys11LFProcessor3addEPK12apr_pollfd_t
- fun:_ZN4qpid3sys11APRAcceptor3runEPNS0_21SessionHandlerFactoryE
- fun:_ZN4qpid6broker6Broker3runEv
- fun:main
-}
-{
- x17984_31
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZNSs4_Rep9_S_createEmmRKSaIcE
- obj:/usr/lib/libstdc++.so.6.0.8
- fun:_ZNSsC1EPKcRKSaIcE
- fun:_ZN4qpid6broker7ChannelC1ERNS_7framing15ProtocolVersionEPNS2_13OutputHandlerEijPNS0_12MessageStoreEm
- fun:_ZN4qpid6broker18SessionHandlerImpl18ChannelHandlerImpl4openEtRKSs
- fun:_ZN4qpid7framing15ChannelOpenBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid7framing16AMQP_ClientProxy7Channel6openOkEt
- fun:_ZN4qpid6broker18SessionHandlerImpl18ChannelHandlerImpl4openEtRKSs
- fun:_ZN4qpid7framing15ChannelOpenBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
-}
-{
- x17984_32
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIN5boost10shared_ptrIN4qpid7framing14AMQContentBodyEEEE8allocateEmPKv
- fun:_ZNSt12_Vector_baseIN5boost10shared_ptrIN4qpid7framing14AMQContentBodyEEESaIS5_EE11_M_allocateEm
- fun:_ZNSt6vectorIN5boost10shared_ptrIN4qpid7framing14AMQContentBodyEEESaIS5_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS5_S7_EERKS5_
- fun:_ZNSt6vectorIN5boost10shared_ptrIN4qpid7framing14AMQContentBodyEEESaIS5_EE9push_backERKS5_
- fun:_ZN4qpid6broker15InMemoryContent3addEN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker7Message10addContentEN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker14MessageBuilder10addContentERN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker7Channel13handleContentEN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl13handleContentEtN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZNSs4_Rep9_S_createEmmRKSaIcE
-}
-{
- x17984_33
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid7framing14AMQContentBodyEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid7framing7AMQBodyEEC1INS2_14AMQContentBodyEEEPT_
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
-}
-{
- x17984_34
- Memcheck:Leak
- fun:_vgrZU_libcZdsoZa_calloc
- fun:_dl_allocate_tls
- fun:pthread_create@@GLIBC_2.2.5
- fun:_ZN4qpid3sys6ThreadC1EPNS0_8RunnableE
- fun:_ZN4qpid6broker10AutoDelete5startEv
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsmj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_35
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid7framing14AMQContentBodyEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid7framing7AMQBodyEEC1INS2_14AMQContentBodyEEEPT_
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZNSs4_Rep9_S_createEmmRKSaIcE
- fun:_ZNSs9_M_mutateEmmm
- fun:_ZNSs15_M_replace_safeEmmPKcm
- fun:_ZN4qpid7framing6Buffer10getRawDataERSsj
- fun:_ZN4qpid7framing14AMQContentBody6decodeERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
-}
-{
- x17984_36
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid7framing13AMQHeaderBodyEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid7framing7AMQBodyEEC1INS2_13AMQHeaderBodyEEEPT_
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__ZdlPv
- fun:_ZN4qpid7framing16BasicPublishBodyD0Ev
- fun:_ZN5boost14checked_deleteIN4qpid7framing13AMQMethodBodyEEEvPT_
- fun:_ZN5boost6detail17sp_counted_impl_pIN4qpid7framing13AMQMethodBodyEE7disposeEv
- fun:_ZN5boost6detail15sp_counted_base7releaseEv
- fun:_ZN5boost6detail12shared_countaSERKS1_
- fun:_ZN5boost10shared_ptrIN4qpid7framing7AMQBodyEEaSERKS4_
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
-}
-{
- x17984_37
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid6broker7MessageEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid6broker7MessageEEC1IS3_EEPT_
- fun:_ZN4qpid6broker7Channel13handlePublishEPNS0_7MessageEN5boost10shared_ptrINS0_8ExchangeEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl16BasicHandlerImpl7publishEttRKSsS4_bb
- fun:_ZN4qpid7framing16BasicPublishBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_38
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker14MessageBuilder9setHeaderERN5boost10shared_ptrINS_7framing13AMQHeaderBodyEEE
- fun:_ZN4qpid6broker7Channel12handleHeaderEN5boost10shared_ptrINS_7framing13AMQHeaderBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl12handleHeaderEtN5boost10shared_ptrINS_7framing13AMQHeaderBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_39
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_40
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN5boost6detail12shared_countC1IN4qpid6broker5QueueEEEPT_
- fun:_ZN5boost10shared_ptrIN4qpid6broker5QueueEEC1IS3_EEPT_
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEEEE8allocateEmPKv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE11_M_get_nodeEv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE14_M_create_nodeERKS8_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE9_M_insertEPSt18_Rb_tree_node_baseSG_RKS8_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE13insert_uniqueERKS8_
-}
-{
- x17984_41
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker5Queue9configureERKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker5Queue6createERKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIN5boost10shared_ptrIN4qpid6broker5QueueEEEE8allocateEmPKv
- fun:_ZNSt12_Vector_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE11_M_allocateEm
- fun:_ZNSt12_Vector_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EEC2EmRKS6_
- fun:_ZNSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EEC1ERKS7_
- fun:_ZNSt4pairIKSsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS7_EEEC1ERS0_RKS9_
- fun:_ZNSt3mapISsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS6_EESt4lessISsESaISt4pairIKSsS8_EEEixERSC_
-}
-{
- x17984_42
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIN5boost10shared_ptrIN4qpid6broker5QueueEEEE8allocateEmPKv
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE16_M_allocate_nodeEv
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE15_M_create_nodesEPPS5_S9_
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE17_M_initialize_mapEm
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EEC2ERKS6_m
- fun:_ZNSt5dequeIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EEC1ERKS7_
- fun:_ZNSt5queueIN5boost10shared_ptrIN4qpid6broker5QueueEEESt5dequeIS5_SaIS5_EEEC1ERKS8_
- fun:_ZN4qpid6broker10AutoDeleteC1EPNS0_13QueueRegistryEj
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsmj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x17984_43
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKSsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaISA_EEEEE8allocateEmPKv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS8_EEESt10_Select1stISB_ESt4lessISsESaISB_EE11_M_get_nodeEv
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS8_EEESt10_Select1stISB_ESt4lessISsESaISB_EE14_M_create_nodeERKSB_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS8_EEESt10_Select1stISB_ESt4lessISsESaISB_EE9_M_insertEPSt18_Rb_tree_node_baseSJ_RKSB_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS8_EEESt10_Select1stISB_ESt4lessISsESaISB_EE13insert_uniqueERKSB_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS8_EEESt10_Select1stISB_ESt4lessISsESaISB_EE13insert_uniqueESt17_Rb_tree_iteratorISB_ERKSB_
- fun:_ZNSt3mapISsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS6_EESt4lessISsESaISt4pairIKSsS8_EEE6insertESt17_Rb_tree_iteratorISD_ERKSD_
- fun:_ZNSt3mapISsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS6_EESt4lessISsESaISt4pairIKSsS8_EEEixERSC_
- fun:_ZN4qpid6broker14DirectExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_44
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker18SessionHandlerImpl16BasicHandlerImpl7publishEttRKSsS4_bb
- fun:_ZN4qpid7framing16BasicPublishBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_45
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker14DirectExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_46
- Memcheck:Leak
- fun:_vgrZU_libcZdsoZa_malloc
- fun:__new_exitfn
- fun:__cxa_atexit
- fun:_Z41__static_initialization_and_destruction_0ii
- fun:_GLOBAL__I__ZN4qpid6broker9TxPublishC2EN5boost10shared_ptrINS0_7MessageEEEPKSs
- obj:/home_old/e/work/rh/rhn/messaging-clean/trunk/qpid-help2man/cpp/lib/broker/.libs/libqpidbroker.so.0.1.0
- obj:/home_old/e/work/rh/rhn/messaging-clean/trunk/qpid-help2man/cpp/lib/broker/.libs/libqpidbroker.so.0.1.0
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_47
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIPN5boost10shared_ptrIN4qpid6broker7MessageEEEE8allocateEmPKv
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker7MessageEEESaIS5_EE15_M_allocate_mapEm
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker7MessageEEESaIS5_EE17_M_initialize_mapEm
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker7MessageEEESaIS5_EEC2ERKS6_m
- fun:_ZNSt5dequeIN5boost10shared_ptrIN4qpid6broker7MessageEEESaIS5_EEC1ERKS7_
- fun:_ZNSt5queueIN5boost10shared_ptrIN4qpid6broker7MessageEEESt5dequeIS5_SaIS5_EEEC1ERKS8_
- fun:_ZN4qpid6broker5QueueC1ERKSsjPNS0_12MessageStoreEPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
-}
-{
- x17984_48
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIPPN4qpid6broker7BindingEE8allocateEmPKv
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EE15_M_allocate_mapEm
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EE17_M_initialize_mapEm
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EEC2ERKS4_m
- fun:_ZNSt5dequeIPN4qpid6broker7BindingESaIS3_EEC1ERKS5_
- fun:_ZNSt5queueIPN4qpid6broker7BindingESt5dequeIS3_SaIS3_EEEC1ERKS6_
- fun:_ZN4qpid6broker5QueueC1ERKSsjPNS0_12MessageStoreEPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
-}
-{
- x17984_49
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKmPFPN4qpid7framing13AMQMethodBodyEhhEEEE8allocateEmPKv
- fun:_ZNSt8_Rb_treeImSt4pairIKmPFPN4qpid7framing13AMQMethodBodyEhhEESt10_Select1stIS8_ESt4lessImESaIS8_EE11_M_get_nodeEv
- fun:_ZNSt8_Rb_treeImSt4pairIKmPFPN4qpid7framing13AMQMethodBodyEhhEESt10_Select1stIS8_ESt4lessImESaIS8_EE14_M_create_nodeERKS8_
- fun:_ZNSt8_Rb_treeImSt4pairIKmPFPN4qpid7framing13AMQMethodBodyEhhEESt10_Select1stIS8_ESt4lessImESaIS8_EE9_M_insertEPSt18_Rb_tree_node_baseSG_RKS8_
- fun:_ZNSt8_Rb_treeImSt4pairIKmPFPN4qpid7framing13AMQMethodBodyEhhEESt10_Select1stIS8_ESt4lessImESaIS8_EE13insert_uniqueERKS8_
- fun:_ZNSt3mapImPFPN4qpid7framing13AMQMethodBodyEhhESt4lessImESaISt4pairIKmS5_EEE6insertERKSA_
- fun:_ZN4qpid7framing21AMQP_MethodVersionMapC1Ev
- fun:_Z41__static_initialization_and_destruction_0ii
- fun:_GLOBAL__I__ZN4qpid7framing8AMQFrame10versionMapE
- obj:/home_old/e/work/rh/rhn/messaging-clean/trunk/qpid-help2man/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- obj:/home_old/e/work/rh/rhn/messaging-clean/trunk/qpid-help2man/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorISt13_Rb_tree_nodeISt4pairIKmPFPN4qpid7framing13AMQMethodBodyEhhEEEE8allocateEmPKv
- fun:_ZNSt8_Rb_treeImSt4pairIKmPFPN4qpid7framing13AMQMethodBodyEhhEESt10_Select1stIS8_ESt4lessImESaIS8_EE11_M_get_nodeEv
- fun:_ZNSt8_Rb_treeImSt4pairIKmPFPN4qpid7framing13AMQMethodBodyEhhEESt10_Select1stIS8_ESt4lessImESaIS8_EE14_M_create_nodeERKS8_
- fun:_ZNSt8_Rb_treeImSt4pairIKmPFPN4qpid7framing13AMQMethodBodyEhhEESt10_Select1stIS8_ESt4lessImESaIS8_EE9_M_insertEPSt18_Rb_tree_node_baseSG_RKS8_
- fun:_ZNSt8_Rb_treeImSt4pairIKmPFPN4qpid7framing13AMQMethodBodyEhhEESt10_Select1stIS8_ESt4lessImESaIS8_EE13insert_uniqueERKS8_
-}
-{
- x17984_50
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid7framing13AMQHeaderBody16createPropertiesEi
- fun:_ZN4qpid7framing13AMQHeaderBody6decodeERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_51
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker18SessionHandlerImpl18ChannelHandlerImpl4openEtRKSs
- fun:_ZN4qpid7framing15ChannelOpenBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZNSs4_Rep9_S_createEmmRKSaIcE
- obj:/usr/lib/libstdc++.so.6.0.8
- fun:_ZNSsC1EPKcRKSaIcE
- fun:_ZN4qpid6broker7ChannelC1ERNS_7framing15ProtocolVersionEPNS2_13OutputHandlerEijPNS0_12MessageStoreEm
- fun:_ZN4qpid6broker18SessionHandlerImpl18ChannelHandlerImpl4openEtRKSs
- fun:_ZN4qpid7framing15ChannelOpenBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
-}
-{
- x17984_52
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZNSs4_Rep9_S_createEmmRKSaIcE
- obj:/usr/lib/libstdc++.so.6.0.8
- fun:_ZNSsC1EPKcRKSaIcE
- fun:_Z41__static_initialization_and_destruction_0ii
- fun:_GLOBAL__I__ZN4qpid6broker6TokensaSERKSs
- obj:/home_old/e/work/rh/rhn/messaging-clean/trunk/qpid-help2man/cpp/lib/broker/.libs/libqpidbroker.so.0.1.0
- obj:/home_old/e/work/rh/rhn/messaging-clean/trunk/qpid-help2man/cpp/lib/broker/.libs/libqpidbroker.so.0.1.0
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_53
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIPPN4qpid6broker7BindingEE8allocateEmPKv
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EE15_M_allocate_mapEm
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EE17_M_initialize_mapEm
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EEC2ERKS4_m
- fun:_ZNSt5dequeIPN4qpid6broker7BindingESaIS3_EEC1ERKS4_
- fun:_ZN4qpid6broker5QueueC1ERKSsjPNS0_12MessageStoreEPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
-}
-{
- x17984_54
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIN5boost10shared_ptrIN4qpid6broker7MessageEEEE8allocateEmPKv
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker7MessageEEESaIS5_EE16_M_allocate_nodeEv
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker7MessageEEESaIS5_EE15_M_create_nodesEPPS5_S9_
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker7MessageEEESaIS5_EE17_M_initialize_mapEm
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker7MessageEEESaIS5_EEC2ERKS6_m
- fun:_ZNSt5dequeIN5boost10shared_ptrIN4qpid6broker7MessageEEESaIS5_EEC1ERKS7_
- fun:_ZNSt5queueIN5boost10shared_ptrIN4qpid6broker7MessageEEESt5dequeIS5_SaIS5_EEEC1ERKS8_
- fun:_ZN4qpid6broker5QueueC1ERKSsjPNS0_12MessageStoreEPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_55
- Memcheck:Leak
- fun:_vgrZU_libstdcZpZpZa__Znwm
- fun:_ZN9__gnu_cxx13new_allocatorIPN4qpid6broker7BindingEE8allocateEmPKv
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EE16_M_allocate_nodeEv
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EE15_M_create_nodesEPPS3_S7_
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EE17_M_initialize_mapEm
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EEC2ERKS4_m
- fun:_ZNSt5dequeIPN4qpid6broker7BindingESaIS3_EEC1ERKS5_
- fun:_ZNSt5queueIPN4qpid6broker7BindingESt5dequeIS3_SaIS3_EEEC1ERKS6_
- fun:_ZN4qpid6broker5QueueC1ERKSsjPNS0_12MessageStoreEPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:start_thread
- fun:clone
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_56
- Memcheck:Leak
- fun:_vgrZU_libcZdsoZa_malloc
- fun:apr_pool_create_ex
- fun:apr_pool_initialize
- fun:apr_initialize
- fun:_ZN4qpid3sys7APRBaseC1Ev
- fun:_ZN4qpid3sys7APRBase11getInstanceEv
- fun:_ZN4qpid3sys7APRBase9incrementEv
- fun:_ZN4qpid3sys7APRPoolC1Ev
- fun:_ZN5boost7details4pool17singleton_defaultIN4qpid3sys7APRPoolEE8instanceEv
- fun:_ZN4qpid3sys7APRPool3getEv
- fun:_Z41__static_initialization_and_destruction_0ii
- obj:/home_old/e/work/rh/rhn/messaging-clean/trunk/qpid-help2man/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- obj:/home_old/e/work/rh/rhn/messaging-clean/trunk/qpid-help2man/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- obj:*
- obj:*
- obj:*
- obj:*
-}
-{
- x17984_57
- Memcheck:Leak
- fun:_vgrZU_libcZdsoZa_malloc
- fun:apr_palloc
- fun:apr_pollset_create
- fun:_ZN4qpid3sys11LFProcessorC1EP10apr_pool_tiii
- fun:_ZN4qpid3sys11APRAcceptorC1Esiib
- fun:_ZN4qpid3sys8Acceptor6createEsiib
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-
-{
- x7393_1
- Memcheck:Leak
- fun:_Znwj
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_ZNK7CppUnit21TestCaseMethodFunctorclEv
- fun:_ZN7CppUnit16DefaultProtector7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZNK7CppUnit14ProtectorChain14ProtectFunctorclEv
- fun:_ZN7CppUnit14ProtectorChain7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZN7CppUnit10TestResult7protectERKNS_7FunctorEPNS_4TestERKSs
- fun:_ZN7CppUnit8TestCase3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestRunner13WrappingSuite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestResult7runTestEPNS_4TestE
- fun:_ZN7CppUnit10TestRunner3runERNS_10TestResultERKSs
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_2
- Memcheck:Leak
- fun:_Znwj
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_ZNK7CppUnit21TestCaseMethodFunctorclEv
- fun:_ZN7CppUnit16DefaultProtector7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZNK7CppUnit14ProtectorChain14ProtectFunctorclEv
- fun:_ZN7CppUnit14ProtectorChain7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZN7CppUnit10TestResult7protectERKNS_7FunctorEPNS_4TestERKSs
- fun:_ZN7CppUnit8TestCase3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestRunner13WrappingSuite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestResult7runTestEPNS_4TestE
- fun:_ZN7CppUnit10TestRunner3runERNS_10TestResultERKSs
-}
-{
- x7393_3
- Memcheck:Leak
- fun:_Znwj
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_ZNK7CppUnit21TestCaseMethodFunctorclEv
- fun:_ZN7CppUnit16DefaultProtector7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZNK7CppUnit14ProtectorChain14ProtectFunctorclEv
- fun:_ZN7CppUnit14ProtectorChain7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZN7CppUnit10TestResult7protectERKNS_7FunctorEPNS_4TestERKSs
- fun:_ZN7CppUnit8TestCase3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestRunner13WrappingSuite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestResult7runTestEPNS_4TestE
- fun:_ZN7CppUnit10TestRunner3runERNS_10TestResultERKSs
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_4
- Memcheck:Leak
- fun:_Znwj
- obj:*
- obj:*
- fun:_ZNK7CppUnit21TestCaseMethodFunctorclEv
- fun:_ZN7CppUnit16DefaultProtector7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZNK7CppUnit14ProtectorChain14ProtectFunctorclEv
- fun:_ZN7CppUnit14ProtectorChain7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZN7CppUnit10TestResult7protectERKNS_7FunctorEPNS_4TestERKSs
- fun:_ZN7CppUnit8TestCase3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestRunner13WrappingSuite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestResult7runTestEPNS_4TestE
- fun:_ZN7CppUnit10TestRunner3runERNS_10TestResultERKSs
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_5
- Memcheck:Leak
- fun:_Znwj
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_ZNK7CppUnit21TestCaseMethodFunctorclEv
- fun:_ZN7CppUnit16DefaultProtector7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZNK7CppUnit14ProtectorChain14ProtectFunctorclEv
- fun:_ZN7CppUnit14ProtectorChain7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZN7CppUnit10TestResult7protectERKNS_7FunctorEPNS_4TestERKSs
- fun:_ZN7CppUnit8TestCase3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestRunner13WrappingSuite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestResult7runTestEPNS_4TestE
- fun:_ZN7CppUnit10TestRunner3runERNS_10TestResultERKSs
- fun:_Z8runTestsRK17CommandLineParser
-}
-{
- x7393_6
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE15_M_create_nodesEPPS5_S9_
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE17_M_initialize_mapEj
- fun:_ZN4qpid6broker10AutoDeleteC1EPNS0_13QueueRegistryEj
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsyj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x7393_7
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_8
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker14MessageBuilder9setHeaderERN5boost10shared_ptrINS_7framing13AMQHeaderBodyEEE
- fun:_ZN4qpid6broker7Channel12handleHeaderEN5boost10shared_ptrINS_7framing13AMQHeaderBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl12handleHeaderEtN5boost10shared_ptrINS_7framing13AMQHeaderBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_9
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker7Channel13handlePublishEPNS0_7MessageEN5boost10shared_ptrINS0_8ExchangeEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl16BasicHandlerImpl7publishEttRKSsS4_bb
- fun:_ZN4qpid7framing16BasicPublishBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_10
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker18SessionHandlerImplC1EPNS_3sys14SessionContextEPNS0_13QueueRegistryEPNS0_16ExchangeRegistryEPNS0_10AutoDeleteERKNS0_8SettingsE
- fun:_ZN4qpid6broker25SessionHandlerFactoryImpl6createEPNS_3sys14SessionContextE
- fun:_ZN4qpid3sys11APRAcceptor3runEPNS0_21SessionHandlerFactoryE
- fun:_ZN4qpid6broker6Broker3runEv
- fun:main
-}
-{
- x7393_11
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE9_M_insertEPSt18_Rb_tree_node_baseSG_RKS8_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE13insert_uniqueERKS8_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker5QueueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE13insert_uniqueESt17_Rb_tree_iteratorIS8_ERKS8_
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_12
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS5_S7_EERKS5_
- fun:_ZN4qpid6broker14DirectExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_13
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt8_Rb_treeItSt4pairIKtPN4qpid6broker7ChannelEESt10_Select1stIS6_ESt4lessItESaIS6_EE9_M_insertEPSt18_Rb_tree_node_baseSE_RKS6_
- fun:_ZNSt8_Rb_treeItSt4pairIKtPN4qpid6broker7ChannelEESt10_Select1stIS6_ESt4lessItESaIS6_EE13insert_uniqueERKS6_
- fun:_ZNSt8_Rb_treeItSt4pairIKtPN4qpid6broker7ChannelEESt10_Select1stIS6_ESt4lessItESaIS6_EE13insert_uniqueESt17_Rb_tree_iteratorIS6_ERKS6_
- fun:_ZN4qpid6broker18SessionHandlerImpl18ChannelHandlerImpl4openEtRKSs
- fun:_ZN4qpid7framing15ChannelOpenBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_14
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_15
- Memcheck:Leak
- fun:calloc
- fun:_dl_allocate_tls
- fun:pthread_create@@GLIBC_2.1
- fun:apr_thread_create
- fun:_ZN4qpid6broker10AutoDelete5startEv
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsyj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x7393_16
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsPN4qpid6broker7Channel12ConsumerImplEESt10_Select1stIS7_ESt4lessISsESaIS7_EE9_M_insertEPSt18_Rb_tree_node_baseSF_RKS7_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsPN4qpid6broker7Channel12ConsumerImplEESt10_Select1stIS7_ESt4lessISsESaIS7_EE13insert_uniqueERKS7_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsPN4qpid6broker7Channel12ConsumerImplEESt10_Select1stIS7_ESt4lessISsESaIS7_EE13insert_uniqueESt17_Rb_tree_iteratorIS7_ERKS7_
- fun:_ZN4qpid6broker7Channel7consumeERSsN5boost10shared_ptrINS0_5QueueEEEbbPNS0_15ConnectionTokenEPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16BasicHandlerImpl7consumeEttRKSsS4_bbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16BasicConsumeBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_17
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker7Channel7consumeERSsN5boost10shared_ptrINS0_5QueueEEEbbPNS0_15ConnectionTokenEPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16BasicHandlerImpl7consumeEttRKSsS4_bbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16BasicConsumeBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_18
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker5Queue9configureERKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker5Queue6createERKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_19
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker7Channel7deliverERN5boost10shared_ptrINS0_7MessageEEERKSsRNS3_INS0_5QueueEEEb
- fun:_ZN4qpid6broker7Channel12ConsumerImpl7deliverERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker5Queue8dispatchERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker5Queue8dispatchEv
- fun:_ZN4qpid6broker18SessionHandlerImpl16BasicHandlerImpl7consumeEttRKSsS4_bbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16BasicConsumeBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_20
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt11_Deque_baseIPN4qpid7framing8AMQFrameESaIS3_EE17_M_initialize_mapEj
- fun:_ZN4qpid3sys16LFSessionContextC1EP10apr_pool_tP12apr_socket_tPNS0_11LFProcessorEb
- fun:_ZN4qpid3sys11APRAcceptor3runEPNS0_21SessionHandlerFactoryE
- fun:_ZN4qpid6broker6Broker3runEv
- fun:main
-}
-{
- x7393_21
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS8_EEESt10_Select1stISB_ESt4lessISsESaISB_EE9_M_insertEPSt18_Rb_tree_node_baseSJ_RKSB_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS8_EEESt10_Select1stISB_ESt4lessISsESaISB_EE13insert_uniqueERKSB_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS8_EEESt10_Select1stISB_ESt4lessISsESaISB_EE13insert_uniqueESt17_Rb_tree_iteratorISB_ERKSB_
- fun:_ZNSt3mapISsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS6_EESt4lessISsESaISt4pairIKSsS8_EEEixERSC_
- fun:_ZN4qpid6broker14DirectExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_22
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker14DirectExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_23
- Memcheck:Leak
- fun:calloc
- fun:__new_exitfn
- fun:__cxa_atexit
- fun:_Z41__static_initialization_and_destruction_0ii
- obj:/home/gordon/qpid/trunk/qpid/cpp/lib/broker/.libs/libqpidbroker.so.0.1.0
- obj:/home/gordon/qpid/trunk/qpid/cpp/lib/broker/.libs/libqpidbroker.so.0.1.0
- fun:call_init
- fun:_dl_init
- obj:/lib/ld-2.4.so
-}
-{
- x7393_24
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker7MessageEEESaIS5_EE17_M_initialize_mapEj
- fun:_ZN4qpid6broker5QueueC1ERKSsjPNS0_12MessageStoreEPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_25
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EE17_M_initialize_mapEj
- fun:_ZN4qpid6broker5QueueC1ERKSsjPNS0_12MessageStoreEPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_26
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker18SessionHandlerImpl16BasicHandlerImpl7publishEttRKSsS4_bb
- fun:_ZN4qpid7framing16BasicPublishBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_27
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt8_Rb_treeIySt4pairIKyPFPN4qpid7framing13AMQMethodBodyEhhEESt10_Select1stIS8_ESt4lessIyESaIS8_EE9_M_insertEPSt18_Rb_tree_node_baseSG_RKS8_
- fun:_ZNSt8_Rb_treeIySt4pairIKyPFPN4qpid7framing13AMQMethodBodyEhhEESt10_Select1stIS8_ESt4lessIyESaIS8_EE13insert_uniqueERKS8_
- fun:_ZN4qpid7framing21AMQP_MethodVersionMapC1Ev
- fun:_Z41__static_initialization_and_destruction_0ii
- obj:/home/gordon/qpid/trunk/qpid/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- obj:/home/gordon/qpid/trunk/qpid/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- fun:call_init
- fun:_dl_init
- obj:/lib/ld-2.4.so
-}
-{
- x7393_28
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid7framing13AMQHeaderBody16createPropertiesEi
- fun:_ZN4qpid7framing13AMQHeaderBody6decodeERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_29
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker18SessionHandlerImpl18ChannelHandlerImpl4openEtRKSs
- fun:_ZN4qpid7framing15ChannelOpenBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_30
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker25SessionHandlerFactoryImpl6createEPNS_3sys14SessionContextE
- fun:_ZN4qpid3sys11APRAcceptor3runEPNS0_21SessionHandlerFactoryE
- fun:_ZN4qpid6broker6Broker3runEv
- fun:main
-}
-{
- x7393_31
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid3sys11APRAcceptor3runEPNS0_21SessionHandlerFactoryE
- fun:_ZN4qpid6broker6Broker3runEv
- fun:main
-}
-{
- x7393_32
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSs4_Rep9_S_createEjjRKSaIcE
- obj:/usr/lib/libstdc++.so.6.0.8
- fun:_ZNSsC1EPKcRKSaIcE
- fun:_Z41__static_initialization_and_destruction_0ii
- obj:/home/gordon/qpid/trunk/qpid/cpp/lib/broker/.libs/libqpidbroker.so.0.1.0
- obj:/home/gordon/qpid/trunk/qpid/cpp/lib/broker/.libs/libqpidbroker.so.0.1.0
- fun:call_init
- fun:_dl_init
- obj:/lib/ld-2.4.so
-}
-{
- x7393_33
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker18SessionHandlerImpl9initiatedEPNS_7framing18ProtocolInitiationE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_34
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt11_Deque_baseIPN4qpid7framing8AMQFrameESaIS3_EE15_M_create_nodesEPPS3_S7_
- fun:_ZNSt11_Deque_baseIPN4qpid7framing8AMQFrameESaIS3_EE17_M_initialize_mapEj
- fun:_ZN4qpid3sys16LFSessionContextC1EP10apr_pool_tP12apr_socket_tPNS0_11LFProcessorEb
- fun:_ZN4qpid3sys11APRAcceptor3runEPNS0_21SessionHandlerFactoryE
- fun:_ZN4qpid6broker6Broker3runEv
- fun:main
-}
-{
- x7393_35
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker7MessageEEESaIS5_EE15_M_create_nodesEPPS5_S9_
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker7MessageEEESaIS5_EE17_M_initialize_mapEj
- fun:_ZN4qpid6broker5QueueC1ERKSsjPNS0_12MessageStoreEPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_36
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EE15_M_create_nodesEPPS3_S7_
- fun:_ZNSt11_Deque_baseIPN4qpid6broker7BindingESaIS3_EE17_M_initialize_mapEj
- fun:_ZN4qpid6broker5QueueC1ERKSsjPNS0_12MessageStoreEPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker13QueueRegistry7declareERKSsbjPKNS0_15ConnectionTokenE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl7declareEttRKSsbbbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16QueueDeclareBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_37
- Memcheck:Leak
- fun:malloc
- fun:apr_palloc
- fun:apr_pollset_create
- fun:_ZN4qpid3sys11LFProcessorC1EP10apr_pool_tiii
- fun:_ZN4qpid3sys11APRAcceptorC1Esiib
- fun:_ZN4qpid3sys8Acceptor6createEsiib
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x7393_38
- Memcheck:Leak
- fun:malloc
- fun:apr_pool_create_ex
- fun:apr_pool_initialize
- fun:apr_initialize
- fun:_ZN4qpid3sys7APRBaseC1Ev
- fun:_ZN4qpid3sys7APRBase11getInstanceEv
- fun:_ZN4qpid3sys7APRBase9incrementEv
- fun:_ZN4qpid3sys7APRPoolC1Ev
- fun:_ZN4qpid3sys7APRPool3getEv
- fun:_Z41__static_initialization_and_destruction_0ii
- obj:/home/gordon/qpid/trunk/qpid/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- obj:/home/gordon/qpid/trunk/qpid/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- fun:call_init
- fun:_dl_init
- obj:/lib/ld-2.4.so
-}
-{
- x7393_39
- Memcheck:Leak
- fun:_Znaj
- fun:_ZN4qpid7framing6BufferC1Ej
- fun:_ZN4qpid3sys16LFSessionContextC1EP10apr_pool_tP12apr_socket_tPNS0_11LFProcessorEb
- fun:_ZN4qpid3sys11APRAcceptor3runEPNS0_21SessionHandlerFactoryE
- fun:_ZN4qpid6broker6Broker3runEv
- fun:main
-}
-{
- x7393_40
- Memcheck:Leak
- fun:_Znwj
- obj:*
- obj:*
- obj:*
- fun:_ZNK7CppUnit21TestCaseMethodFunctorclEv
- fun:_ZN7CppUnit16DefaultProtector7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZNK7CppUnit14ProtectorChain14ProtectFunctorclEv
- fun:_ZN7CppUnit14ProtectorChain7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZN7CppUnit10TestResult7protectERKNS_7FunctorEPNS_4TestERKSs
- fun:_ZN7CppUnit8TestCase3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestRunner13WrappingSuite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestResult7runTestEPNS_4TestE
- fun:_ZN7CppUnit10TestRunner3runERNS_10TestResultERKSs
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_41
- Memcheck:Leak
- fun:malloc
- fun:_dl_new_object
- fun:_dl_map_object_from_fd
- fun:_dl_map_object
- fun:openaux
- fun:_dl_catch_error
- fun:_dl_map_object_deps
- fun:dl_open_worker
- fun:_dl_catch_error
- fun:_dl_open
- fun:dlopen_doit
- fun:_dl_catch_error
- fun:_dlerror_run
- fun:dlopen@GLIBC_2.0
- fun:_ZN7CppUnit21DynamicLibraryManager13doLoadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManager11loadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManagerC1ERKSs
- fun:_ZN7CppUnit13PlugInManager4loadERKSsRKNS_16PlugInParametersE
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_42
- Memcheck:Leak
- fun:malloc
- fun:_dl_map_object
- fun:openaux
- fun:_dl_catch_error
- fun:_dl_map_object_deps
- fun:dl_open_worker
- fun:_dl_catch_error
- fun:_dl_open
- fun:dlopen_doit
- fun:_dl_catch_error
- fun:_dlerror_run
- fun:dlopen@GLIBC_2.0
- fun:_ZN7CppUnit21DynamicLibraryManager13doLoadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManager11loadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManagerC1ERKSs
- fun:_ZN7CppUnit13PlugInManager4loadERKSsRKNS_16PlugInParametersE
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_43
- Memcheck:Leak
- fun:malloc
- fun:_dl_map_object_deps
- fun:dl_open_worker
- fun:_dl_catch_error
- fun:_dl_open
- fun:dlopen_doit
- fun:_dl_catch_error
- fun:_dlerror_run
- fun:dlopen@GLIBC_2.0
- fun:_ZN7CppUnit21DynamicLibraryManager13doLoadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManager11loadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManagerC1ERKSs
- fun:_ZN7CppUnit13PlugInManager4loadERKSsRKNS_16PlugInParametersE
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_44
- Memcheck:Leak
- fun:_Znwj
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_ZNK7CppUnit21TestCaseMethodFunctorclEv
- fun:_ZN7CppUnit16DefaultProtector7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZNK7CppUnit14ProtectorChain14ProtectFunctorclEv
- fun:_ZN7CppUnit14ProtectorChain7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZN7CppUnit10TestResult7protectERKNS_7FunctorEPNS_4TestERKSs
- fun:_ZN7CppUnit8TestCase3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestRunner13WrappingSuite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestResult7runTestEPNS_4TestE
- fun:_ZN7CppUnit10TestRunner3runERNS_10TestResultERKSs
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_45
- Memcheck:Leak
- fun:realloc
- fun:add_to_global
- fun:dl_open_worker
- fun:_dl_catch_error
- fun:_dl_open
- fun:dlopen_doit
- fun:_dl_catch_error
- fun:_dlerror_run
- fun:dlopen@GLIBC_2.0
- fun:_ZN7CppUnit21DynamicLibraryManager13doLoadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManager11loadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManagerC1ERKSs
- fun:_ZN7CppUnit13PlugInManager4loadERKSsRKNS_16PlugInParametersE
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_46
- Memcheck:Leak
- fun:realloc
- fun:dl_open_worker
- fun:_dl_catch_error
- fun:_dl_open
- fun:dlopen_doit
- fun:_dl_catch_error
- fun:_dlerror_run
- fun:dlopen@GLIBC_2.0
- fun:_ZN7CppUnit21DynamicLibraryManager13doLoadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManager11loadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManagerC1ERKSs
- fun:_ZN7CppUnit13PlugInManager4loadERKSsRKNS_16PlugInParametersE
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_47
- Memcheck:Leak
- fun:calloc
- fun:_dl_check_map_versions
- fun:dl_open_worker
- fun:_dl_catch_error
- fun:_dl_open
- fun:dlopen_doit
- fun:_dl_catch_error
- fun:_dlerror_run
- fun:dlopen@GLIBC_2.0
- fun:_ZN7CppUnit21DynamicLibraryManager13doLoadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManager11loadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManagerC1ERKSs
- fun:_ZN7CppUnit13PlugInManager4loadERKSsRKNS_16PlugInParametersE
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_48
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSs4_Rep9_S_createEjjRKSaIcE
- obj:/usr/lib/libstdc++.so.6.0.8
- fun:_ZNSsC1EPKcRKSaIcE
- obj:*
- obj:*
- fun:_ZNK7CppUnit21TestCaseMethodFunctorclEv
- fun:_ZN7CppUnit16DefaultProtector7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZNK7CppUnit14ProtectorChain14ProtectFunctorclEv
- fun:_ZN7CppUnit14ProtectorChain7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZN7CppUnit10TestResult7protectERKNS_7FunctorEPNS_4TestERKSs
- fun:_ZN7CppUnit8TestCase3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestRunner13WrappingSuite3runEPNS_10TestResultE
- fun:_ZN7CppUnit10TestResult7runTestEPNS_4TestE
- fun:_ZN7CppUnit10TestRunner3runERNS_10TestResultERKSs
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_49
- Memcheck:Leak
- fun:calloc
- fun:_dl_new_object
- fun:_dl_map_object_from_fd
- fun:_dl_map_object
- fun:openaux
- fun:_dl_catch_error
- fun:_dl_map_object_deps
- fun:dl_open_worker
- fun:_dl_catch_error
- fun:_dl_open
- fun:dlopen_doit
- fun:_dl_catch_error
- fun:_dlerror_run
- fun:dlopen@GLIBC_2.0
- fun:_ZN7CppUnit21DynamicLibraryManager13doLoadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManager11loadLibraryERKSs
- fun:_ZN7CppUnit21DynamicLibraryManagerC1ERKSs
- fun:_ZN7CppUnit13PlugInManager4loadERKSsRKNS_16PlugInParametersE
- fun:_Z8runTestsRK17CommandLineParser
- fun:main
-}
-{
- x7393_50
- Memcheck:Leak
- fun:_Znwj
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- obj:*
- fun:_ZNK7CppUnit21TestCaseMethodFunctorclEv
- fun:_ZN7CppUnit16DefaultProtector7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZNK7CppUnit14ProtectorChain14ProtectFunctorclEv
- fun:_ZN7CppUnit14ProtectorChain7protectERKNS_7FunctorERKNS_16ProtectorContextE
- fun:_ZN7CppUnit10TestResult7protectERKNS_7FunctorEPNS_4TestERKSs
- fun:_ZN7CppUnit8TestCase3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite15doRunChildTestsEPNS_10TestResultE
- fun:_ZN7CppUnit13TestComposite3runEPNS_10TestResultE
-}
-{
- x7393_51
- Memcheck:Param
- epoll_ctl(event)
- fun:epoll_ctl
- fun:_ZN4qpid3sys11LFProcessor3addEPK12apr_pollfd_t
- fun:_ZN4qpid3sys16LFSessionContext4initEPNS0_14SessionHandlerE
- fun:_ZN4qpid3sys11APRAcceptor3runEPNS0_21SessionHandlerFactoryE
- fun:_ZN4qpid6broker6Broker3runEv
- fun:main
-}
-{
- x7393_52
- Memcheck:Param
- epoll_ctl(event)
- fun:epoll_ctl
- fun:_ZN4qpid3sys11LFProcessor10reactivateEPK12apr_pollfd_t
- fun:_ZN4qpid3sys16LFSessionContext14stopProcessingEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_53
- Memcheck:Param
- epoll_ctl(event)
- fun:epoll_ctl
- fun:_ZN4qpid3sys11LFProcessor6updateEPK12apr_pollfd_t
- fun:_ZN4qpid3sys16LFSessionContext4sendEPNS_7framing8AMQFrameE
- fun:_ZN4qpid6broker7Message7deliverEPNS_7framing13OutputHandlerEiRKSsyjPNS2_15ProtocolVersionE
- fun:_ZN4qpid6broker7Channel7deliverERN5boost10shared_ptrINS0_7MessageEEERKSsRNS3_INS0_5QueueEEEb
- fun:_ZN4qpid6broker7Channel12ConsumerImpl7deliverERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker5Queue8dispatchERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker5Queue7processERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker5Queue7deliverERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker18DeliverableMessage9deliverToERN5boost10shared_ptrINS0_5QueueEEE
- fun:_ZN4qpid6broker15HeadersExchange5routeERNS0_11DeliverableERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker7Channel8completeERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker14MessageBuilder5routeEv
- fun:_ZN4qpid6broker14MessageBuilder10addContentERN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker7Channel13handleContentEN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl13handleContentEtN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_54
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS8_EEESt10_Select1stISB_ESt4lessISsESaISB_EE9_M_insertEPSt18_Rb_tree_node_baseSJ_RKSB_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS8_EEESt10_Select1stISB_ESt4lessISsESaISB_EE13insert_uniqueESt17_Rb_tree_iteratorISB_ERKSB_
- fun:_ZNSt3mapISsSt6vectorIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS6_EESt4lessISsESaISt4pairIKSsS8_EEEixERSC_
- fun:_ZN4qpid6broker14DirectExchange5routeERNS0_11DeliverableERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker7Channel8completeERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker14MessageBuilder5routeEv
- fun:_ZN4qpid6broker14MessageBuilder10addContentERN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker7Channel13handleContentEN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl13handleContentEtN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_55
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsyj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x7393_56
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid3sys7APRBase11getInstanceEv
- fun:_ZN4qpid3sys7APRBase9incrementEv
- fun:_ZN4qpid3sys7APRPoolC1Ev
- fun:_ZN4qpid3sys7APRPool3getEv
- fun:_Z41__static_initialization_and_destruction_0ii
- obj:/home/gordon/qpid/trunk/qpid/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- obj:/home/gordon/qpid/trunk/qpid/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- fun:call_init
- fun:_dl_init
- obj:/lib/ld-2.4.so
-}
-{
- x7393_57
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x7393_58
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker16ExchangeRegistry7declareERKSsS3_
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsyj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x7393_59
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid3sys8Acceptor6createEsiib
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x7393_60
- Memcheck:Leak
- fun:_Znaj
- fun:_ZN4qpid3sys11LFProcessorC1EP10apr_pool_tiii
- fun:_ZN4qpid3sys11APRAcceptorC1Esiib
- fun:_ZN4qpid3sys8Acceptor6createEsiib
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x7393_61
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid7framing5Value12decode_valueERNS0_6BufferE
- fun:_ZN4qpid7framing10FieldTable6decodeERNS0_6BufferE
- fun:_ZN4qpid7framing6Buffer13getFieldTableERNS0_10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody13decodeContentERNS0_6BufferE
- fun:_ZN4qpid7framing13AMQMethodBody6decodeERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_62
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker7Channel8completeERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker14MessageBuilder5routeEv
- fun:_ZN4qpid6broker14MessageBuilder10addContentERN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker7Channel13handleContentEN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl13handleContentEtN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_63
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt8_Rb_treeIN4qpid6broker12TopicPatternESt4pairIKS2_St6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS9_EEESt10_Select1stISC_ESt4lessIS2_ESaISC_EE9_M_insertEPSt18_Rb_tree_node_baseSK_RKSC_
- fun:_ZNSt8_Rb_treeIN4qpid6broker12TopicPatternESt4pairIKS2_St6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS9_EEESt10_Select1stISC_ESt4lessIS2_ESaISC_EE13insert_uniqueERKSC_
- fun:_ZNSt8_Rb_treeIN4qpid6broker12TopicPatternESt4pairIKS2_St6vectorIN5boost10shared_ptrINS1_5QueueEEESaIS9_EEESt10_Select1stISC_ESt4lessIS2_ESaISC_EE13insert_uniqueESt17_Rb_tree_iteratorISC_ERKSC_
- fun:_ZN4qpid6broker13TopicExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_64
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt11_Deque_baseIN5boost10shared_ptrIN4qpid6broker5QueueEEESaIS5_EE17_M_initialize_mapEj
- fun:_ZN4qpid6broker10AutoDeleteC1EPNS0_13QueueRegistryEj
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsyj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x7393_65
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt6vectorIPN4qpid6broker13Configuration6OptionESaIS4_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS4_S6_EERKS4_
- fun:_ZN4qpid6broker13ConfigurationC1Ev
- fun:main
-}
-{
- x7393_66
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid7framing5ValueEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE7_M_copyEPKSt13_Rb_tree_nodeIS8_EPSG_
- fun:_ZNSt6vectorISt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS1_6broker5QueueEEEESaIS9_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS9_SB_EERKS9_
- fun:_ZN4qpid6broker15HeadersExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_67
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker14FanOutExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_68
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker15HeadersExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_69
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt6vectorIPN4qpid6broker4TxOpESaIS3_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS3_S5_EERKS3_
- fun:_ZN4qpid6broker8TxBuffer6enlistEPNS0_4TxOpE
- fun:_ZN4qpid6broker7Channel8completeERN5boost10shared_ptrINS0_7MessageEEE
- fun:_ZN4qpid6broker14MessageBuilder5routeEv
- fun:_ZN4qpid6broker14MessageBuilder10addContentERN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker7Channel13handleContentEN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl13handleContentEtN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_70
- Memcheck:Leak
- fun:malloc
- fun:apr_allocator_create
- fun:apr_pool_initialize
- fun:apr_initialize
- fun:_ZN4qpid3sys7APRBaseC1Ev
- fun:_ZN4qpid3sys7APRBase11getInstanceEv
- fun:_ZN4qpid3sys7APRBase9incrementEv
- fun:_ZN4qpid3sys7APRPoolC1Ev
- fun:_ZN4qpid3sys7APRPool3getEv
- fun:_Z41__static_initialization_and_destruction_0ii
- obj:/home/gordon/qpid/trunk/qpid/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- obj:/home/gordon/qpid/trunk/qpid/cpp/lib/common/.libs/libqpidcommon.so.0.1.0
- fun:call_init
- fun:_dl_init
- obj:/lib/ld-2.4.so
-}
-{
- x7393_71
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid6broker13TopicExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_72
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt6vectorISt4pairIN4qpid7framing10FieldTableEN5boost10shared_ptrINS1_6broker5QueueEEEESaIS9_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS9_SB_EERKS9_
- fun:_ZN4qpid6broker15HeadersExchange4bindEN5boost10shared_ptrINS0_5QueueEEERKSsPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16QueueHandlerImpl4bindEttRKSsS4_S4_bRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_73
- Memcheck:Leak
- fun:_Znwj
- fun:_ZN4qpid7framing10FieldTable6decodeERNS0_6BufferE
- fun:_ZN4qpid7framing6Buffer13getFieldTableERNS0_10FieldTableE
- fun:_ZN4qpid7framing13QueueBindBody13decodeContentERNS0_6BufferE
- fun:_ZN4qpid7framing13AMQMethodBody6decodeERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame10decodeBodyERNS0_6BufferEj
- fun:_ZN4qpid7framing8AMQFrame6decodeERNS0_6BufferE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_74
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt6vectorIPN4qpid6broker8ConsumerESaIS3_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS3_S5_EERKS3_
- fun:_ZN4qpid6broker5Queue7consumeEPNS0_8ConsumerEb
- fun:_ZN4qpid6broker7Channel7consumeERSsN5boost10shared_ptrINS0_5QueueEEEbbPNS0_15ConnectionTokenEPKNS_7framing10FieldTableE
- fun:_ZN4qpid6broker18SessionHandlerImpl16BasicHandlerImpl7consumeEttRKSsS4_bbbbRKNS_7framing10FieldTableE
- fun:_ZN4qpid7framing16BasicConsumeBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_75
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker8ExchangeEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE9_M_insertEPSt18_Rb_tree_node_baseSG_RKS8_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker8ExchangeEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE13insert_uniqueERKS8_
- fun:_ZNSt8_Rb_treeISsSt4pairIKSsN5boost10shared_ptrIN4qpid6broker8ExchangeEEEESt10_Select1stIS8_ESt4lessISsESaIS8_EE13insert_uniqueESt17_Rb_tree_iteratorIS8_ERKS8_
- fun:_ZNSt3mapISsN5boost10shared_ptrIN4qpid6broker8ExchangeEEESt4lessISsESaISt4pairIKSsS5_EEEixERS9_
- fun:_ZN4qpid6broker16ExchangeRegistry7declareERKSsS3_
- fun:_ZN4qpid6broker25SessionHandlerFactoryImplC1ERKSsyj
- fun:_ZN4qpid6broker6BrokerC1ERKNS0_13ConfigurationE
- fun:_ZN4qpid6broker6Broker6createERKNS0_13ConfigurationE
- fun:main
-}
-{
- x7393_76
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt6vectorIPN4qpid3sys16LFSessionContextESaIS3_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS3_S5_EERKS3_
- fun:_ZN4qpid3sys11LFProcessor3addEPK12apr_pollfd_t
- fun:_ZN4qpid3sys16LFSessionContext4initEPNS0_14SessionHandlerE
- fun:_ZN4qpid3sys11APRAcceptor3runEPNS0_21SessionHandlerFactoryE
- fun:_ZN4qpid6broker6Broker3runEv
- fun:main
-}
-{
- x7393_77
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSt6vectorIN5boost10shared_ptrIN4qpid7framing14AMQContentBodyEEESaIS5_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS5_S7_EERKS5_
- fun:_ZN4qpid6broker15InMemoryContent3addEN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker7Message10addContentEN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker14MessageBuilder10addContentERN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker7Channel13handleContentEN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl13handleContentEtN5boost10shared_ptrINS_7framing14AMQContentBodyEEE
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
-{
- x7393_78
- Memcheck:Leak
- fun:_Znwj
- fun:_ZNSs4_Rep9_S_createEjjRKSaIcE
- obj:/usr/lib/libstdc++.so.6.0.8
- fun:_ZNSsC1EPKcRKSaIcE
- fun:_ZN4qpid6broker7ChannelC1ERNS_7framing15ProtocolVersionEPNS2_13OutputHandlerEijPNS0_12MessageStoreEy
- fun:_ZN4qpid6broker18SessionHandlerImpl18ChannelHandlerImpl4openEtRKSs
- fun:_ZN4qpid7framing15ChannelOpenBody6invokeERNS0_21AMQP_ServerOperationsEt
- fun:_ZN4qpid6broker18SessionHandlerImpl8receivedEPNS_7framing8AMQFrameE
- fun:_ZN4qpid3sys16LFSessionContext4readEv
- fun:_ZN4qpid3sys11LFProcessor3runEv
- fun:_ZN4qpid3sys6Thread11runRunnableEP12apr_thread_tPv
- fun:dummy_worker
- fun:start_thread
- fun:clone
-}
diff --git a/Final/cpp/tests/APRBaseTest.cpp b/Final/cpp/tests/APRBaseTest.cpp
deleted file mode 100644
index 7d95c3bf52..0000000000
--- a/Final/cpp/tests/APRBaseTest.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 <apr/APRBase.h>
-#include <qpid_test_plugin.h>
-#include <iostream>
-
-using namespace qpid::sys;
-
-class APRBaseTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(APRBaseTest);
- CPPUNIT_TEST(testMe);
- CPPUNIT_TEST_SUITE_END();
-
- public:
-
- void testMe()
- {
- APRBase::increment();
- APRBase::increment();
- APRBase::decrement();
- APRBase::decrement();
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(APRBaseTest);
-
diff --git a/Final/cpp/tests/AcceptorTest.cpp b/Final/cpp/tests/AcceptorTest.cpp
deleted file mode 100644
index 394dfea463..0000000000
--- a/Final/cpp/tests/AcceptorTest.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 "sys/Thread.h"
-#include "sys/Acceptor.h"
-#include "sys/Socket.h"
-#include "framing/Buffer.h"
-#include "qpid_test_plugin.h"
-
-#include "MockSessionHandler.h"
-
-using namespace qpid::sys;
-using namespace qpid::framing;
-using namespace std;
-
-const char hello[] = "hello";
-const size_t size = sizeof(hello);
-
-
-class AcceptorTest : public CppUnit::TestCase, private Runnable
-{
- CPPUNIT_TEST_SUITE(AcceptorTest);
- CPPUNIT_TEST(testAccept);
- CPPUNIT_TEST_SUITE_END();
-
- private:
- MockSessionHandlerFactory factory;
- Acceptor::shared_ptr acceptor;
-
- public:
-
- void run() {
- acceptor->run(factory);
- }
-
- void setUp() {
- acceptor = Acceptor::create(0, 10, 3);
- }
-
- void tearDown() {
- acceptor.reset();
- }
-
- void testAccept()
- {
- int port = acceptor->getPort();
- CPPUNIT_ASSERT(port > 0);
- Thread runThread(*this);
- // Connect to the acceptor
- Socket client = Socket::createTcp();
- client.connect("localhost", port);
- factory.waitForHandler();
- CPPUNIT_ASSERT(factory.handler != 0);
- // Send a protocol initiation.
- Buffer buf(1024);
- ProtocolInitiation(4,2).encode(buf);
- buf.flip();
- client.send(buf.start(), buf.available());
-
- // Verify session handler got the protocol init.
- ProtocolInitiation init = factory.handler->waitForProtocolInit();
- CPPUNIT_ASSERT_EQUAL(int(4), int(init.getMajor()));
- CPPUNIT_ASSERT_EQUAL(int(2), int(init.getMinor()));
-
- acceptor->shutdown();
- runThread.join();
- factory.handler->waitForClosed();
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(AcceptorTest);
-
diff --git a/Final/cpp/tests/AccumulatedAckTest.cpp b/Final/cpp/tests/AccumulatedAckTest.cpp
deleted file mode 100644
index a2ee3df752..0000000000
--- a/Final/cpp/tests/AccumulatedAckTest.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 <AccumulatedAck.h>
-#include <qpid_test_plugin.h>
-#include <iostream>
-#include <list>
-
-using std::list;
-using namespace qpid::broker;
-
-class AccumulatedAckTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(AccumulatedAckTest);
- CPPUNIT_TEST(testCovers);
- CPPUNIT_TEST(testUpdateAndConsolidate);
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void testCovers()
- {
- AccumulatedAck ack(5);
- ack.individual.push_back(7);
- ack.individual.push_back(9);
-
- CPPUNIT_ASSERT(ack.covers(1));
- CPPUNIT_ASSERT(ack.covers(2));
- CPPUNIT_ASSERT(ack.covers(3));
- CPPUNIT_ASSERT(ack.covers(4));
- CPPUNIT_ASSERT(ack.covers(5));
- CPPUNIT_ASSERT(ack.covers(7));
- CPPUNIT_ASSERT(ack.covers(9));
-
- CPPUNIT_ASSERT(!ack.covers(6));
- CPPUNIT_ASSERT(!ack.covers(8));
- CPPUNIT_ASSERT(!ack.covers(10));
- }
-
- void testUpdateAndConsolidate()
- {
- AccumulatedAck ack(0);
- ack.update(1, false);
- ack.update(3, false);
- ack.update(10, false);
- ack.update(8, false);
- ack.update(6, false);
- ack.update(3, true);
- ack.update(2, true);
- ack.update(5, true);
- ack.consolidate();
- CPPUNIT_ASSERT_EQUAL((u_int64_t) 5, ack.range);
- CPPUNIT_ASSERT_EQUAL((size_t) 3, ack.individual.size());
- list<u_int64_t>::iterator i = ack.individual.begin();
- CPPUNIT_ASSERT_EQUAL((u_int64_t) 6, *i);
- i++;
- CPPUNIT_ASSERT_EQUAL((u_int64_t) 8, *i);
- i++;
- CPPUNIT_ASSERT_EQUAL((u_int64_t) 10, *i);
-
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(AccumulatedAckTest);
-
diff --git a/Final/cpp/tests/BasicP2PTest.cpp b/Final/cpp/tests/BasicP2PTest.cpp
deleted file mode 100644
index b202f88ca6..0000000000
--- a/Final/cpp/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(TestOptions& 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, TestOptions& 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/Final/cpp/tests/BasicP2PTest.h b/Final/cpp/tests/BasicP2PTest.h
deleted file mode 100644
index 3936f556a9..0000000000
--- a/Final/cpp/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 <ClientChannel.h>
-#include <ClientMessage.h>
-#include <Connection.h>
-#include <Exception.h>
-#include <MessageListener.h>
-#include "SimpleTestCaseBase.h"
-
-
-namespace qpid {
-
-class BasicP2PTest : public SimpleTestCaseBase
-{
- class Receiver;
-public:
- void assign(const std::string& role, framing::FieldTable& params, TestOptions& options);
-};
-
-}
-
-#endif
diff --git a/Final/cpp/tests/BasicPubSubTest.cpp b/Final/cpp/tests/BasicPubSubTest.cpp
deleted file mode 100644
index 623194d331..0000000000
--- a/Final/cpp/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(TestOptions& 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(TestOptions& 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, TestOptions& 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/Final/cpp/tests/BasicPubSubTest.h b/Final/cpp/tests/BasicPubSubTest.h
deleted file mode 100644
index e757bd8020..0000000000
--- a/Final/cpp/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 <ClientChannel.h>
-#include <ClientMessage.h>
-#include <Connection.h>
-#include <Exception.h>
-#include <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, TestOptions& options);
-};
-
-}
-
-#endif
diff --git a/Final/cpp/tests/BodyHandlerTest.cpp b/Final/cpp/tests/BodyHandlerTest.cpp
deleted file mode 100644
index bf60dd21e3..0000000000
--- a/Final/cpp/tests/BodyHandlerTest.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 <AMQP_HighestVersion.h>
-#include <amqp_framing.h>
-#include <qpid_test_plugin.h>
-using namespace qpid::framing;
-
-class BodyHandlerTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(BodyHandlerTest);
- CPPUNIT_TEST(testMethod);
- CPPUNIT_TEST(testHeader);
- CPPUNIT_TEST(testContent);
- CPPUNIT_TEST(testHeartbeat);
- CPPUNIT_TEST_SUITE_END();
-private:
-
- class TestBodyHandler : public BodyHandler{
- AMQMethodBody* const method;
- AMQHeaderBody* const header;
- AMQContentBody* const content;
- AMQHeartbeatBody* const heartbeat;
-
- public:
-
- TestBodyHandler(AMQMethodBody* _method) : method(_method), header(0), content(0), heartbeat(0){}
- TestBodyHandler(AMQHeaderBody* _header) : method(0), header(_header), content(0), heartbeat(0){}
- TestBodyHandler(AMQContentBody* _content) : method(0), header(0), content(_content), heartbeat(0){}
- TestBodyHandler(AMQHeartbeatBody* _heartbeat) : method(0), header(0), content(0), heartbeat(_heartbeat){}
-
- virtual void handleMethod(AMQMethodBody::shared_ptr body){
- CPPUNIT_ASSERT(method);
- CPPUNIT_ASSERT_EQUAL(method, body.get());
- }
- virtual void handleHeader(AMQHeaderBody::shared_ptr body){
- CPPUNIT_ASSERT(header);
- CPPUNIT_ASSERT_EQUAL(header, body.get());
- }
- virtual void handleContent(AMQContentBody::shared_ptr body){
- CPPUNIT_ASSERT(content);
- CPPUNIT_ASSERT_EQUAL(content, body.get());
- }
- virtual void handleHeartbeat(AMQHeartbeatBody::shared_ptr body){
- CPPUNIT_ASSERT(heartbeat);
- CPPUNIT_ASSERT_EQUAL(heartbeat, body.get());
- }
- };
- ProtocolVersion v;
-
-public:
-
- BodyHandlerTest() : v(8, 0) {}
-
- void testMethod()
- {
- AMQMethodBody* method = new QueueDeclareBody(v);
- AMQFrame frame(highestProtocolVersion, 0, method);
- TestBodyHandler handler(method);
- handler.handleBody(frame.getBody());
- }
-
- void testHeader()
- {
- AMQHeaderBody* header = new AMQHeaderBody();
- AMQFrame frame(highestProtocolVersion, 0, header);
- TestBodyHandler handler(header);
- handler.handleBody(frame.getBody());
- }
-
- void testContent()
- {
- AMQContentBody* content = new AMQContentBody();
- AMQFrame frame(highestProtocolVersion, 0, content);
- TestBodyHandler handler(content);
- handler.handleBody(frame.getBody());
- }
-
- void testHeartbeat()
- {
- AMQHeartbeatBody* heartbeat = new AMQHeartbeatBody();
- AMQFrame frame(highestProtocolVersion, 0, heartbeat);
- TestBodyHandler handler(heartbeat);
- handler.handleBody(frame.getBody());
- }
-};
-
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(BodyHandlerTest);
-
diff --git a/Final/cpp/tests/ChannelTest.cpp b/Final/cpp/tests/ChannelTest.cpp
deleted file mode 100644
index cc0a90bad9..0000000000
--- a/Final/cpp/tests/ChannelTest.cpp
+++ /dev/null
@@ -1,357 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-#include <BrokerChannel.h>
-#include <BrokerMessage.h>
-#include <BrokerQueue.h>
-#include <FanOutExchange.h>
-#include <NullMessageStore.h>
-#include <qpid_test_plugin.h>
-#include <iostream>
-#include <memory>
-#include <AMQP_HighestVersion.h>
-
-
-using namespace boost;
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-using std::string;
-using std::queue;
-
-struct DummyHandler : OutputHandler{
- std::vector<AMQFrame*> frames;
-
- virtual void send(AMQFrame* frame){
- frames.push_back(frame);
- }
-};
-
-
-class ChannelTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(ChannelTest);
- CPPUNIT_TEST(testConsumerMgmt);
- CPPUNIT_TEST(testDeliveryNoAck);
- CPPUNIT_TEST(testDeliveryAndRecovery);
- CPPUNIT_TEST(testStaging);
- CPPUNIT_TEST(testQueuePolicy);
- CPPUNIT_TEST(testFlow);
- CPPUNIT_TEST_SUITE_END();
-
- class MockMessageStore : public NullMessageStore
- {
- struct MethodCall
- {
- const string name;
- Message* const msg;
- const string data;//only needed for appendContent
-
- void check(const MethodCall& other) const
- {
- CPPUNIT_ASSERT_EQUAL(name, other.name);
- CPPUNIT_ASSERT_EQUAL(msg, other.msg);
- CPPUNIT_ASSERT_EQUAL(data, other.data);
- }
- };
-
- queue<MethodCall> expected;
- bool expectMode;//true when setting up expected calls
-
- void handle(const MethodCall& call)
- {
- if (expectMode) {
- expected.push(call);
- } else {
- call.check(expected.front());
- expected.pop();
- }
- }
-
- void handle(const string& name, Message* msg, const string& data)
- {
- MethodCall call = {name, msg, data};
- handle(call);
- }
-
- public:
-
- MockMessageStore() : expectMode(false) {}
-
- void stage(Message* const msg)
- {
- if(!expectMode) msg->setPersistenceId(1);
- MethodCall call = {"stage", msg, ""};
- handle(call);
- }
-
- void appendContent(Message* msg, const string& data)
- {
- MethodCall call = {"appendContent", msg, data};
- handle(call);
- }
-
- void destroy(Message* msg)
- {
- MethodCall call = {"destroy", msg, ""};
- handle(call);
- }
-
- void expect()
- {
- expectMode = true;
- }
-
- void test()
- {
- expectMode = false;
- }
-
- void check()
- {
- CPPUNIT_ASSERT(expected.empty());
- }
- };
-
-
- public:
-
- void testConsumerMgmt(){
- Queue::shared_ptr queue(new Queue("my_queue"));
- Channel channel(qpid::framing::highestProtocolVersion, 0, 0, 0);
- CPPUNIT_ASSERT(!channel.exists("my_consumer"));
-
- ConnectionToken* owner = 0;
- string tag("my_consumer");
- channel.consume(tag, queue, false, false, owner);
- string tagA;
- string tagB;
- channel.consume(tagA, queue, false, false, owner);
- channel.consume(tagB, queue, false, false, owner);
- CPPUNIT_ASSERT_EQUAL((u_int32_t) 3, queue->getConsumerCount());
- CPPUNIT_ASSERT(channel.exists("my_consumer"));
- CPPUNIT_ASSERT(channel.exists(tagA));
- CPPUNIT_ASSERT(channel.exists(tagB));
- channel.cancel(tagA);
- CPPUNIT_ASSERT_EQUAL((u_int32_t) 2, queue->getConsumerCount());
- CPPUNIT_ASSERT(channel.exists("my_consumer"));
- CPPUNIT_ASSERT(!channel.exists(tagA));
- CPPUNIT_ASSERT(channel.exists(tagB));
- channel.close();
- CPPUNIT_ASSERT_EQUAL((u_int32_t) 0, queue->getConsumerCount());
- }
-
- void testDeliveryNoAck(){
- DummyHandler handler;
- Channel channel(qpid::framing::highestProtocolVersion, &handler, 7, 10000);
-
- const string data("abcdefghijklmn");
-
- Message::shared_ptr msg(createMessage("test", "my_routing_key", "my_message_id", 14));
- addContent(msg, data);
- Queue::shared_ptr queue(new Queue("my_queue"));
- ConnectionToken* owner(0);
- string tag("no_ack");
- channel.consume(tag, queue, false, false, owner);
-
- queue->deliver(msg);
- CPPUNIT_ASSERT_EQUAL((size_t) 3, handler.frames.size());
- CPPUNIT_ASSERT_EQUAL((u_int16_t) 7, handler.frames[0]->getChannel());
- CPPUNIT_ASSERT_EQUAL((u_int16_t) 7, handler.frames[1]->getChannel());
- CPPUNIT_ASSERT_EQUAL((u_int16_t) 7, handler.frames[2]->getChannel());
- BasicDeliverBody::shared_ptr deliver(dynamic_pointer_cast<BasicDeliverBody, AMQBody>(handler.frames[0]->getBody()));
- AMQHeaderBody::shared_ptr contentHeader(dynamic_pointer_cast<AMQHeaderBody, AMQBody>(handler.frames[1]->getBody()));
- AMQContentBody::shared_ptr contentBody(dynamic_pointer_cast<AMQContentBody, AMQBody>(handler.frames[2]->getBody()));
- CPPUNIT_ASSERT(deliver);
- CPPUNIT_ASSERT(contentHeader);
- CPPUNIT_ASSERT(contentBody);
- CPPUNIT_ASSERT_EQUAL(data, contentBody->getData());
- }
-
- void testDeliveryAndRecovery(){
- DummyHandler handler;
- Channel channel(qpid::framing::highestProtocolVersion, &handler, 7, 10000);
- const string data("abcdefghijklmn");
-
- Message::shared_ptr msg(createMessage("test", "my_routing_key", "my_message_id", 14));
- addContent(msg, data);
-
- Queue::shared_ptr queue(new Queue("my_queue"));
- ConnectionToken* owner(0);
- string tag("ack");
- channel.consume(tag, queue, true, false, owner);
-
- queue->deliver(msg);
- CPPUNIT_ASSERT_EQUAL((size_t) 3, handler.frames.size());
- CPPUNIT_ASSERT_EQUAL((u_int16_t) 7, handler.frames[0]->getChannel());
- CPPUNIT_ASSERT_EQUAL((u_int16_t) 7, handler.frames[1]->getChannel());
- CPPUNIT_ASSERT_EQUAL((u_int16_t) 7, handler.frames[2]->getChannel());
- BasicDeliverBody::shared_ptr deliver(dynamic_pointer_cast<BasicDeliverBody, AMQBody>(handler.frames[0]->getBody()));
- AMQHeaderBody::shared_ptr contentHeader(dynamic_pointer_cast<AMQHeaderBody, AMQBody>(handler.frames[1]->getBody()));
- AMQContentBody::shared_ptr contentBody(dynamic_pointer_cast<AMQContentBody, AMQBody>(handler.frames[2]->getBody()));
- CPPUNIT_ASSERT(deliver);
- CPPUNIT_ASSERT(contentHeader);
- CPPUNIT_ASSERT(contentBody);
- CPPUNIT_ASSERT_EQUAL(data, contentBody->getData());
- }
-
- void testStaging(){
- MockMessageStore store;
- DummyHandler handler;
- Channel channel(qpid::framing::highestProtocolVersion, &handler, 1, 1000/*framesize*/, &store, 10/*staging threshold*/);
- const string data[] = {"abcde", "fghij", "klmno"};
-
- Message* msg = new Message(0, "my_exchange", "my_routing_key", false, false);
-
- store.expect();
- store.stage(msg);
- for (int i = 0; i < 3; i++) {
- store.appendContent(msg, data[i]);
- }
- store.destroy(msg);
- store.test();
-
- Exchange::shared_ptr exchange(new FanOutExchange("my_exchange"));
- Queue::shared_ptr queue(new Queue("my_queue"));
- exchange->bind(queue, "", 0);
-
- AMQHeaderBody::shared_ptr header(new AMQHeaderBody(BASIC));
- u_int64_t contentSize(0);
- for (int i = 0; i < 3; i++) {
- contentSize += data[i].size();
- }
- header->setContentSize(contentSize);
- channel.handlePublish(msg, exchange);
- channel.handleHeader(header);
-
- for (int i = 0; i < 3; i++) {
- AMQContentBody::shared_ptr body(new AMQContentBody(data[i]));
- channel.handleContent(body);
- }
- Message::shared_ptr msg2 = queue->dequeue();
- CPPUNIT_ASSERT_EQUAL(msg, msg2.get());
- msg2.reset();//should trigger destroy call
-
- store.check();
- }
-
-
- //NOTE: strictly speaking this should/could be part of QueueTest,
- //but as it can usefully use the same utility classes as this
- //class it is defined here for simpllicity
- void testQueuePolicy()
- {
- MockMessageStore store;
- {//must ensure that store is last thing deleted as it is needed by destructor of lazy loaded content
- const string data1("abcd");
- const string data2("efghijk");
- const string data3("lmnopqrstuvwxyz");
- Message::shared_ptr msg1(createMessage("e", "A", "MsgA", data1.size()));
- Message::shared_ptr msg2(createMessage("e", "B", "MsgB", data2.size()));
- Message::shared_ptr msg3(createMessage("e", "C", "MsgC", data3.size()));
- addContent(msg1, data1);
- addContent(msg2, data2);
- addContent(msg3, data3);
-
- QueuePolicy policy(2, 0);//third message should be stored on disk and lazy loaded
- FieldTable settings;
- policy.update(settings);
-
- store.expect();
- store.stage(msg3.get());
- store.destroy(msg3.get());
- store.test();
-
- Queue::shared_ptr queue(new Queue("my_queue", false, &store, 0));
- queue->configure(settings);//set policy
- queue->deliver(msg1);
- queue->deliver(msg2);
- queue->deliver(msg3);
-
- Message::shared_ptr next = queue->dequeue();
- CPPUNIT_ASSERT_EQUAL(msg1, next);
- CPPUNIT_ASSERT_EQUAL((u_int32_t) data1.size(), next->encodedContentSize());
- next = queue->dequeue();
- CPPUNIT_ASSERT_EQUAL(msg2, next);
- CPPUNIT_ASSERT_EQUAL((u_int32_t) data2.size(), next->encodedContentSize());
- next = queue->dequeue();
- CPPUNIT_ASSERT_EQUAL(msg3, next);
- CPPUNIT_ASSERT_EQUAL((u_int32_t) 0, next->encodedContentSize());
-
- next.reset();
- msg1.reset();
- msg2.reset();
- msg3.reset();//must clear all references to messages to allow them to be destroyed
-
- }
- store.check();
- }
-
-
- void testFlow(){
- DummyHandler handler;
- Channel channel(qpid::framing::highestProtocolVersion, &handler, 7, 10000);
-
- const string data("abcdefghijklmn");
-
- Message::shared_ptr msg(createMessage("test", "my_routing_key", "my_message_id", 14));
- addContent(msg, data);
- Queue::shared_ptr queue(new Queue("my_queue"));
- ConnectionToken* owner(0);
- string tag("no_ack");
- channel.consume(tag, queue, false, false, owner);
- channel.flow(false);
- queue->deliver(msg);
- CPPUNIT_ASSERT_EQUAL((size_t) 0, handler.frames.size());
- CPPUNIT_ASSERT_EQUAL((u_int32_t) 1, queue->getMessageCount());
- channel.flow(true);
- CPPUNIT_ASSERT_EQUAL((size_t) 3, handler.frames.size());
- CPPUNIT_ASSERT_EQUAL((u_int16_t) 7, handler.frames[0]->getChannel());
- CPPUNIT_ASSERT_EQUAL((u_int16_t) 7, handler.frames[1]->getChannel());
- CPPUNIT_ASSERT_EQUAL((u_int16_t) 7, handler.frames[2]->getChannel());
- BasicDeliverBody::shared_ptr deliver(dynamic_pointer_cast<BasicDeliverBody, AMQBody>(handler.frames[0]->getBody()));
- AMQHeaderBody::shared_ptr contentHeader(dynamic_pointer_cast<AMQHeaderBody, AMQBody>(handler.frames[1]->getBody()));
- AMQContentBody::shared_ptr contentBody(dynamic_pointer_cast<AMQContentBody, AMQBody>(handler.frames[2]->getBody()));
- CPPUNIT_ASSERT(deliver);
- CPPUNIT_ASSERT(contentHeader);
- CPPUNIT_ASSERT(contentBody);
- CPPUNIT_ASSERT_EQUAL(data, contentBody->getData());
- }
-
- Message* createMessage(const string& exchange, const string& routingKey, const string& messageId, u_int64_t contentSize)
- {
- Message* msg = new Message(0, exchange, routingKey, false, false);
- AMQHeaderBody::shared_ptr header(new AMQHeaderBody(BASIC));
- header->setContentSize(contentSize);
- msg->setHeader(header);
- msg->getHeaderProperties()->setMessageId(messageId);
- return msg;
- }
-
- void addContent(Message::shared_ptr msg, const string& data)
- {
- AMQContentBody::shared_ptr body(new AMQContentBody(data));
- msg->addContent(body);
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(ChannelTest);
diff --git a/Final/cpp/tests/EventChannelConnectionTest.cpp b/Final/cpp/tests/EventChannelConnectionTest.cpp
deleted file mode 100644
index a6b309d771..0000000000
--- a/Final/cpp/tests/EventChannelConnectionTest.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 <iostream>
-#include <boost/bind.hpp>
-#include "framing/AMQHeartbeatBody.h"
-#include "framing/AMQFrame.h"
-#include "sys/posix/EventChannelConnection.h"
-#include "sys/SessionHandler.h"
-#include "sys/SessionHandlerFactory.h"
-#include "sys/Socket.h"
-#include "qpid_test_plugin.h"
-#include "MockSessionHandler.h"
-
-using namespace qpid::sys;
-using namespace qpid::framing;
-using namespace std;
-
-class EventChannelConnectionTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(EventChannelConnectionTest);
- CPPUNIT_TEST(testSendReceive);
- CPPUNIT_TEST(testCloseExternal);
- CPPUNIT_TEST(testCloseException);
- CPPUNIT_TEST_SUITE_END();
-
- public:
-
- void setUp() {
- threads = EventChannelThreads::create();
- CPPUNIT_ASSERT_EQUAL(0, ::pipe(pipe));
- connection.reset(
- new EventChannelConnection(threads, factory, pipe[0], pipe[1]));
- CPPUNIT_ASSERT(factory.handler != 0);
- }
-
- void tearDown() {
- threads->shutdown();
- threads->join();
- }
-
- void testSendReceive()
- {
- // Send a protocol initiation.
- Buffer buf(1024);
- ProtocolInitiation(4,2).encode(buf);
- buf.flip();
- ssize_t n = write(pipe[1], buf.start(), buf.available());
- CPPUNIT_ASSERT_EQUAL(ssize_t(buf.available()), n);
-
- // Verify session handler got the protocol init.
- ProtocolInitiation init = factory.handler->waitForProtocolInit();
- CPPUNIT_ASSERT_EQUAL(int(4), int(init.getMajor()));
- CPPUNIT_ASSERT_EQUAL(int(2), int(init.getMinor()));
-
- // Send a heartbeat frame, verify connection got it.
- connection->send(new AMQFrame(42, new AMQHeartbeatBody()));
- AMQFrame frame = factory.handler->waitForFrame();
- CPPUNIT_ASSERT_EQUAL(u_int16_t(42), frame.getChannel());
- CPPUNIT_ASSERT_EQUAL(u_int8_t(HEARTBEAT_BODY),
- frame.getBody()->type());
- threads->shutdown();
- }
-
- // Make sure the handler is closed if the connection is closed.
- void testCloseExternal() {
- connection->close();
- factory.handler->waitForClosed();
- }
-
- // Make sure the handler is closed if the connection closes or fails.
- // TODO aconway 2006-12-18: logs exception message in test output.
- void testCloseException() {
- ::close(pipe[0]);
- ::close(pipe[1]);
- // TODO aconway 2006-12-18: Shouldn't this be failing?
- connection->send(new AMQFrame(42, new AMQHeartbeatBody()));
- factory.handler->waitForClosed();
- }
-
- private:
- EventChannelThreads::shared_ptr threads;
- int pipe[2];
- std::auto_ptr<EventChannelConnection> connection;
- MockSessionHandlerFactory factory;
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(EventChannelConnectionTest);
-
diff --git a/Final/cpp/tests/EventChannelTest.cpp b/Final/cpp/tests/EventChannelTest.cpp
deleted file mode 100644
index 8e5c724a15..0000000000
--- a/Final/cpp/tests/EventChannelTest.cpp
+++ /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.
- *
- */
-#include <posix/EventChannel.h>
-#include <posix/check.h>
-#include <sys/Runnable.h>
-#include <sys/Socket.h>
-#include <sys/Thread.h>
-#include <qpid_test_plugin.h>
-
-#include <sys/socket.h>
-#include <signal.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <iostream>
-
-using namespace qpid::sys;
-
-
-const char hello[] = "hello";
-const size_t size = sizeof(hello);
-
-struct RunMe : public Runnable
-{
- bool ran;
- RunMe() : ran(false) {}
- void run() { ran = true; }
-};
-
-class EventChannelTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(EventChannelTest);
- CPPUNIT_TEST(testEvent);
- CPPUNIT_TEST(testRead);
- CPPUNIT_TEST(testFailedRead);
- CPPUNIT_TEST(testWrite);
- CPPUNIT_TEST(testFailedWrite);
- CPPUNIT_TEST(testReadWrite);
- CPPUNIT_TEST(testAccept);
- CPPUNIT_TEST_SUITE_END();
-
- private:
- EventChannel::shared_ptr ec;
- int pipe[2];
- char readBuf[size];
-
- public:
-
- void setUp()
- {
- memset(readBuf, size, 0);
- ec = EventChannel::create();
- if (::pipe(pipe) != 0) throw QPID_POSIX_ERROR(errno);
- // Ignore SIGPIPE, otherwise we will crash writing to broken pipe.
- signal(SIGPIPE, SIG_IGN);
- }
-
- // Verify that calling getEvent returns event.
- template <class T> bool isNextEvent(T& event)
- {
- return &event == dynamic_cast<T*>(ec->getEvent());
- }
-
- template <class T> bool isNextEventOk(T& event)
- {
- Event* next = ec->getEvent();
- if (next) next->throwIfError();
- return &event == next;
- }
-
- void testEvent()
- {
- RunMe runMe;
- CPPUNIT_ASSERT(!runMe.ran);
- // Instances of Event just pass thru the channel immediately.
- Event e(runMe.functor());
- ec->postEvent(e);
- CPPUNIT_ASSERT(isNextEventOk(e));
- e.dispatch();
- CPPUNIT_ASSERT(runMe.ran);
- }
-
- void testRead() {
- ReadEvent re(pipe[0], readBuf, size);
- ec->postEvent(re);
- CPPUNIT_ASSERT_EQUAL(ssize_t(size), ::write(pipe[1], hello, size));
- CPPUNIT_ASSERT(isNextEventOk(re));
- CPPUNIT_ASSERT_EQUAL(size, re.getSize());
- CPPUNIT_ASSERT_EQUAL(std::string(hello), std::string(readBuf));
- }
-
- void testFailedRead()
- {
- ReadEvent re(pipe[0], readBuf, size);
- ec->postEvent(re);
-
- // EOF before all data read.
- ::close(pipe[1]);
- CPPUNIT_ASSERT(isNextEvent(re));
- CPPUNIT_ASSERT(re.hasError());
- try {
- re.throwIfError();
- CPPUNIT_FAIL("Expected QpidError.");
- }
- catch (const qpid::QpidError&) { }
-
- // Bad file descriptor. Note in this case we fail
- // in postEvent and throw immediately.
- try {
- ReadEvent bad;
- ec->postEvent(bad);
- CPPUNIT_FAIL("Expected QpidError.");
- }
- catch (const qpid::QpidError&) { }
- }
-
- void testWrite() {
- WriteEvent wr(pipe[1], hello, size);
- ec->postEvent(wr);
- CPPUNIT_ASSERT(isNextEventOk(wr));
- CPPUNIT_ASSERT_EQUAL(ssize_t(size), ::read(pipe[0], readBuf, size));;
- CPPUNIT_ASSERT_EQUAL(std::string(hello), std::string(readBuf));
- }
-
- void testFailedWrite() {
- WriteEvent wr(pipe[1], hello, size);
- ::close(pipe[0]);
- ec->postEvent(wr);
- CPPUNIT_ASSERT(isNextEvent(wr));
- CPPUNIT_ASSERT(wr.hasError());
- }
-
- void testReadWrite()
- {
- ReadEvent re(pipe[0], readBuf, size);
- WriteEvent wr(pipe[1], hello, size);
- ec->postEvent(re);
- ec->postEvent(wr);
- ec->getEvent();
- ec->getEvent();
- CPPUNIT_ASSERT_EQUAL(std::string(hello), std::string(readBuf));
- }
-
- void testAccept() {
- Socket s = Socket::createTcp();
- int port = s.listen(0, 10);
- CPPUNIT_ASSERT(port != 0);
-
- AcceptEvent ae(s.fd());
- ec->postEvent(ae);
- Socket client = Socket::createTcp();
- client.connect("localhost", port);
- CPPUNIT_ASSERT(isNextEvent(ae));
- ae.dispatch();
-
- // Verify client writes are read by the accepted descriptor.
- char readBuf[size];
- ReadEvent re(ae.getAcceptedDesscriptor(), readBuf, size);
- ec->postEvent(re);
- CPPUNIT_ASSERT_EQUAL(ssize_t(size), client.send(hello, sizeof(hello)));
- CPPUNIT_ASSERT(isNextEvent(re));
- re.dispatch();
- CPPUNIT_ASSERT_EQUAL(std::string(hello), std::string(readBuf));
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(EventChannelTest);
-
diff --git a/Final/cpp/tests/EventChannelThreadsTest.cpp b/Final/cpp/tests/EventChannelThreadsTest.cpp
deleted file mode 100644
index 285ed29518..0000000000
--- a/Final/cpp/tests/EventChannelThreadsTest.cpp
+++ /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.
- *
- */
-#include <iostream>
-#include <boost/bind.hpp>
-
-#include <sys/Socket.h>
-#include <posix/EventChannelThreads.h>
-#include <qpid_test_plugin.h>
-
-
-using namespace std;
-
-using namespace qpid::sys;
-
-const int nConnections = 5;
-const int nMessages = 10; // Messages read/written per connection.
-
-
-// Accepts + reads + writes.
-const int totalEvents = nConnections+2*nConnections*nMessages;
-
-/**
- * Messages are numbered 0..nMessages.
- * We count the total number of events, and the
- * number of reads and writes for each message number.
- */
-class TestResults : public Monitor {
- public:
- TestResults() : isShutdown(false), nEventsRemaining(totalEvents) {}
-
- void countEvent() {
- if (--nEventsRemaining == 0)
- shutdown();
- }
-
- void countRead(int messageNo) {
- ++reads[messageNo];
- countEvent();
- }
-
- void countWrite(int messageNo) {
- ++writes[messageNo];
- countEvent();
- }
-
- void shutdown(const std::string& exceptionMsg = std::string()) {
- ScopedLock lock(*this);
- exception = exceptionMsg;
- isShutdown = true;
- notifyAll();
- }
-
- void wait() {
- ScopedLock lock(*this);
- Time deadline = now() + 10*TIME_SEC;
- while (!isShutdown) {
- CPPUNIT_ASSERT(Monitor::wait(deadline));
- }
- }
-
- bool isShutdown;
- std::string exception;
- AtomicCount reads[nMessages];
- AtomicCount writes[nMessages];
- AtomicCount nEventsRemaining;
-};
-
-TestResults results;
-
-EventChannelThreads::shared_ptr threads;
-
-// Functor to wrap callbacks in try/catch.
-class SafeCallback {
- public:
- SafeCallback(Runnable& r) : callback(r.functor()) {}
- SafeCallback(Event::Callback cb) : callback(cb) {}
-
- void operator()() {
- std::string exception;
- try {
- callback();
- return;
- }
- catch (const std::exception& e) {
- exception = e.what();
- }
- catch (...) {
- exception = "Unknown exception.";
- }
- results.shutdown(exception);
- }
-
- private:
- Event::Callback callback;
-};
-
-/** Repost an event N times. */
-class Repost {
- public:
- Repost(int n) : count (n) {}
- virtual ~Repost() {}
-
- void repost(Event* event) {
- if (--count==0) {
- delete event;
- } else {
- threads->postEvent(event);
- }
- }
- private:
- int count;
-};
-
-
-
-/** Repeating read event. */
-class TestReadEvent : public ReadEvent, public Runnable, private Repost {
- public:
- explicit TestReadEvent(int fd=-1) :
- ReadEvent(fd, &value, sizeof(value), SafeCallback(*this)),
- Repost(nMessages)
- {}
-
- void run() {
- CPPUNIT_ASSERT_EQUAL(sizeof(value), getSize());
- CPPUNIT_ASSERT(0 <= value);
- CPPUNIT_ASSERT(value < nMessages);
- results.countRead(value);
- repost(this);
- }
-
- private:
- int value;
- ReadEvent original;
-};
-
-
-/** Fire and forget write event */
-class TestWriteEvent : public WriteEvent, public Runnable, private Repost {
- public:
- TestWriteEvent(int fd=-1) :
- WriteEvent(fd, &value, sizeof(value), SafeCallback(*this)),
- Repost(nMessages),
- value(0)
- {}
-
- void run() {
- CPPUNIT_ASSERT_EQUAL(sizeof(int), getSize());
- results.countWrite(value++);
- repost(this);
- }
-
- private:
- int value;
-};
-
-/** Fire-and-forget Accept event, posts reads on the accepted connection. */
-class TestAcceptEvent : public AcceptEvent, public Runnable, private Repost {
- public:
- TestAcceptEvent(int fd=-1) :
- AcceptEvent(fd, SafeCallback(*this)),
- Repost(nConnections)
- {}
-
- void run() {
- threads->postEvent(new TestReadEvent(getAcceptedDesscriptor()));
- results.countEvent();
- repost(this);
- }
-};
-
-class EventChannelThreadsTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(EventChannelThreadsTest);
- CPPUNIT_TEST(testThreads);
- CPPUNIT_TEST_SUITE_END();
-
- public:
-
- void setUp() {
- threads = EventChannelThreads::create(EventChannel::create());
- }
-
- void tearDown() {
- threads.reset();
- }
-
- void testThreads()
- {
- Socket listener = Socket::createTcp();
- int port = listener.listen();
-
- // Post looping accept events, will repost nConnections times.
- // The accept event will automatically post read events.
- threads->postEvent(new TestAcceptEvent(listener.fd()));
-
- // Make connections.
- Socket connections[nConnections];
- for (int i = 0; i < nConnections; ++i) {
- connections[i] = Socket::createTcp();
- connections[i].connect("localhost", port);
- }
-
- // Post looping write events.
- for (int i = 0; i < nConnections; ++i) {
- threads->postEvent(new TestWriteEvent(connections[i].fd()));
- }
-
- // Wait for all events to be dispatched.
- results.wait();
-
- if (!results.exception.empty()) CPPUNIT_FAIL(results.exception);
- CPPUNIT_ASSERT_EQUAL(0, int(results.nEventsRemaining));
-
- // Expect a read and write for each messageNo from each connection.
- for (int messageNo = 0; messageNo < nMessages; ++messageNo) {
- CPPUNIT_ASSERT_EQUAL(nConnections, int(results.reads[messageNo]));
- CPPUNIT_ASSERT_EQUAL(nConnections, int(results.writes[messageNo]));
- }
-
- threads->shutdown();
- threads->join();
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(EventChannelThreadsTest);
-
diff --git a/Final/cpp/tests/ExceptionTest.cpp b/Final/cpp/tests/ExceptionTest.cpp
deleted file mode 100644
index 6cea863168..0000000000
--- a/Final/cpp/tests/ExceptionTest.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 <Exception.h>
-#include <qpid_test_plugin.h>
-
-using namespace qpid;
-
-struct CountDestroyedException : public Exception {
- int& count;
- static int staticCount;
- CountDestroyedException() : count(staticCount) { }
- CountDestroyedException(int& n) : count(n) {}
- ~CountDestroyedException() throw() { count++; }
- void throwSelf() const { throw *this; }
-};
-
-int CountDestroyedException::staticCount = 0;
-
-
-class ExceptionTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(ExceptionTest);
- CPPUNIT_TEST(testHeapException);
- CPPUNIT_TEST_SUITE_END();
- public:
- // Verify proper memory management for heap-allocated exceptions.
- void testHeapException() {
- int count = 0;
- try {
- std::auto_ptr<Exception> p(
- new CountDestroyedException(count));
- p.release()->throwSelf();
- CPPUNIT_FAIL("Expected CountDestroyedException.");
- } catch (const CountDestroyedException& e) {
- CPPUNIT_ASSERT(&e.count == &count);
- }
- CPPUNIT_ASSERT_EQUAL(1, count);
- }
-};
-
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(ExceptionTest);
-
diff --git a/Final/cpp/tests/ExchangeTest.cpp b/Final/cpp/tests/ExchangeTest.cpp
deleted file mode 100644
index 8fef4ccaac..0000000000
--- a/Final/cpp/tests/ExchangeTest.cpp
+++ /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.
- *
- */
-
-#include <DeliverableMessage.h>
-#include <DirectExchange.h>
-#include <BrokerExchange.h>
-#include <BrokerQueue.h>
-#include <TopicExchange.h>
-#include <qpid_test_plugin.h>
-#include <iostream>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-
-class ExchangeTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(ExchangeTest);
- CPPUNIT_TEST(testMe);
- CPPUNIT_TEST_SUITE_END();
-
- public:
-
- void 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();
-
- Message::shared_ptr msgPtr(new Message(0, "e", "A", true, true));
- DeliverableMessage msg(msgPtr);
- topic.route(msg, "abc", 0);
- direct.route(msg, "abc", 0);
-
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(ExchangeTest);
diff --git a/Final/cpp/tests/FieldTableTest.cpp b/Final/cpp/tests/FieldTableTest.cpp
deleted file mode 100644
index 8d9285bf4b..0000000000
--- a/Final/cpp/tests/FieldTableTest.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 <iostream>
-#include <amqp_framing.h>
-#include <qpid_test_plugin.h>
-
-using namespace qpid::framing;
-
-class FieldTableTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(FieldTableTest);
- CPPUNIT_TEST(testMe);
- CPPUNIT_TEST_SUITE_END();
-
- public:
-
- void testMe()
- {
- FieldTable ft;
- ft.setString("A", "BCDE");
- CPPUNIT_ASSERT_EQUAL(std::string("BCDE"), ft.getString("A"));
-
- Buffer buffer(100);
- buffer.putFieldTable(ft);
- buffer.flip();
- FieldTable ft2;
- buffer.getFieldTable(ft2);
- CPPUNIT_ASSERT_EQUAL(std::string("BCDE"), ft2.getString("A"));
-
- }
-};
-
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(FieldTableTest);
-
diff --git a/Final/cpp/tests/FramingTest.cpp b/Final/cpp/tests/FramingTest.cpp
deleted file mode 100644
index e4d289d3d5..0000000000
--- a/Final/cpp/tests/FramingTest.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 <ConnectionRedirectBody.h>
-#include <ProtocolVersion.h>
-#include <amqp_framing.h>
-#include <iostream>
-#include <qpid_test_plugin.h>
-#include <sstream>
-#include <typeinfo>
-#include <AMQP_HighestVersion.h>
-
-
-using namespace qpid::framing;
-
-template <class T>
-std::string tostring(const T& x)
-{
- std::ostringstream out;
- out << x;
- return out.str();
-}
-
-class FramingTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(FramingTest);
- CPPUNIT_TEST(testBasicQosBody);
- CPPUNIT_TEST(testConnectionSecureBody);
- CPPUNIT_TEST(testConnectionRedirectBody);
- CPPUNIT_TEST(testAccessRequestBody);
- CPPUNIT_TEST(testBasicConsumeBody);
- CPPUNIT_TEST(testConnectionRedirectBodyFrame);
- CPPUNIT_TEST(testBasicConsumeOkBodyFrame);
- CPPUNIT_TEST_SUITE_END();
-
- private:
- Buffer buffer;
- ProtocolVersion v;
-
- public:
-
- FramingTest() : buffer(100), v(qpid::framing::highestProtocolVersion){}
-
- void testBasicQosBody()
- {
- BasicQosBody in(v, 0xCAFEBABE, 0xABBA, true);
- in.encodeContent(buffer);
- buffer.flip();
- BasicQosBody out(v);
- out.decodeContent(buffer);
- CPPUNIT_ASSERT_EQUAL(tostring(in), tostring(out));
- }
-
- void testConnectionSecureBody()
- {
- std::string s = "security credential";
- ConnectionSecureBody in(v, s);
- in.encodeContent(buffer);
- buffer.flip();
- ConnectionSecureBody out(v);
- out.decodeContent(buffer);
- CPPUNIT_ASSERT_EQUAL(tostring(in), tostring(out));
- }
-
- void testConnectionRedirectBody()
- {
- std::string a = "hostA";
- std::string b = "hostB";
- ConnectionRedirectBody in(v, a, b);
- in.encodeContent(buffer);
- buffer.flip();
- ConnectionRedirectBody out(v);
- out.decodeContent(buffer);
- CPPUNIT_ASSERT_EQUAL(tostring(in), tostring(out));
- }
-
- void testAccessRequestBody()
- {
- std::string s = "text";
- AccessRequestBody in(v, s, true, false, true, false, true);
- in.encodeContent(buffer);
- buffer.flip();
- AccessRequestBody out(v);
- out.decodeContent(buffer);
- CPPUNIT_ASSERT_EQUAL(tostring(in), tostring(out));
- }
-
- void testBasicConsumeBody()
- {
- std::string q = "queue";
- std::string t = "tag";
- BasicConsumeBody in(v, 0, q, t, false, true, false, false,
- FieldTable());
- in.encodeContent(buffer);
- buffer.flip();
- BasicConsumeBody out(v);
- out.decodeContent(buffer);
- CPPUNIT_ASSERT_EQUAL(tostring(in), tostring(out));
- }
-
-
- void testConnectionRedirectBodyFrame()
- {
- std::string a = "hostA";
- std::string b = "hostB";
- AMQFrame in(highestProtocolVersion, 999, new ConnectionRedirectBody(v, a, b));
- in.encode(buffer);
- buffer.flip();
- AMQFrame out;
- out.decode(buffer);
- CPPUNIT_ASSERT_EQUAL(tostring(in), tostring(out));
- }
-
- void testBasicConsumeOkBodyFrame()
- {
- std::string s = "hostA";
- AMQFrame in(highestProtocolVersion, 999, new BasicConsumeOkBody(v, s));
- in.encode(buffer);
- buffer.flip();
- AMQFrame out;
- for(int i = 0; i < 5; i++){
- out.decode(buffer);
- CPPUNIT_ASSERT_EQUAL(tostring(in), tostring(out));
- }
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(FramingTest);
-
-
-
diff --git a/Final/cpp/tests/HeaderTest.cpp b/Final/cpp/tests/HeaderTest.cpp
deleted file mode 100644
index 01927c7190..0000000000
--- a/Final/cpp/tests/HeaderTest.cpp
+++ /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.
- *
- */
-#include <iostream>
-#include <amqp_framing.h>
-#include <qpid_test_plugin.h>
-
-using namespace qpid::framing;
-
-class HeaderTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(HeaderTest);
- CPPUNIT_TEST(testGenericProperties);
- CPPUNIT_TEST(testAllSpecificProperties);
- CPPUNIT_TEST(testSomeSpecificProperties);
- CPPUNIT_TEST_SUITE_END();
-
-public:
-
- void testGenericProperties()
- {
- AMQHeaderBody body(BASIC);
- dynamic_cast<BasicHeaderProperties*>(body.getProperties())->getHeaders().setString("A", "BCDE");
- Buffer buffer(100);
-
- body.encode(buffer);
- buffer.flip();
- AMQHeaderBody body2;
- body2.decode(buffer, body.size());
- BasicHeaderProperties* props =
- dynamic_cast<BasicHeaderProperties*>(body2.getProperties());
- CPPUNIT_ASSERT_EQUAL(std::string("BCDE"),
- props->getHeaders().getString("A"));
- }
-
- void testAllSpecificProperties(){
- string contentType("text/html");
- string contentEncoding("UTF8");
- u_int8_t deliveryMode(2);
- u_int8_t priority(3);
- string correlationId("abc");
- string replyTo("no-address");
- string expiration("why is this a string?");
- string messageId("xyz");
- u_int64_t timestamp(0xabcd);
- string type("eh?");
- string userId("guest");
- string appId("just testing");
- string clusterId("no clustering required");
-
- AMQHeaderBody body(BASIC);
- BasicHeaderProperties* properties =
- dynamic_cast<BasicHeaderProperties*>(body.getProperties());
- properties->setContentType(contentType);
- properties->getHeaders().setString("A", "BCDE");
- properties->setDeliveryMode(deliveryMode);
- properties->setPriority(priority);
- properties->setCorrelationId(correlationId);
- properties->setReplyTo(replyTo);
- properties->setExpiration(expiration);
- properties->setMessageId(messageId);
- properties->setTimestamp(timestamp);
- properties->setType(type);
- properties->setUserId(userId);
- properties->setAppId(appId);
- properties->setClusterId(clusterId);
-
- Buffer buffer(10000);
- body.encode(buffer);
- buffer.flip();
- AMQHeaderBody temp;
- temp.decode(buffer, body.size());
- properties = dynamic_cast<BasicHeaderProperties*>(temp.getProperties());
-
- CPPUNIT_ASSERT_EQUAL(contentType, properties->getContentType());
- CPPUNIT_ASSERT_EQUAL(std::string("BCDE"), properties->getHeaders().getString("A"));
- CPPUNIT_ASSERT_EQUAL(deliveryMode, properties->getDeliveryMode());
- CPPUNIT_ASSERT_EQUAL(priority, properties->getPriority());
- CPPUNIT_ASSERT_EQUAL(correlationId, properties->getCorrelationId());
- CPPUNIT_ASSERT_EQUAL(replyTo, properties->getReplyTo());
- CPPUNIT_ASSERT_EQUAL(expiration, properties->getExpiration());
- CPPUNIT_ASSERT_EQUAL(messageId, properties->getMessageId());
- CPPUNIT_ASSERT_EQUAL(timestamp, properties->getTimestamp());
- CPPUNIT_ASSERT_EQUAL(type, properties->getType());
- CPPUNIT_ASSERT_EQUAL(userId, properties->getUserId());
- CPPUNIT_ASSERT_EQUAL(appId, properties->getAppId());
- CPPUNIT_ASSERT_EQUAL(clusterId, properties->getClusterId());
- }
-
- void testSomeSpecificProperties(){
- string contentType("application/octet-stream");
- u_int8_t deliveryMode(5);
- u_int8_t priority(6);
- string expiration("Z");
- u_int64_t timestamp(0xabe4a34a);
-
- AMQHeaderBody body(BASIC);
- BasicHeaderProperties* properties =
- dynamic_cast<BasicHeaderProperties*>(body.getProperties());
- properties->setContentType(contentType);
- properties->setDeliveryMode(deliveryMode);
- properties->setPriority(priority);
- properties->setExpiration(expiration);
- properties->setTimestamp(timestamp);
-
- Buffer buffer(100);
- body.encode(buffer);
- buffer.flip();
- AMQHeaderBody temp;
- temp.decode(buffer, body.size());
- properties = dynamic_cast<BasicHeaderProperties*>(temp.getProperties());
-
- CPPUNIT_ASSERT_EQUAL(contentType, properties->getContentType());
- CPPUNIT_ASSERT_EQUAL((int) deliveryMode, (int) properties->getDeliveryMode());
- CPPUNIT_ASSERT_EQUAL((int) priority, (int) properties->getPriority());
- CPPUNIT_ASSERT_EQUAL(expiration, properties->getExpiration());
- CPPUNIT_ASSERT_EQUAL(timestamp, properties->getTimestamp());
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(HeaderTest);
-
diff --git a/Final/cpp/tests/HeadersExchangeTest.cpp b/Final/cpp/tests/HeadersExchangeTest.cpp
deleted file mode 100644
index 6cd51c55a9..0000000000
--- a/Final/cpp/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 <HeadersExchange.h>
-#include <FieldTable.h>
-#include <Value.h>
-#include <qpid_test_plugin.h>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-class HeadersExchangeTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(HeadersExchangeTest);
- CPPUNIT_TEST(testMatchAll);
- CPPUNIT_TEST(testMatchAny);
- CPPUNIT_TEST(testMatchEmptyValue);
- CPPUNIT_TEST(testMatchEmptyArgs);
- CPPUNIT_TEST(testMatchNoXMatch);
- CPPUNIT_TEST_SUITE_END();
-
- public:
-
- void testMatchAll()
- {
- FieldTable b, m;
- b.setString("x-match", "all");
- b.setString("foo", "FOO");
- b.setInt("n", 42);
- m.setString("foo", "FOO");
- m.setInt("n", 42);
- CPPUNIT_ASSERT(HeadersExchange::match(b, m));
-
- // Ignore extras.
- m.setString("extra", "x");
- CPPUNIT_ASSERT(HeadersExchange::match(b, m));
-
- // Fail mismatch, wrong value.
- m.setString("foo", "NotFoo");
- CPPUNIT_ASSERT(!HeadersExchange::match(b, m));
-
- // Fail mismatch, missing value
- m.erase("foo");
- CPPUNIT_ASSERT(!HeadersExchange::match(b, m));
- }
-
- void testMatchAny()
- {
- FieldTable b, m;
- b.setString("x-match", "any");
- b.setString("foo", "FOO");
- b.setInt("n", 42);
- m.setString("foo", "FOO");
- CPPUNIT_ASSERT(HeadersExchange::match(b, m));
- m.erase("foo");
- CPPUNIT_ASSERT(!HeadersExchange::match(b, m));
- m.setInt("n", 42);
- CPPUNIT_ASSERT(HeadersExchange::match(b, m));
- }
-
- void testMatchEmptyValue()
- {
- FieldTable b, m;
- b.setString("x-match", "all");
- b.getMap()["foo"] = FieldTable::ValuePtr(new EmptyValue());
- b.getMap()["n"] = FieldTable::ValuePtr(new EmptyValue());
- CPPUNIT_ASSERT(!HeadersExchange::match(b, m));
- m.setString("foo", "blah");
- m.setInt("n", 123);
- }
-
- void testMatchEmptyArgs()
- {
- FieldTable b, m;
- m.setString("foo", "FOO");
-
- b.setString("x-match", "all");
- CPPUNIT_ASSERT(HeadersExchange::match(b, m));
- b.setString("x-match", "any");
- CPPUNIT_ASSERT(!HeadersExchange::match(b, m));
- }
-
-
- void testMatchNoXMatch()
- {
- FieldTable b, m;
- b.setString("foo", "FOO");
- m.setString("foo", "FOO");
- CPPUNIT_ASSERT(!HeadersExchange::match(b, m));
- }
-
-
-};
-
-// make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(HeadersExchangeTest);
diff --git a/Final/cpp/tests/InMemoryContentTest.cpp b/Final/cpp/tests/InMemoryContentTest.cpp
deleted file mode 100644
index bd638dae66..0000000000
--- a/Final/cpp/tests/InMemoryContentTest.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 <InMemoryContent.h>
-#include <qpid_test_plugin.h>
-#include <AMQP_HighestVersion.h>
-#include <iostream>
-#include <list>
-
-using std::list;
-using std::string;
-using boost::dynamic_pointer_cast;
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-struct DummyHandler : OutputHandler{
- std::vector<AMQFrame*> frames;
-
- virtual void send(AMQFrame* frame){
- frames.push_back(frame);
- }
-};
-
-class InMemoryContentTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(InMemoryContentTest);
- CPPUNIT_TEST(testRefragmentation);
- CPPUNIT_TEST_SUITE_END();
-
-public:
- void testRefragmentation()
- {
- {//no remainder
- string out[] = {"abcde", "fghij", "klmno", "pqrst"};
- string in[] = {out[0] + out[1], out[2] + out[3]};
- refragment(2, in, 4, out);
- }
- {//remainder for last frame
- string out[] = {"abcde", "fghij", "klmno", "pqrst", "uvw"};
- string in[] = {out[0] + out[1], out[2] + out[3] + out[4]};
- refragment(2, in, 5, out);
- }
- }
-
-
- void refragment(size_t inCount, string* in, size_t outCount, string* out, u_int32_t framesize = 5)
- {
- InMemoryContent content;
- DummyHandler handler;
- u_int16_t channel = 3;
-
- addframes(content, inCount, in);
- content.send(highestProtocolVersion, &handler, channel, framesize);
- check(handler, channel, outCount, out);
- }
-
- void addframes(InMemoryContent& content, size_t frameCount, string* frameData)
- {
- for (unsigned int i = 0; i < frameCount; i++) {
- AMQContentBody::shared_ptr frame(new AMQContentBody(frameData[i]));
- content.add(frame);
- }
- }
-
- void check(DummyHandler& handler, u_int16_t channel, size_t expectedChunkCount, string* expectedChunks)
- {
- CPPUNIT_ASSERT_EQUAL(expectedChunkCount, handler.frames.size());
-
- for (unsigned int i = 0; i < expectedChunkCount; i++) {
- AMQContentBody::shared_ptr chunk(dynamic_pointer_cast<AMQContentBody, AMQBody>(handler.frames[i]->getBody()));
- CPPUNIT_ASSERT(chunk);
- CPPUNIT_ASSERT_EQUAL(expectedChunks[i], chunk->getData());
- CPPUNIT_ASSERT_EQUAL(channel, handler.frames[i]->getChannel());
- }
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(InMemoryContentTest);
-
diff --git a/Final/cpp/tests/LazyLoadedContentTest.cpp b/Final/cpp/tests/LazyLoadedContentTest.cpp
deleted file mode 100644
index 2075a6dd3a..0000000000
--- a/Final/cpp/tests/LazyLoadedContentTest.cpp
+++ /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.
- *
- */
-#include <LazyLoadedContent.h>
-#include <AMQP_HighestVersion.h>
-#include <NullMessageStore.h>
-#include <qpid_test_plugin.h>
-#include <iostream>
-#include <list>
-#include <sstream>
-
-using std::list;
-using std::string;
-using boost::dynamic_pointer_cast;
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-struct DummyHandler : OutputHandler{
- std::vector<AMQFrame*> frames;
-
- virtual void send(AMQFrame* frame){
- frames.push_back(frame);
- }
-};
-
-
-class LazyLoadedContentTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(LazyLoadedContentTest);
- CPPUNIT_TEST(testFragmented);
- CPPUNIT_TEST(testWhole);
- CPPUNIT_TEST(testHalved);
- CPPUNIT_TEST_SUITE_END();
-
- class TestMessageStore : public NullMessageStore
- {
- const string content;
-
- public:
- TestMessageStore(const string& _content) : content(_content) {}
-
- void loadContent(Message* const, string& data, u_int64_t offset, u_int32_t length)
- {
- if (offset + length <= content.size()) {
- data = content.substr(offset, length);
- } else{
- std::stringstream error;
- error << "Invalid segment: offset=" << offset << ", length=" << length << ", content_length=" << content.size();
- throw qpid::Exception(error.str());
- }
- }
- };
-
-
-public:
- void testFragmented()
- {
- string data = "abcdefghijklmnopqrstuvwxyz";
- u_int32_t framesize = 5;
- string out[] = {"abcde", "fghij", "klmno", "pqrst", "uvwxy", "z"};
- load(data, 6, out, framesize);
- }
-
- void testWhole()
- {
- string data = "abcdefghijklmnopqrstuvwxyz";
- u_int32_t framesize = 50;
- string out[] = {data};
- load(data, 1, out, framesize);
- }
-
- void testHalved()
- {
- string data = "abcdefghijklmnopqrstuvwxyz";
- u_int32_t framesize = 13;
- string out[] = {"abcdefghijklm", "nopqrstuvwxyz"};
- load(data, 2, out, framesize);
- }
-
- void load(string& in, size_t outCount, string* out, u_int32_t framesize)
- {
- TestMessageStore store(in);
- LazyLoadedContent content(&store, 0, in.size());
- DummyHandler handler;
- u_int16_t channel = 3;
- content.send(highestProtocolVersion, &handler, channel, framesize);
- check(handler, channel, outCount, out);
- }
-
- void check(DummyHandler& handler, u_int16_t channel, size_t expectedChunkCount, string* expectedChunks)
- {
- CPPUNIT_ASSERT_EQUAL(expectedChunkCount, handler.frames.size());
-
- for (unsigned int i = 0; i < expectedChunkCount; i++) {
- AMQContentBody::shared_ptr chunk(dynamic_pointer_cast<AMQContentBody, AMQBody>(handler.frames[i]->getBody()));
- CPPUNIT_ASSERT(chunk);
- CPPUNIT_ASSERT_EQUAL(expectedChunks[i], chunk->getData());
- CPPUNIT_ASSERT_EQUAL(channel, handler.frames[i]->getChannel());
- }
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(LazyLoadedContentTest);
-
diff --git a/Final/cpp/tests/Makefile.am b/Final/cpp/tests/Makefile.am
deleted file mode 100644
index 256e68058d..0000000000
--- a/Final/cpp/tests/Makefile.am
+++ /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.
-#
-AM_CXXFLAGS = $(WARNING_CFLAGS) $(CPPUNIT_CXXFLAGS)
-INCLUDES = \
- -I$(top_srcdir)/gen \
- -I$(top_srcdir)/lib \
- -I$(top_srcdir)/lib/client \
- -I$(top_srcdir)/lib/broker \
- -I$(top_srcdir)/lib/common \
- -I$(top_srcdir)/lib/common/sys \
- -I$(top_srcdir)/lib/common/framing \
- $(APR_CXXFLAGS)
-
-# FIXME: have e.g., topicall, run as part of "make check"?
-EXTRA_DIST = \
- .vg-supp \
- setup \
- env \
- topicall \
- topictest \
- qpid_test_plugin.h \
- APRBaseTest.cpp
-
-client_tests = \
- client_test \
- echo_service \
- topic_listener \
- topic_publisher
-
-broker_tests = \
- AccumulatedAckTest \
- ChannelTest \
- ExchangeTest \
- HeadersExchangeTest \
- InMemoryContentTest \
- LazyLoadedContentTest \
- MessageBuilderTest \
- MessageTest \
- QueueRegistryTest \
- QueueTest \
- QueuePolicyTest \
- TopicExchangeTest \
- TxAckTest \
- TxBufferTest \
- TxPublishTest \
- ValueTest
-
-framing_tests = \
- BodyHandlerTest \
- FieldTableTest \
- FramingTest \
- HeaderTest
-
-misc_tests = \
- ExceptionTest
-
-posix_tests = \
- EventChannelTest \
- EventChannelThreadsTest
-
-unit_tests = \
- $(broker_tests) \
- $(framing_tests) \
- $(misc_tests)
-
-
-noinst_PROGRAMS = $(client_tests)
-
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-
-TESTS_ENVIRONMENT = \
- VALGRIND=$(VALGRIND) \
- abs_builddir='$(abs_builddir)' \
- PATH="$(abs_srcdir)$(PATH_SEPARATOR)$(abs_builddir)/../src$(PATH_SEPARATOR)$$PATH" \
- abs_srcdir='$(abs_srcdir)'
-
-TESTS = run-unit-tests run-python-tests daemon_test
-EXTRA_DIST += $(TESTS)
-
-CLEANFILES=qpidd.log
-DISTCLEANFILES=gen.mk
-
-include gen.mk
-
-extra_libs = $(CPPUNIT_LIBS)
-lib_client = $(abs_builddir)/../lib/client/libqpidclient.la
-lib_common = $(abs_builddir)/../lib/common/libqpidcommon.la
-lib_broker = $(abs_builddir)/../lib/broker/libqpidbroker.la
-
-gen.mk: Makefile.am
- ( \
- for i in $(client_tests); do \
- echo $${i}_SOURCES = $$i.cpp; \
- echo $${i}_LDADD = '$$(lib_client) $$(lib_common) $$(extra_libs)'; \
- done; \
- libs=; \
- for i in $(unit_tests); do \
- libs="$$libs $${i}.la"; \
- echo $${i}_la_SOURCES = $$i.cpp; \
- echo $${i}_la_LIBADD = '$$(lib_common)'; \
- echo $${i}_la_LIBADD += '$$(lib_broker) $$(extra_libs)'; \
- echo $${i}_la_LDFLAGS = "-module -rpath `pwd`"; \
- done; \
- echo "check_LTLIBRARIES =$$libs"; \
- ) \
- > $@-t
- mv $@-t $@
-
-check_PROGRAMS = interop_runner
-interop_runner_SOURCES = \
- interop_runner.cpp \
- TestUtils.cpp \
- SimpleTestCaseBase.cpp \
- BasicP2PTest.cpp \
- BasicPubSubTest.cpp \
- P2PMessageSizeTest.cpp \
- PubSubMessageSizeTest.cpp \
- TestUtils.h \
- SimpleTestCaseBase.h \
- BasicP2PTest.h \
- BasicPubSubTest.h \
- P2PMessageSizeTest.h \
- PubSubMessageSizeTest.h \
- TestCase.h \
- TestOptions.h
-interop_runner_LDADD = $(lib_client) $(lib_common) $(extra_libs)
diff --git a/Final/cpp/tests/MessageBuilderTest.cpp b/Final/cpp/tests/MessageBuilderTest.cpp
deleted file mode 100644
index 88e8318832..0000000000
--- a/Final/cpp/tests/MessageBuilderTest.cpp
+++ /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.
- *
- */
-#include <Exception.h>
-#include <BrokerMessage.h>
-#include <MessageBuilder.h>
-#include <NullMessageStore.h>
-#include <Buffer.h>
-#include <qpid_test_plugin.h>
-#include <iostream>
-#include <memory>
-
-using namespace boost;
-using namespace qpid::broker;
-using namespace qpid::framing;
-using namespace qpid::sys;
-
-class MessageBuilderTest : public CppUnit::TestCase
-{
- struct DummyHandler : MessageBuilder::CompletionHandler{
- Message::shared_ptr msg;
-
- virtual void complete(Message::shared_ptr& _msg){
- msg = _msg;
- }
- };
-
- class TestMessageStore : public NullMessageStore
- {
- Buffer* header;
- Buffer* content;
- const u_int32_t contentBufferSize;
-
- public:
-
- void stage(Message* const msg)
- {
- if (msg->getPersistenceId() == 0) {
- header = new Buffer(msg->encodedHeaderSize());
- msg->encodeHeader(*header);
- content = new Buffer(contentBufferSize);
- msg->setPersistenceId(1);
- } else {
- throw qpid::Exception("Message already staged!");
- }
- }
-
- void appendContent(Message* msg, const string& data)
- {
- if (msg) {
- content->putRawData(data);
- } else {
- throw qpid::Exception("Invalid message id!");
- }
- }
-
- void destroy(Message* msg)
- {
- CPPUNIT_ASSERT(msg->getPersistenceId());
- }
-
- Message::shared_ptr getRestoredMessage()
- {
- Message::shared_ptr msg(new Message());
- if (header) {
- header->flip();
- msg->decodeHeader(*header);
- delete header;
- header = 0;
- if (content) {
- content->flip();
- msg->decodeContent(*content);
- delete content;
- content = 0;
- }
- }
- return msg;
- }
-
- //dont care about any of the other methods:
- TestMessageStore(u_int32_t _contentBufferSize) : NullMessageStore(false), header(0), content(0),
- contentBufferSize(_contentBufferSize) {}
- ~TestMessageStore(){}
- };
-
- CPPUNIT_TEST_SUITE(MessageBuilderTest);
- CPPUNIT_TEST(testHeaderOnly);
- CPPUNIT_TEST(test1ContentFrame);
- CPPUNIT_TEST(test2ContentFrames);
- CPPUNIT_TEST(testStaging);
- CPPUNIT_TEST_SUITE_END();
-
- public:
-
- void testHeaderOnly(){
- DummyHandler handler;
- MessageBuilder builder(&handler);
-
- Message::shared_ptr message(new Message(0, "test", "my_routing_key", false, false));
- AMQHeaderBody::shared_ptr header(new AMQHeaderBody(BASIC));
- header->setContentSize(0);
-
- builder.initialise(message);
- CPPUNIT_ASSERT(!handler.msg);
- builder.setHeader(header);
- CPPUNIT_ASSERT(handler.msg);
- CPPUNIT_ASSERT_EQUAL(message, handler.msg);
- }
-
- void test1ContentFrame(){
- DummyHandler handler;
- MessageBuilder builder(&handler);
-
- string data1("abcdefg");
-
- Message::shared_ptr message(new Message(0, "test", "my_routing_key", false, false));
- AMQHeaderBody::shared_ptr header(new AMQHeaderBody(BASIC));
- header->setContentSize(7);
- AMQContentBody::shared_ptr part1(new AMQContentBody(data1));
-
- builder.initialise(message);
- CPPUNIT_ASSERT(!handler.msg);
- builder.setHeader(header);
- CPPUNIT_ASSERT(!handler.msg);
- builder.addContent(part1);
- CPPUNIT_ASSERT(handler.msg);
- CPPUNIT_ASSERT_EQUAL(message, handler.msg);
- }
-
- void test2ContentFrames(){
- DummyHandler handler;
- MessageBuilder builder(&handler);
-
- string data1("abcdefg");
- string data2("hijklmn");
-
- Message::shared_ptr message(new Message(0, "test", "my_routing_key", false, false));
- AMQHeaderBody::shared_ptr header(new AMQHeaderBody(BASIC));
- header->setContentSize(14);
- AMQContentBody::shared_ptr part1(new AMQContentBody(data1));
- AMQContentBody::shared_ptr part2(new AMQContentBody(data2));
-
- builder.initialise(message);
- CPPUNIT_ASSERT(!handler.msg);
- builder.setHeader(header);
- CPPUNIT_ASSERT(!handler.msg);
- builder.addContent(part1);
- CPPUNIT_ASSERT(!handler.msg);
- builder.addContent(part2);
- CPPUNIT_ASSERT(handler.msg);
- CPPUNIT_ASSERT_EQUAL(message, handler.msg);
- }
-
- void testStaging(){
- //store must be the last thing to be destroyed or destructor
- //of Message fails (it uses the store to call destroy if lazy
- //loaded content is in use)
- TestMessageStore store(14);
- {
- DummyHandler handler;
- MessageBuilder builder(&handler, &store, 5);
-
- string data1("abcdefg");
- string data2("hijklmn");
-
- Message::shared_ptr message(new Message(0, "test", "my_routing_key", false, false));
- AMQHeaderBody::shared_ptr header(new AMQHeaderBody(BASIC));
- header->setContentSize(14);
- BasicHeaderProperties* properties = dynamic_cast<BasicHeaderProperties*>(header->getProperties());
- properties->setMessageId("MyMessage");
- properties->getHeaders().setString("abc", "xyz");
-
- AMQContentBody::shared_ptr part1(new AMQContentBody(data1));
- AMQContentBody::shared_ptr part2(new AMQContentBody(data2));
-
- builder.initialise(message);
- builder.setHeader(header);
- builder.addContent(part1);
- builder.addContent(part2);
- CPPUNIT_ASSERT(handler.msg);
- CPPUNIT_ASSERT_EQUAL(message, handler.msg);
-
- Message::shared_ptr restored = store.getRestoredMessage();
- CPPUNIT_ASSERT_EQUAL(message->getExchange(), restored->getExchange());
- CPPUNIT_ASSERT_EQUAL(message->getRoutingKey(), restored->getRoutingKey());
- CPPUNIT_ASSERT_EQUAL(message->getHeaderProperties()->getMessageId(), restored->getHeaderProperties()->getMessageId());
- CPPUNIT_ASSERT_EQUAL(message->getHeaderProperties()->getHeaders().getString("abc"),
- restored->getHeaderProperties()->getHeaders().getString("abc"));
- CPPUNIT_ASSERT_EQUAL((u_int64_t) 14, restored->contentSize());
- }
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(MessageBuilderTest);
diff --git a/Final/cpp/tests/MessageTest.cpp b/Final/cpp/tests/MessageTest.cpp
deleted file mode 100644
index bcf3ad8064..0000000000
--- a/Final/cpp/tests/MessageTest.cpp
+++ /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.
- *
- */
-#include <BrokerMessage.h>
-#include <qpid_test_plugin.h>
-#include <iostream>
-#include <AMQP_HighestVersion.h>
-
-using namespace boost;
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-struct DummyHandler : OutputHandler{
- std::vector<AMQFrame*> frames;
-
- virtual void send(AMQFrame* frame){
- frames.push_back(frame);
- }
-};
-
-class MessageTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(MessageTest);
- CPPUNIT_TEST(testEncodeDecode);
- CPPUNIT_TEST_SUITE_END();
-
- public:
-
- void testEncodeDecode()
- {
- string exchange = "MyExchange";
- string routingKey = "MyRoutingKey";
- string messageId = "MyMessage";
- string data1("abcdefg");
- string data2("hijklmn");
-
- Message::shared_ptr msg = Message::shared_ptr(new Message(0, exchange, routingKey, false, false));
- AMQHeaderBody::shared_ptr header(new AMQHeaderBody(BASIC));
- header->setContentSize(14);
- AMQContentBody::shared_ptr part1(new AMQContentBody(data1));
- AMQContentBody::shared_ptr part2(new AMQContentBody(data2));
- msg->setHeader(header);
- msg->addContent(part1);
- msg->addContent(part2);
-
- msg->getHeaderProperties()->setMessageId(messageId);
- msg->getHeaderProperties()->setDeliveryMode(PERSISTENT);
- msg->getHeaderProperties()->getHeaders().setString("abc", "xyz");
-
- Buffer buffer(msg->encodedSize());
- msg->encode(buffer);
- buffer.flip();
-
- msg = Message::shared_ptr(new Message(buffer));
- CPPUNIT_ASSERT_EQUAL(exchange, msg->getExchange());
- CPPUNIT_ASSERT_EQUAL(routingKey, msg->getRoutingKey());
- CPPUNIT_ASSERT_EQUAL(messageId, msg->getHeaderProperties()->getMessageId());
- CPPUNIT_ASSERT_EQUAL((u_int8_t) PERSISTENT, msg->getHeaderProperties()->getDeliveryMode());
- CPPUNIT_ASSERT_EQUAL(string("xyz"), msg->getHeaderProperties()->getHeaders().getString("abc"));
- CPPUNIT_ASSERT_EQUAL((u_int64_t) 14, msg->contentSize());
-
- DummyHandler handler;
- msg->deliver(&handler, 0, "ignore", 0, 100, &(qpid::framing::highestProtocolVersion));
- CPPUNIT_ASSERT_EQUAL((size_t) 3, handler.frames.size());
- AMQContentBody::shared_ptr contentBody(dynamic_pointer_cast<AMQContentBody, AMQBody>(handler.frames[2]->getBody()));
- CPPUNIT_ASSERT(contentBody);
- CPPUNIT_ASSERT_EQUAL(data1 + data2, contentBody->getData());
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(MessageTest);
-
diff --git a/Final/cpp/tests/MockSessionHandler.h b/Final/cpp/tests/MockSessionHandler.h
deleted file mode 100644
index 165436adf1..0000000000
--- a/Final/cpp/tests/MockSessionHandler.h
+++ /dev/null
@@ -1,116 +0,0 @@
-#ifndef _tests_MockSessionHandler_h
-#define _tests_MockSessionHandler_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 "sys/SessionHandler.h"
-#include "sys/SessionHandlerFactory.h"
-#include "sys/Monitor.h"
-#include "framing/ProtocolInitiation.h"
-
-struct MockSessionHandler : public qpid::sys::SessionHandler {
-
- MockSessionHandler() : state(START) {}
-
- ~MockSessionHandler() {}
-
- void initiated(qpid::framing::ProtocolInitiation* pi) {
- qpid::sys::Monitor::ScopedLock l(monitor);
- init = *pi;
- setState(GOT_INIT);
- }
-
- void received(qpid::framing::AMQFrame* framep) {
- qpid::sys::Monitor::ScopedLock l(monitor);
- frame = *framep;
- setState(GOT_FRAME);
- }
-
- qpid::framing::ProtocolInitiation waitForProtocolInit() {
- waitFor(GOT_INIT);
- return init;
- }
-
- qpid::framing::AMQFrame waitForFrame() {
- waitFor(GOT_FRAME);
- return frame;
- }
-
- void waitForClosed() {
- waitFor(CLOSED);
- }
-
- void closed() {
- qpid::sys::Monitor::ScopedLock l(monitor);
- setState(CLOSED);
- }
-
- void idleOut() {}
- void idleIn() {}
-
- private:
- typedef enum { START, GOT_INIT, GOT_FRAME, CLOSED } State;
-
- void setState(State s) {
- state = s;
- monitor.notify();
- }
-
- void waitFor(State s) {
- qpid::sys::Monitor::ScopedLock l(monitor);
- qpid::sys::Time deadline = qpid::sys::now() + 10*qpid::sys::TIME_SEC;
- while (state != s)
- CPPUNIT_ASSERT(monitor.wait(deadline));
- }
-
- qpid::sys::Monitor monitor;
- State state;
- qpid::framing::ProtocolInitiation init;
- qpid::framing::AMQFrame frame;
-};
-
-
-struct MockSessionHandlerFactory : public qpid::sys::SessionHandlerFactory {
- MockSessionHandlerFactory() : handler(0) {}
-
- qpid::sys::SessionHandler* create(qpid::sys::SessionContext*) {
- qpid::sys::Monitor::ScopedLock lock(monitor);
- handler = new MockSessionHandler();
- monitor.notifyAll();
- return handler;
- }
-
- void waitForHandler() {
- qpid::sys::Monitor::ScopedLock lock(monitor);
- qpid::sys::Time deadline =
- qpid::sys::now() + 500 * qpid::sys::TIME_SEC;
- while (handler == 0)
- CPPUNIT_ASSERT(monitor.wait(deadline));
- }
-
- MockSessionHandler* handler;
- qpid::sys::Monitor monitor;
-};
-
-
-
-#endif /*!_tests_MockSessionHandler_h*/
diff --git a/Final/cpp/tests/P2PMessageSizeTest.cpp b/Final/cpp/tests/P2PMessageSizeTest.cpp
deleted file mode 100644
index 20ddb6e2aa..0000000000
--- a/Final/cpp/tests/P2PMessageSizeTest.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 "P2PMessageSizeTest.h"
-
-using namespace qpid;
-using namespace qpid::client;
-
-/**
- * P2PMessageSizeTest::Receiver is a Worker to play the receiving role in P2P test.
- *
- * TODO: This code is identical to the receiver in BasicP2PTest so should share implementation with that.
- */
-class P2PMessageSizeTest::Receiver : public Worker, public MessageListener
-{
- /** Holds the name of the queue to send the test message on. */
- const std::string queue;
-
- /** Used for ? */
- std::string tag;
-
-public:
-
- /**
- * Creates a new Worker from given the TestOptions. The namd of the queue, to consume from is also specified.
- *
- * @param options The test options to configure the worker with.
- * @param _queue The name of the queue to consume from on the default direct exchange.
- * @param _mesages The expected number of messages to consume. Ignored.
- */
- Receiver(TestOptions& options, const std::string& _queue, const int _messages)
- : Worker(options, _messages), queue(_queue)
- {}
-
- /**
- * Binds this receivers queue to the standard exchange, and starts the dispatcher thread on its channel.
- */
- 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();
- }
-
- /**
- * Does nothing.
- */
- void start()
- {
- }
-
- /**
- * Increments the message count, on every message received.
- *
- * @param message The test message. Ignored.
- */
- void received(Message& )
- {
- count++;
- }
-};
-
-/**
- * Assigns the role to be played by this test case. The test parameters are fully specified in the
- * assignment messages filed table. If the role is "SENDER" a Sender worker is created to delegate
- * the test functionality to, if the role is "RECEIVER" a Receiver is used.
- *
- * @param role The role to be played; sender or receiver.
- * @param assignRoleMessage The role assingment messages field table, contains the full test parameters.
- * @param options Additional test options.
- */
-void P2PMessageSizeTest::assign(const std::string& role, framing::FieldTable& params, TestOptions& options)
-{
- std::string queue = params.getString("P2P_QUEUE_AND_KEY_NAME");
-
- int messages = params.getInt("P2P_NUM_MESSAGES");
- int messageSize = params.getInt("messageSize");
-
- if (role == "SENDER")
- {
- worker = std::auto_ptr<Worker>(new Sender(options, Exchange::STANDARD_DIRECT_EXCHANGE, queue, messages, messageSize));
- }
- else if(role == "RECEIVER")
- {
- worker = std::auto_ptr<Worker>(new Receiver(options, queue, messages));
- }
- else
- {
- throw Exception("unrecognised role");
- }
-
- worker->init();
-}
diff --git a/Final/cpp/tests/P2PMessageSizeTest.h b/Final/cpp/tests/P2PMessageSizeTest.h
deleted file mode 100644
index c434e74f4d..0000000000
--- a/Final/cpp/tests/P2PMessageSizeTest.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#ifndef _P2PMessageSizeTest_
-#define _P2PMessageSizeTest_
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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 <ClientChannel.h>
-#include <ClientMessage.h>
-#include <Connection.h>
-#include <Exception.h>
-#include <MessageListener.h>
-#include "SimpleTestCaseBase.h"
-
-namespace qpid {
-
-/**
- * P2PMessageSizeTest implements test case 4, P2P messages with message size. Sends/received a specified number of messages to a
- * specified route on the default exchange, of a specified size. Produces reports on the actual number of messages sent/received.
- */
-class P2PMessageSizeTest : public SimpleTestCaseBase
-{
- class Receiver;
-
-public:
-
- /**
- * Assigns the role to be played by this test case. The test parameters are fully specified in the
- * assignment messages filed table.
- *
- * @param role The role to be played; sender or receiver.
- * @param assignRoleMessage The role assingment messages field table, contains the full test parameters.
- * @param options Additional test options.
- */
- void assign(const std::string& role, framing::FieldTable& params, TestOptions& options);
-};
-}
-
-#endif
diff --git a/Final/cpp/tests/PubSubMessageSizeTest.cpp b/Final/cpp/tests/PubSubMessageSizeTest.cpp
deleted file mode 100644
index e75334d989..0000000000
--- a/Final/cpp/tests/PubSubMessageSizeTest.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 "PubSubMessageSizeTest.h"
-
-using namespace qpid;
-
-class PubSubMessageSizeTest::Receiver : public Worker, public MessageListener
-{
- const Exchange& exchange;
- const std::string queue;
- const std::string key;
- std::string tag;
-public:
- Receiver(TestOptions& 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 PubSubMessageSizeTest::MultiReceiver : public Worker, public MessageListener
-{
- typedef boost::ptr_vector<Receiver> ReceiverList;
- ReceiverList receivers;
-
-public:
- MultiReceiver(TestOptions& 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 PubSubMessageSizeTest::assign(const std::string& role, framing::FieldTable& params, TestOptions& options)
-{
- //std::cout << "void PubSubMessageSizeTest::assign(const std::string& role, framing::FieldTable& params, TestOptions& options): called";
-
- std::string key = params.getString("PUBSUB_KEY");
- int messages = params.getInt("PUBSUB_NUM_MESSAGES");
- int receivers = params.getInt("PUBSUB_NUM_RECEIVERS");
- int messageSize = params.getInt("messageSize");
-
- if (role == "SENDER") {
- worker = std::auto_ptr<Worker>(new Sender(options, Exchange::STANDARD_TOPIC_EXCHANGE, key, messages, messageSize));
- } 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/Final/cpp/tests/PubSubMessageSizeTest.h b/Final/cpp/tests/PubSubMessageSizeTest.h
deleted file mode 100644
index c17f81fc1e..0000000000
--- a/Final/cpp/tests/PubSubMessageSizeTest.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef _PubSubMessageSizeTest_
-#define _PubSubMessageSizeTest_
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES 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 <ClientChannel.h>
-#include <ClientMessage.h>
-#include <Connection.h>
-#include <Exception.h>
-#include <MessageListener.h>
-#include "SimpleTestCaseBase.h"
-#include <boost/ptr_container/ptr_vector.hpp>
-#include <boost/format.hpp>
-
-
-namespace qpid {
-
-using namespace qpid::client;
-
-class PubSubMessageSizeTest : public SimpleTestCaseBase
-{
- class Receiver;
- class MultiReceiver;
-public:
- void assign(const std::string& role, framing::FieldTable& params, TestOptions& options);
-};
-
-}
-
-#endif
diff --git a/Final/cpp/tests/QueuePolicyTest.cpp b/Final/cpp/tests/QueuePolicyTest.cpp
deleted file mode 100644
index 0ae0d2f7bc..0000000000
--- a/Final/cpp/tests/QueuePolicyTest.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 <QueuePolicy.h>
-#include <qpid_test_plugin.h>
-
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-class QueuePolicyTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(QueuePolicyTest);
- CPPUNIT_TEST(testCount);
- CPPUNIT_TEST(testSize);
- CPPUNIT_TEST(testBoth);
- CPPUNIT_TEST(testSettings);
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void testCount(){
- QueuePolicy policy(5, 0);
- CPPUNIT_ASSERT(!policy.limitExceeded());
- for (int i = 0; i < 5; i++) policy.enqueued(10);
- CPPUNIT_ASSERT_EQUAL((u_int64_t) 0, policy.getMaxSize());
- CPPUNIT_ASSERT_EQUAL((u_int32_t) 5, policy.getMaxCount());
- CPPUNIT_ASSERT(!policy.limitExceeded());
- policy.enqueued(10);
- CPPUNIT_ASSERT(policy.limitExceeded());
- policy.dequeued(10);
- CPPUNIT_ASSERT(!policy.limitExceeded());
- policy.enqueued(10);
- CPPUNIT_ASSERT(policy.limitExceeded());
- }
-
- void testSize(){
- QueuePolicy policy(0, 50);
- for (int i = 0; i < 5; i++) policy.enqueued(10);
- CPPUNIT_ASSERT(!policy.limitExceeded());
- policy.enqueued(10);
- CPPUNIT_ASSERT(policy.limitExceeded());
- policy.dequeued(10);
- CPPUNIT_ASSERT(!policy.limitExceeded());
- policy.enqueued(10);
- CPPUNIT_ASSERT(policy.limitExceeded());
- }
-
- void testBoth(){
- QueuePolicy policy(5, 50);
- for (int i = 0; i < 5; i++) policy.enqueued(11);
- CPPUNIT_ASSERT(policy.limitExceeded());
- policy.dequeued(20);
- CPPUNIT_ASSERT(!policy.limitExceeded());//fails
- policy.enqueued(5);
- policy.enqueued(10);
- CPPUNIT_ASSERT(policy.limitExceeded());
- }
-
- void testSettings(){
- //test reading and writing the policy from/to field table
- FieldTable settings;
- QueuePolicy a(101, 303);
- a.update(settings);
- QueuePolicy b(settings);
- CPPUNIT_ASSERT_EQUAL(a.getMaxCount(), b.getMaxCount());
- CPPUNIT_ASSERT_EQUAL(a.getMaxSize(), b.getMaxSize());
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(QueuePolicyTest);
-
diff --git a/Final/cpp/tests/QueueRegistryTest.cpp b/Final/cpp/tests/QueueRegistryTest.cpp
deleted file mode 100644
index 3926d56292..0000000000
--- a/Final/cpp/tests/QueueRegistryTest.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 <QueueRegistry.h>
-#include <qpid_test_plugin.h>
-#include <string>
-
-using namespace qpid::broker;
-
-class QueueRegistryTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(QueueRegistryTest);
- CPPUNIT_TEST(testDeclare);
- CPPUNIT_TEST(testDeclareTmp);
- CPPUNIT_TEST(testFind);
- CPPUNIT_TEST(testDestroy);
- CPPUNIT_TEST_SUITE_END();
-
- private:
- std::string foo, bar;
- QueueRegistry reg;
- std::pair<Queue::shared_ptr, bool> qc;
-
- public:
- void setUp() {
- foo = "foo";
- bar = "bar";
- }
-
- void testDeclare() {
- qc = reg.declare(foo, false, 0, 0);
- Queue::shared_ptr q = qc.first;
- CPPUNIT_ASSERT(q);
- CPPUNIT_ASSERT(qc.second); // New queue
- CPPUNIT_ASSERT_EQUAL(foo, q->getName());
-
- qc = reg.declare(foo, false, 0, 0);
- CPPUNIT_ASSERT_EQUAL(q, qc.first);
- CPPUNIT_ASSERT(!qc.second);
-
- qc = reg.declare(bar, false, 0, 0);
- q = qc.first;
- CPPUNIT_ASSERT(q);
- CPPUNIT_ASSERT_EQUAL(true, qc.second);
- CPPUNIT_ASSERT_EQUAL(bar, q->getName());
- }
-
- void testDeclareTmp()
- {
- qc = reg.declare(std::string(), false, 0, 0);
- CPPUNIT_ASSERT(qc.second);
- CPPUNIT_ASSERT_EQUAL(std::string("tmp_1"), qc.first->getName());
- }
-
- void testFind() {
- CPPUNIT_ASSERT(reg.find(foo) == 0);
-
- reg.declare(foo, false, 0, 0);
- reg.declare(bar, false, 0, 0);
- Queue::shared_ptr q = reg.find(bar);
- CPPUNIT_ASSERT(q);
- CPPUNIT_ASSERT_EQUAL(bar, q->getName());
- }
-
- void testDestroy() {
- qc = reg.declare(foo, false, 0, 0);
- reg.destroy(foo);
- // Queue is gone from the registry.
- CPPUNIT_ASSERT(reg.find(foo) == 0);
- // Queue is not actually destroyed till we drop our reference.
- CPPUNIT_ASSERT_EQUAL(foo, qc.first->getName());
- // We shoud be the only reference.
- CPPUNIT_ASSERT_EQUAL(1L, qc.first.use_count());
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(QueueRegistryTest);
diff --git a/Final/cpp/tests/QueueTest.cpp b/Final/cpp/tests/QueueTest.cpp
deleted file mode 100644
index 9d655781c1..0000000000
--- a/Final/cpp/tests/QueueTest.cpp
+++ /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.
- *
- */
-#include <BrokerQueue.h>
-#include <QueueRegistry.h>
-#include <qpid_test_plugin.h>
-#include <iostream>
-
-using namespace qpid::broker;
-using namespace qpid::sys;
-
-
-class TestBinding : public virtual Binding{
- bool cancelled;
-
-public:
- TestBinding();
- virtual void cancel();
- bool isCancelled();
-};
-
-class TestConsumer : public virtual Consumer{
-public:
- Message::shared_ptr last;
-
- virtual bool deliver(Message::shared_ptr& msg);
-};
-
-
-class QueueTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(QueueTest);
- CPPUNIT_TEST(testConsumers);
- CPPUNIT_TEST(testBinding);
- CPPUNIT_TEST(testRegistry);
- CPPUNIT_TEST(testDequeue);
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void testConsumers(){
- Queue::shared_ptr queue(new Queue("my_queue", true));
-
- //Test adding consumers:
- TestConsumer c1;
- TestConsumer c2;
- queue->consume(&c1);
- queue->consume(&c2);
-
- CPPUNIT_ASSERT_EQUAL(u_int32_t(2), queue->getConsumerCount());
-
- //Test basic delivery:
- Message::shared_ptr msg1 = Message::shared_ptr(new Message(0, "e", "A", true, true));
- Message::shared_ptr msg2 = Message::shared_ptr(new Message(0, "e", "B", true, true));
- Message::shared_ptr msg3 = Message::shared_ptr(new Message(0, "e", "C", true, true));
-
- queue->deliver(msg1);
- CPPUNIT_ASSERT_EQUAL(msg1.get(), c1.last.get());
-
- queue->deliver(msg2);
- CPPUNIT_ASSERT_EQUAL(msg2.get(), c2.last.get());
-
- queue->deliver(msg3);
- CPPUNIT_ASSERT_EQUAL(msg3.get(), c1.last.get());
-
- //Test cancellation:
- queue->cancel(&c1);
- CPPUNIT_ASSERT_EQUAL(u_int32_t(1), queue->getConsumerCount());
- queue->cancel(&c2);
- CPPUNIT_ASSERT_EQUAL(u_int32_t(0), queue->getConsumerCount());
- }
-
- void testBinding(){
- Queue::shared_ptr queue(new Queue("my_queue", true));
- //Test bindings:
- TestBinding a;
- TestBinding b;
- queue->bound(&a);
- queue->bound(&b);
-
- queue.reset();
-
- CPPUNIT_ASSERT(a.isCancelled());
- CPPUNIT_ASSERT(b.isCancelled());
- }
-
- void testRegistry(){
- //Test use of queues in registry:
- QueueRegistry registry;
- registry.declare("queue1", true, true);
- registry.declare("queue2", true, true);
- registry.declare("queue3", true, true);
-
- CPPUNIT_ASSERT(registry.find("queue1"));
- CPPUNIT_ASSERT(registry.find("queue2"));
- CPPUNIT_ASSERT(registry.find("queue3"));
-
- registry.destroy("queue1");
- registry.destroy("queue2");
- registry.destroy("queue3");
-
- CPPUNIT_ASSERT(!registry.find("queue1"));
- CPPUNIT_ASSERT(!registry.find("queue2"));
- CPPUNIT_ASSERT(!registry.find("queue3"));
- }
-
- void testDequeue(){
- Queue::shared_ptr queue(new Queue("my_queue", true));
-
- Message::shared_ptr msg1 = Message::shared_ptr(new Message(0, "e", "A", true, true));
- Message::shared_ptr msg2 = Message::shared_ptr(new Message(0, "e", "B", true, true));
- Message::shared_ptr msg3 = Message::shared_ptr(new Message(0, "e", "C", true, true));
- Message::shared_ptr received;
-
- queue->deliver(msg1);
- queue->deliver(msg2);
- queue->deliver(msg3);
-
- CPPUNIT_ASSERT_EQUAL(u_int32_t(3), queue->getMessageCount());
-
- received = queue->dequeue();
- CPPUNIT_ASSERT_EQUAL(msg1.get(), received.get());
- CPPUNIT_ASSERT_EQUAL(u_int32_t(2), queue->getMessageCount());
-
- received = queue->dequeue();
- CPPUNIT_ASSERT_EQUAL(msg2.get(), received.get());
- CPPUNIT_ASSERT_EQUAL(u_int32_t(1), queue->getMessageCount());
-
- TestConsumer consumer;
- queue->consume(&consumer);
- queue->dispatch();
- CPPUNIT_ASSERT_EQUAL(msg3.get(), consumer.last.get());
- CPPUNIT_ASSERT_EQUAL(u_int32_t(0), queue->getMessageCount());
-
- received = queue->dequeue();
- CPPUNIT_ASSERT(!received);
- CPPUNIT_ASSERT_EQUAL(u_int32_t(0), queue->getMessageCount());
-
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(QueueTest);
-
-//TestBinding
-TestBinding::TestBinding() : cancelled(false) {}
-
-void TestBinding::cancel(){
- CPPUNIT_ASSERT(!cancelled);
- cancelled = true;
-}
-
-bool TestBinding::isCancelled(){
- return cancelled;
-}
-
-//TestConsumer
-bool TestConsumer::deliver(Message::shared_ptr& msg){
- last = msg;
- return true;
-}
-
diff --git a/Final/cpp/tests/SimpleTestCaseBase.cpp b/Final/cpp/tests/SimpleTestCaseBase.cpp
deleted file mode 100644
index 3603df3af3..0000000000
--- a/Final/cpp/tests/SimpleTestCaseBase.cpp
+++ /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 "SimpleTestCaseBase.h"
-
-using namespace qpid;
-using namespace qpid::client;
-
-/**
- * Starts the test cases worker.
- */
-void SimpleTestCaseBase::start()
-{
- if (worker.get())
- {
- worker->start();
- }
-}
-
-/**
- * Stops the test cases worker.
- */
-void SimpleTestCaseBase::stop()
-{
- if (worker.get())
- {
- worker->stop();
- }
-}
-
-/**
- * Adds the test report to the specified message. This consists of writing the count of messages received into
- * a header on the message.
- *
- * @param report The report message to add the test report to.
- */
-void SimpleTestCaseBase::report(client::Message& report)
-{
- if (worker.get())
- {
- report.getHeaders().setInt("MESSAGE_COUNT", worker->getCount());
-
- // Add number of messages sent or received in the message body.
- /*
- std::stringstream reportstr;
- reportstr << worker->getCount();
- report.setData(reportstr.str());
- */
- }
-}
-
-/**
- * Creates a sender using the specified options, for the given expected message count, exchange and routing key.
- * This sets up the sender with the default message size for interop tests.
- *
- * @param options The creation options.
- * @param exchange The exchange to send the messages over.
- * @param key The routing key for the messages.
- * @param messages The number of messages expected to be sent or received.
- */
-SimpleTestCaseBase::Sender::Sender(TestOptions& options,
- const Exchange& _exchange,
- const std::string& _key,
- const int _messages)
- : Worker(options, _messages), exchange(_exchange), key(_key), messageSize(DEFAULT_INTEROP_MESSAGE_SIZE) {}
-
-/**
- * Creates a sender using the specified options, for the given expected message count, exchange and routing key.
- *
- * @param options The creation options.
- * @param exchange The exchange to send the messages over.
- * @param key The routing key for the messages.
- * @param messages The number of messages expected to be sent or received.
- * @param messageSize The size of test messages to send.
- */
-SimpleTestCaseBase::Sender::Sender(TestOptions& options,
- const Exchange& _exchange,
- const std::string& _key,
- const int _messages,
- const int _messageSize)
- : Worker(options, _messages), exchange(_exchange), key(_key), messageSize(_messageSize) {}
-
-void SimpleTestCaseBase::Sender::init()
-{
- channel.start();
-}
-
-void SimpleTestCaseBase::Sender::start()
-{
- Message message;
- qpid::createTestMessageOfSize(message, messageSize);
-
- while (count < messages)
- {
- channel.publish(message, exchange, key);
- count++;
- }
-
- stop();
-}
-
-SimpleTestCaseBase::Worker::Worker(TestOptions& options, const int _messages) :
- connection(options.trace), messages(_messages), count(0)
-{
- connection.open(options.broker, options.port);
- connection.openChannel(&channel);
-}
-
-void SimpleTestCaseBase::Worker::stop()
-{
- channel.close();
- connection.close();
-}
-
-int SimpleTestCaseBase::Worker::getCount()
-{
- return count;
-}
diff --git a/Final/cpp/tests/SimpleTestCaseBase.h b/Final/cpp/tests/SimpleTestCaseBase.h
deleted file mode 100644
index 66f87ae42a..0000000000
--- a/Final/cpp/tests/SimpleTestCaseBase.h
+++ /dev/null
@@ -1,187 +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 <ClientChannel.h>
-#include <ClientMessage.h>
-#include <Connection.h>
-#include <Exception.h>
-#include <MessageListener.h>
-#include "TestCase.h"
-#include "TestUtils.h"
-
-#define DEFAULT_INTEROP_MESSAGE_SIZE 256
-
-namespace qpid {
-
-using namespace qpid::client;
-
-/**
- * SimpleTestCaseBase defines a base implementation of TestCase class. It provides the ability, to wrap a 'Worker' that
- * the work of running a test case is delegated too. There are two kinds of workers provided, a base worker, which is abstract
- * and may be extended to provide the tests behaviour, and a 'Sender' worker, that provides the ability to send a number
- * of messages.
- *
- * <p/>A worker encapsulates a connection, a channel, an expected number of messages to be sent or received, and a count of the
- * number actually sent or received.
- */
-class SimpleTestCaseBase : public TestCase
-{
-protected:
-
- /**
- * A worker encapsulates a connection, channel, an expected number of messages to be sent or received, and a count of the
- * number actually sent or received.
- *
- * <p/>Worker is an abstract class, extend it to do something usefull on the init() and start() methods.
- *
- * <p/>A worker is created from a set of TestOptions, which captures a number of configuration parameters, such as the
- * broker to connect to.
- *
- * TODO: Extend TestOptions to capture the full set of creation properties for distributed tests.
- */
- class Worker
- {
- protected:
- /** Holds the connection for the worker to send/receive over. */
- client::Connection connection;
-
- /** Holds the channel for the worker to send/receive over. */
- client::Channel channel;
-
- /** Holds the expected number of messages for the worker to send or received. */
- const int messages;
-
- /** Holds a count of the number of messages actually sent or received. */
- int count;
-
- public:
-
- /**
- * Creates a worker using the specified options, for the given expected message count.
- *
- * @param options The creation options.
- * @param messages The number of messages expected to be sent or received.
- */
- Worker(TestOptions& options, const int messages);
- virtual ~Worker(){}
-
- /** Should be called ahead of start() to configure the worker. */
- virtual void init() = 0;
-
- /** Starts the workers test activity. */
- virtual void start() = 0;
-
- /** Terminates the workers test activity. */
- virtual void stop();
-
- /** Gets the count of messages actually sent or received by the worker. */
- virtual int getCount();
- };
-
- /**
- * Sender is a worker that sends the expected number of messages to be sent, over the configured exchange, using a
- * specified routing key.
- */
- class Sender : public Worker
- {
- /** Holds the exchange to send message to. */
- const Exchange& exchange;
-
- /** Holds the routing key for the messages. */
- const std::string key;
-
- /** Holds the message size parameter for all test messages. */
- const int messageSize;
-
- public:
-
- /**
- * Creates a sender using the specified options, for the given expected message count, exchange and routing key.
- *
- * @param options The creation options.
- * @param exchange The exchange to send the messages over.
- * @param key The routing key for the messages.
- * @param messages The number of messages expected to be sent or received.
- */
- Sender(TestOptions& options, const Exchange& exchange, const std::string& key, const int messages);
-
- /**
- * Creates a sender using the specified options, for the given expected message count, exchange and routing key.
- *
- * @param options The creation options.
- * @param exchange The exchange to send the messages over.
- * @param key The routing key for the messages.
- * @param messages The number of messages expected to be sent or received.
- * @param messageSize The size of test messages to send.
- */
- Sender(TestOptions& options, const Exchange& exchange, const std::string& key, const int messages, const int messageSize);
-
- /**
- * Starts the underlying channel.
- */
- void init();
-
- /**
- * Sends the specified number of messages over the connection, channel and exchange using the configured routing key.
- */
- void start();
- };
-
- /** Holds a pointer to the encapsulated worker. */
- std::auto_ptr<Worker> worker;
-
-public:
-
- virtual ~SimpleTestCaseBase() {}
-
- /**
- * Assigns the role to be played by this test case. The test parameters are fully specified in the
- * assignment messages filed table.
- *
- * @param role The role to be played; sender or receiver.
- * @param assignRoleMessage The role assingment messages field table, contains the full test parameters.
- * @param options Additional test options.
- */
- virtual void assign(const std::string& role, framing::FieldTable& params, TestOptions& options) = 0;
-
- /**
- * Starts the worker.
- */
- void start();
-
- /**
- * Stops the worker.
- */
- void stop();
-
- /**
- * Reports the number of messages sent or received.
- */
- void report(client::Message& report);
-};
-}
-
-#endif
diff --git a/Final/cpp/tests/TestCase.h b/Final/cpp/tests/TestCase.h
deleted file mode 100644
index ec151a6d84..0000000000
--- a/Final/cpp/tests/TestCase.h
+++ /dev/null
@@ -1,75 +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 <ClientMessage.h>
-#include "TestOptions.h"
-
-
-namespace qpid {
-
-/**
- * TestCase provides an interface that classes implementing tests to be run using a distributed test client
- * must implement. The interop test spec, defines a life-cycle for interop tests. This consists of, inviting
- * a test to participate in a test, assigning a role, starting the test, and extracting a report on the
- * outcome of the test.
- *
- * TODO: There is not method to process the test invitation. Add one.
- */
-class TestCase
-{
-public:
-
- /**
- * Assigns the role to be played by this test case. The test parameters are fully specified in the
- * assignment messages filed table.
- *
- * @param role The role to be played; sender or receiver.
- * @param assignRoleMessage The role assingment messages field table, contains the full test parameters.
- * @param options Additional test options.
- */
- virtual void assign(const std::string& role, framing::FieldTable& params, TestOptions& 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/Final/cpp/tests/TestOptions.h b/Final/cpp/tests/TestOptions.h
deleted file mode 100644
index 7031efc266..0000000000
--- a/Final/cpp/tests/TestOptions.h
+++ /dev/null
@@ -1,69 +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 <CommonOptions.h>
-
-namespace qpid {
-
-struct TestOptions : public qpid::CommonOptions
-{
- TestOptions() : desc("Options"), broker("localhost"), virtualhost(""), clientid("cpp"), help(false)
- {
- using namespace qpid::program_options;
- using namespace boost::program_options;
- CommonOptions::addTo(desc);
- desc.add_options()
- ("broker,b", optValue(broker, "HOSTNAME"), "the hostname to connect to")
- ("virtualhost,v", optValue(virtualhost, "VIRTUAL_HOST"), "virtual host")
- ("clientname,n", optValue(clientid, "ID"), "unique client identifier")
- ("help,h", optValue(help), "print this usage statement");
- }
-
- void parse(int argc, char** argv)
- {
- using namespace boost::program_options;
- try {
- variables_map vm;
- store(parse_command_line(argc, argv, desc), vm);
- notify(vm);
- } catch(const error& e) {
- std::cerr << "Error: " << e.what() << std::endl
- << "Specify '--help' for usage." << std::endl;
- }
- }
-
- void usage()
- {
- std::cout << desc << std::endl;
- }
-
- boost::program_options::options_description desc;
- std::string broker;
- std::string virtualhost;
- std::string clientid;
- bool help;
-};
-
-}
-
-#endif
diff --git a/Final/cpp/tests/TestUtils.cpp b/Final/cpp/tests/TestUtils.cpp
deleted file mode 100644
index 0b517a4339..0000000000
--- a/Final/cpp/tests/TestUtils.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 "TestUtils.h"
-#include <string>
-
-using namespace qpid;
-
-/**
- * Creates a test message of the specified size. The message is filled with dummy (non-zero) data.
- *
- * @param size The size of the message to create.
- */
-void qpid::createTestMessageOfSize(qpid::client::Message& message, int size)
-{
- std::string MESSAGE_DATA("-- Test Message -- Test Message -- Test Message -- Test Message -- Test Message -- Test Message -- Test Message ");
- std::string data;
-
- if (size > 0)
- {
- int div = MESSAGE_DATA.length() / size;
- int mod = MESSAGE_DATA.length() % size;
-
- for (int i = 0; i < div; i++)
- {
- data += MESSAGE_DATA;
- }
-
- if (mod != 0)
- {
- data += MESSAGE_DATA.substr(0, mod);
- }
- }
-
- message.setData(data);
-}
diff --git a/Final/cpp/tests/TestUtils.h b/Final/cpp/tests/TestUtils.h
deleted file mode 100644
index 1178a4e06f..0000000000
--- a/Final/cpp/tests/TestUtils.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#ifndef _TestUtils_
-#define _TestUtils_
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <ClientMessage.h>
-
-namespace qpid {
-
-void createTestMessageOfSize(qpid::client::Message& message, int size);
-
-}
-
-#endif
diff --git a/Final/cpp/tests/TopicExchangeTest.cpp b/Final/cpp/tests/TopicExchangeTest.cpp
deleted file mode 100644
index 4ba9cdd6e5..0000000000
--- a/Final/cpp/tests/TopicExchangeTest.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 <TopicExchange.h>
-#include <qpid_test_plugin.h>
-
-using namespace qpid::broker;
-
-Tokens makeTokens(char** begin, 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))
-
-// Allow CPPUNIT_EQUALS to print a Tokens.
-CppUnit::OStringStream& operator <<(CppUnit::OStringStream& out, const Tokens& v)
-{
- out << "[ ";
- for (Tokens::const_iterator i = v.begin();
- i != v.end(); ++i)
- {
- out << '"' << *i << '"' << (i+1 == v.end() ? "]" : ", ");
- }
- return out;
-}
-
-
-class TokensTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(TokensTest);
- CPPUNIT_TEST(testTokens);
- CPPUNIT_TEST_SUITE_END();
-
- public:
- void testTokens()
- {
- Tokens tokens("hello.world");
- char* expect[] = {"hello", "world"};
- CPPUNIT_ASSERT_EQUAL(TOKENS(expect), tokens);
-
- tokens = "a.b.c";
- char* expect2[] = { "a", "b", "c" };
- CPPUNIT_ASSERT_EQUAL(TOKENS(expect2), tokens);
-
- tokens = "";
- CPPUNIT_ASSERT(tokens.empty());
-
- tokens = "x";
- char* expect3[] = { "x" };
- CPPUNIT_ASSERT_EQUAL(TOKENS(expect3), tokens);
-
- tokens = (".x");
- char* expect4[] = { "", "x" };
- CPPUNIT_ASSERT_EQUAL(TOKENS(expect4), tokens);
-
- tokens = ("x.");
- char* expect5[] = { "x", "" };
- CPPUNIT_ASSERT_EQUAL(TOKENS(expect5), tokens);
-
- tokens = (".");
- char* expect6[] = { "", "" };
- CPPUNIT_ASSERT_EQUAL(TOKENS(expect6), tokens);
-
- tokens = ("..");
- char* expect7[] = { "", "", "" };
- CPPUNIT_ASSERT_EQUAL(TOKENS(expect7), tokens);
- }
-
-};
-
-#define ASSERT_NORMALIZED(expect, pattern) \
- CPPUNIT_ASSERT_EQUAL(Tokens(expect), static_cast<Tokens>(TopicPattern(pattern)))
-class TopicPatternTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(TopicPatternTest);
- CPPUNIT_TEST(testNormalize);
- CPPUNIT_TEST(testPlain);
- CPPUNIT_TEST(testStar);
- CPPUNIT_TEST(testHash);
- CPPUNIT_TEST(testMixed);
- CPPUNIT_TEST(testCombo);
- CPPUNIT_TEST_SUITE_END();
-
- public:
-
- void testNormalize()
- {
- CPPUNIT_ASSERT(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.*.#.*.#.*");
- }
-
- void testPlain() {
- TopicPattern p("ab.cd.e");
- CPPUNIT_ASSERT(p.match("ab.cd.e"));
- CPPUNIT_ASSERT(!p.match("abx.cd.e"));
- CPPUNIT_ASSERT(!p.match("ab.cd"));
- CPPUNIT_ASSERT(!p.match("ab.cd..e."));
- CPPUNIT_ASSERT(!p.match("ab.cd.e."));
- CPPUNIT_ASSERT(!p.match(".ab.cd.e"));
-
- p = "";
- CPPUNIT_ASSERT(p.match(""));
-
- p = ".";
- CPPUNIT_ASSERT(p.match("."));
- }
-
-
- void testStar()
- {
- TopicPattern p("a.*.b");
- CPPUNIT_ASSERT(p.match("a.xx.b"));
- CPPUNIT_ASSERT(!p.match("a.b"));
-
- p = "*.x";
- CPPUNIT_ASSERT(p.match("y.x"));
- CPPUNIT_ASSERT(p.match(".x"));
- CPPUNIT_ASSERT(!p.match("x"));
-
- p = "x.x.*";
- CPPUNIT_ASSERT(p.match("x.x.y"));
- CPPUNIT_ASSERT(p.match("x.x."));
- CPPUNIT_ASSERT(!p.match("x.x"));
- CPPUNIT_ASSERT(!p.match("q.x.y"));
- }
-
- void testHash()
- {
- TopicPattern p("a.#.b");
- CPPUNIT_ASSERT(p.match("a.b"));
- CPPUNIT_ASSERT(p.match("a.x.b"));
- CPPUNIT_ASSERT(p.match("a..x.y.zz.b"));
- CPPUNIT_ASSERT(!p.match("a.b."));
- CPPUNIT_ASSERT(!p.match("q.x.b"));
-
- p = "a.#";
- CPPUNIT_ASSERT(p.match("a"));
- CPPUNIT_ASSERT(p.match("a.b"));
- CPPUNIT_ASSERT(p.match("a.b.c"));
-
- p = "#.a";
- CPPUNIT_ASSERT(p.match("a"));
- CPPUNIT_ASSERT(p.match("x.y.a"));
- }
-
- void testMixed()
- {
- TopicPattern p("*.x.#.y");
- CPPUNIT_ASSERT(p.match("a.x.y"));
- CPPUNIT_ASSERT(p.match("a.x.p.qq.y"));
- CPPUNIT_ASSERT(!p.match("a.a.x.y"));
- CPPUNIT_ASSERT(!p.match("aa.x.b.c"));
-
- p = "a.#.b.*";
- CPPUNIT_ASSERT(p.match("a.b.x"));
- CPPUNIT_ASSERT(p.match("a.x.x.x.b.x"));
- }
-
- void testCombo() {
- TopicPattern p("*.#.#.*.*.#");
- CPPUNIT_ASSERT(p.match("x.y.z"));
- CPPUNIT_ASSERT(p.match("x.y.z.a.b.c"));
- CPPUNIT_ASSERT(!p.match("x.y"));
- CPPUNIT_ASSERT(!p.match("x"));
- }
-};
-
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(TopicPatternTest);
-CPPUNIT_TEST_SUITE_REGISTRATION(TokensTest);
diff --git a/Final/cpp/tests/TxAckTest.cpp b/Final/cpp/tests/TxAckTest.cpp
deleted file mode 100644
index 7d5b8a838a..0000000000
--- a/Final/cpp/tests/TxAckTest.cpp
+++ /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.
- *
- */
-#include <NullMessageStore.h>
-#include <RecoveryManager.h>
-#include <TxAck.h>
-#include <qpid_test_plugin.h>
-#include <iostream>
-#include <list>
-#include <vector>
-
-using std::list;
-using std::vector;
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-class TxAckTest : public CppUnit::TestCase
-{
-
- class TestMessageStore : public NullMessageStore
- {
- public:
- vector< std::pair<Message*, const string*> > dequeued;
-
- void dequeue(TransactionContext*, Message* const msg, const Queue& /*queue*/, const string * const xid)
- {
- dequeued.push_back(std::pair<Message*, const string*>(msg, xid));
- }
-
- TestMessageStore() : NullMessageStore(false) {}
- ~TestMessageStore(){}
- };
-
- CPPUNIT_TEST_SUITE(TxAckTest);
- CPPUNIT_TEST(testPrepare2pc);
- CPPUNIT_TEST(testPrepare);
- CPPUNIT_TEST(testCommit);
- CPPUNIT_TEST_SUITE_END();
-
-
- AccumulatedAck acked;
- TestMessageStore store;
- Queue::shared_ptr queue;
- vector<Message::shared_ptr> messages;
- list<DeliveryRecord> deliveries;
- TxAck op;
- std::string xid;
-
-
-public:
-
- TxAckTest() : acked(0), queue(new Queue("my_queue", false, &store, 0)), op(acked, deliveries, &xid)
- {
- for(int i = 0; i < 10; i++){
- Message::shared_ptr msg(new Message(0, "exchange", "routing_key", false, false));
- msg->setHeader(AMQHeaderBody::shared_ptr(new AMQHeaderBody(BASIC)));
- msg->getHeaderProperties()->setDeliveryMode(PERSISTENT);
- messages.push_back(msg);
- deliveries.push_back(DeliveryRecord(msg, queue, "xyz", (i+1)));
- }
-
- //assume msgs 1-5, 7 and 9 are all acked (i.e. 6, 8 & 10 are not)
- acked.range = 5;
- acked.individual.push_back(7);
- acked.individual.push_back(9);
- }
-
- void testPrepare()
- {
- //ensure acked messages are discarded, i.e. dequeued from store
- op.prepare(0);
- CPPUNIT_ASSERT_EQUAL((size_t) 7, store.dequeued.size());
- CPPUNIT_ASSERT_EQUAL((size_t) 10, deliveries.size());
- int dequeued[] = {0, 1, 2, 3, 4, 6, 8};
- for (int i = 0; i < 7; i++) {
- CPPUNIT_ASSERT_EQUAL(messages[dequeued[i]].get(), store.dequeued[i].first);
- }
- }
-
- void testPrepare2pc()
- {
- xid = "abcdefg";
- testPrepare();
- const string expected(xid);
- for (int i = 0; i < 7; i++) {
- CPPUNIT_ASSERT_EQUAL(expected, *store.dequeued[i].second);
- }
- }
-
- void testCommit()
- {
- //emsure acked messages are removed from list
- op.commit();
- CPPUNIT_ASSERT_EQUAL((size_t) 3, deliveries.size());
- list<DeliveryRecord>::iterator i = deliveries.begin();
- CPPUNIT_ASSERT(i->matches(6));//msg 6
- CPPUNIT_ASSERT((++i)->matches(8));//msg 8
- CPPUNIT_ASSERT((++i)->matches(10));//msg 10
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(TxAckTest);
-
diff --git a/Final/cpp/tests/TxBufferTest.cpp b/Final/cpp/tests/TxBufferTest.cpp
deleted file mode 100644
index 0573ad15b0..0000000000
--- a/Final/cpp/tests/TxBufferTest.cpp
+++ /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.
- *
- */
-#include <TxBuffer.h>
-#include <qpid_test_plugin.h>
-#include <iostream>
-#include <vector>
-
-using namespace qpid::broker;
-
-template <class T> void assertEqualVector(std::vector<T>& expected, std::vector<T>& actual){
- unsigned int i = 0;
- while(i < expected.size() && i < actual.size()){
- CPPUNIT_ASSERT_EQUAL(expected[i], actual[i]);
- i++;
- }
- CPPUNIT_ASSERT(i == expected.size());
- CPPUNIT_ASSERT(i == actual.size());
-}
-
-class TxBufferTest : public CppUnit::TestCase
-{
- class MockTxOp : public TxOp{
- enum op_codes {PREPARE=2, COMMIT=4, ROLLBACK=8};
- std::vector<int> expected;
- std::vector<int> actual;
- bool failOnPrepare;
- public:
- MockTxOp() : failOnPrepare(false) {}
- MockTxOp(bool _failOnPrepare) : failOnPrepare(_failOnPrepare) {}
-
- bool prepare(TransactionContext*) throw(){
- actual.push_back(PREPARE);
- return !failOnPrepare;
- }
- void commit() throw(){
- actual.push_back(COMMIT);
- }
- void rollback() throw(){
- 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);
- }
- ~MockTxOp(){}
- };
-
- class MockTransactionalStore : public TransactionalStore{
- enum op_codes {BEGIN=2, COMMIT=4, ABORT=8};
- std::vector<int> expected;
- std::vector<int> actual;
-
- enum states {OPEN = 1, COMMITTED = 2, ABORTED = 3};
- int state;
-
- class TestTransactionContext : public TransactionContext{
- MockTransactionalStore* store;
- public:
- TestTransactionContext(MockTransactionalStore* _store) : store(_store) {}
- void commit(){
- if(store->state != OPEN) throw "txn already completed";
- store->state = COMMITTED;
- }
-
- void abort(){
- if(store->state != OPEN) throw "txn already completed";
- store->state = ABORTED;
- }
- ~TestTransactionContext(){}
- };
-
-
- public:
- MockTransactionalStore() : state(OPEN){}
-
- std::auto_ptr<TransactionContext> begin(){
- actual.push_back(BEGIN);
- std::auto_ptr<TransactionContext> txn(new TestTransactionContext(this));
- return txn;
- }
- void commit(TransactionContext* ctxt){
- actual.push_back(COMMIT);
- TestTransactionContext* txn(dynamic_cast<TestTransactionContext*>(ctxt));
- CPPUNIT_ASSERT(txn);
- txn->commit();
- }
- void abort(TransactionContext* ctxt){
- actual.push_back(ABORT);
- TestTransactionContext* txn(dynamic_cast<TestTransactionContext*>(ctxt));
- CPPUNIT_ASSERT(txn);
- txn->abort();
- }
- MockTransactionalStore& expectBegin(){
- expected.push_back(BEGIN);
- return *this;
- }
- MockTransactionalStore& expectCommit(){
- expected.push_back(COMMIT);
- return *this;
- }
- MockTransactionalStore& expectAbort(){
- expected.push_back(ABORT);
- return *this;
- }
- void check(){
- assertEqualVector(expected, actual);
- }
-
- bool isCommitted(){
- return state == COMMITTED;
- }
-
- bool isAborted(){
- return state == ABORTED;
- }
-
- bool isOpen(){
- return state == OPEN;
- }
- ~MockTransactionalStore(){}
- };
-
- CPPUNIT_TEST_SUITE(TxBufferTest);
- CPPUNIT_TEST(testPrepareAndCommit);
- CPPUNIT_TEST(testFailOnPrepare);
- CPPUNIT_TEST(testRollback);
- CPPUNIT_TEST(testBufferIsClearedAfterRollback);
- CPPUNIT_TEST(testBufferIsClearedAfterCommit);
- CPPUNIT_TEST_SUITE_END();
-
- public:
-
- void testPrepareAndCommit(){
- MockTransactionalStore store;
- store.expectBegin().expectCommit();
-
- MockTxOp opA;
- opA.expectPrepare().expectCommit();
- MockTxOp opB;
- opB.expectPrepare().expectPrepare().expectCommit().expectCommit();//opB enlisted twice to test reative order
- MockTxOp opC;
- opC.expectPrepare().expectCommit();
-
- TxBuffer buffer;
- buffer.enlist(&opA);
- buffer.enlist(&opB);
- buffer.enlist(&opB);//opB enlisted twice
- buffer.enlist(&opC);
-
- CPPUNIT_ASSERT(buffer.prepare(&store));
- buffer.commit();
- store.check();
- CPPUNIT_ASSERT(store.isCommitted());
- opA.check();
- opB.check();
- opC.check();
- }
-
- void testFailOnPrepare(){
- MockTransactionalStore store;
- store.expectBegin().expectAbort();
-
- MockTxOp opA;
- opA.expectPrepare();
- MockTxOp opB(true);
- opB.expectPrepare();
- MockTxOp opC;//will never get prepare as b will fail
-
- TxBuffer buffer;
- buffer.enlist(&opA);
- buffer.enlist(&opB);
- buffer.enlist(&opC);
-
- CPPUNIT_ASSERT(!buffer.prepare(&store));
- store.check();
- CPPUNIT_ASSERT(store.isAborted());
- opA.check();
- opB.check();
- opC.check();
- }
-
- void testRollback(){
- MockTxOp opA;
- opA.expectRollback();
- MockTxOp opB(true);
- opB.expectRollback();
- MockTxOp opC;
- opC.expectRollback();
-
- TxBuffer buffer;
- buffer.enlist(&opA);
- buffer.enlist(&opB);
- buffer.enlist(&opC);
-
- buffer.rollback();
- opA.check();
- opB.check();
- opC.check();
- }
-
- void testBufferIsClearedAfterRollback(){
- MockTxOp opA;
- opA.expectRollback();
- MockTxOp opB;
- opB.expectRollback();
-
- TxBuffer buffer;
- buffer.enlist(&opA);
- buffer.enlist(&opB);
-
- buffer.rollback();
- buffer.commit();//second call should not reach ops
- opA.check();
- opB.check();
- }
-
- void testBufferIsClearedAfterCommit(){
- MockTxOp opA;
- opA.expectCommit();
- MockTxOp opB;
- opB.expectCommit();
-
- TxBuffer buffer;
- buffer.enlist(&opA);
- buffer.enlist(&opB);
-
- buffer.commit();
- buffer.rollback();//second call should not reach ops
- opA.check();
- opB.check();
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(TxBufferTest);
-
diff --git a/Final/cpp/tests/TxPublishTest.cpp b/Final/cpp/tests/TxPublishTest.cpp
deleted file mode 100644
index 3542e08f45..0000000000
--- a/Final/cpp/tests/TxPublishTest.cpp
+++ /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.
- *
- */
-#include <NullMessageStore.h>
-#include <RecoveryManager.h>
-#include <TxPublish.h>
-#include <qpid_test_plugin.h>
-#include <iostream>
-#include <list>
-#include <vector>
-
-using std::list;
-using std::pair;
-using std::vector;
-using namespace qpid::broker;
-using namespace qpid::framing;
-
-class TxPublishTest : public CppUnit::TestCase
-{
- struct Triple
- {
- string first;
- Message* second;
- const string* third;
- };
-
- class TestMessageStore : public NullMessageStore
- {
- public:
- vector<Triple> enqueued;
-
- void enqueue(TransactionContext*, Message* const msg, const Queue& queue, const string * const xid)
- {
- Triple args = {queue.getName(), msg, xid};
- enqueued.push_back(args);
- }
-
- //dont care about any of the other methods:
- TestMessageStore() : NullMessageStore(false) {}
- ~TestMessageStore(){}
- };
-
- CPPUNIT_TEST_SUITE(TxPublishTest);
- CPPUNIT_TEST(testPrepare);
- CPPUNIT_TEST(testPrepare2pc);
- CPPUNIT_TEST(testCommit);
- CPPUNIT_TEST_SUITE_END();
-
-
- TestMessageStore store;
- Queue::shared_ptr queue1;
- Queue::shared_ptr queue2;
- Message::shared_ptr const msg;
- TxPublish op;
- string xid;
-
-public:
-
- TxPublishTest() : queue1(new Queue("queue1", false, &store, 0)),
- queue2(new Queue("queue2", false, &store, 0)),
- msg(new Message(0, "exchange", "routing_key", false, false)),
- op(msg, &xid)
- {
- msg->setHeader(AMQHeaderBody::shared_ptr(new AMQHeaderBody(BASIC)));
- msg->getHeaderProperties()->setDeliveryMode(PERSISTENT);
- op.deliverTo(queue1);
- op.deliverTo(queue2);
- }
-
- void testPrepare()
- {
- //ensure messages are enqueued in store
- op.prepare(0);
- CPPUNIT_ASSERT_EQUAL((size_t) 2, store.enqueued.size());
- CPPUNIT_ASSERT_EQUAL(string("queue1"), store.enqueued[0].first);
- CPPUNIT_ASSERT_EQUAL(msg.get(), store.enqueued[0].second);
- CPPUNIT_ASSERT_EQUAL(string("queue2"), store.enqueued[1].first);
- CPPUNIT_ASSERT_EQUAL(msg.get(), store.enqueued[1].second);
- }
-
- void testPrepare2pc()
- {
- xid = "abcde";
- const string expected(xid);
- testPrepare();
- CPPUNIT_ASSERT_EQUAL(expected, *store.enqueued[0].third);
- CPPUNIT_ASSERT_EQUAL(expected, *store.enqueued[1].third);
- }
-
- void testCommit()
- {
- //ensure messages are delivered to queue
- op.commit();
- CPPUNIT_ASSERT_EQUAL((u_int32_t) 1, queue1->getMessageCount());
- CPPUNIT_ASSERT_EQUAL(msg, queue1->dequeue());
-
- CPPUNIT_ASSERT_EQUAL((u_int32_t) 1, queue2->getMessageCount());
- CPPUNIT_ASSERT_EQUAL(msg, queue2->dequeue());
- }
-};
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(TxPublishTest);
-
diff --git a/Final/cpp/tests/ValueTest.cpp b/Final/cpp/tests/ValueTest.cpp
deleted file mode 100644
index a3f9ec2541..0000000000
--- a/Final/cpp/tests/ValueTest.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 <Value.h>
-#include <qpid_test_plugin.h>
-
-using namespace qpid::framing;
-
-
-class ValueTest : public CppUnit::TestCase
-{
- CPPUNIT_TEST_SUITE(ValueTest);
- CPPUNIT_TEST(testStringValueEquals);
- CPPUNIT_TEST(testIntegerValueEquals);
- CPPUNIT_TEST(testDecimalValueEquals);
- CPPUNIT_TEST(testFieldTableValueEquals);
- CPPUNIT_TEST_SUITE_END();
-
- StringValue s;
- IntegerValue i;
- DecimalValue d;
- FieldTableValue ft;
- EmptyValue e;
-
- public:
- ValueTest() :
- s("abc"),
- i(42),
- d(1234,2)
-
- {
- ft.getValue().setString("foo", "FOO");
- ft.getValue().setInt("magic", 7);
- }
-
- void testStringValueEquals()
- {
-
- CPPUNIT_ASSERT(StringValue("abc") == s);
- CPPUNIT_ASSERT(s != StringValue("foo"));
- CPPUNIT_ASSERT(s != e);
- CPPUNIT_ASSERT(e != d);
- CPPUNIT_ASSERT(e != ft);
- }
-
- void testIntegerValueEquals()
- {
- CPPUNIT_ASSERT(IntegerValue(42) == i);
- CPPUNIT_ASSERT(IntegerValue(5) != i);
- CPPUNIT_ASSERT(i != e);
- CPPUNIT_ASSERT(i != d);
- }
-
- void testDecimalValueEquals()
- {
- CPPUNIT_ASSERT(DecimalValue(1234, 2) == d);
- CPPUNIT_ASSERT(DecimalValue(12345, 2) != d);
- CPPUNIT_ASSERT(DecimalValue(1234, 3) != d);
- CPPUNIT_ASSERT(d != s);
- }
-
-
- void testFieldTableValueEquals()
- {
- CPPUNIT_ASSERT_EQUAL(std::string("FOO"),
- ft.getValue().getString("foo"));
- CPPUNIT_ASSERT_EQUAL(7, ft.getValue().getInt("magic"));
-
- FieldTableValue f2;
- CPPUNIT_ASSERT(ft != f2);
- f2.getValue().setString("foo", "FOO");
- CPPUNIT_ASSERT(ft != f2);
- f2.getValue().setInt("magic", 7);
- CPPUNIT_ASSERT_EQUAL(ft,f2);
- CPPUNIT_ASSERT(ft == f2);
- f2.getValue().setString("foo", "BAR");
- CPPUNIT_ASSERT(ft != f2);
- CPPUNIT_ASSERT(ft != i);
- }
-
-};
-
-
-// Make this test suite a plugin.
-CPPUNIT_PLUGIN_IMPLEMENT();
-CPPUNIT_TEST_SUITE_REGISTRATION(ValueTest);
-
diff --git a/Final/cpp/tests/client_test.cpp b/Final/cpp/tests/client_test.cpp
deleted file mode 100644
index a5cc64d1e4..0000000000
--- a/Final/cpp/tests/client_test.cpp
+++ /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.
- *
- */
-
-/**
- * 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 <QpidError.h>
-#include <ClientChannel.h>
-#include <Connection.h>
-#include <ClientMessage.h>
-#include <MessageListener.h>
-#include <sys/Monitor.h>
-#include <FieldTable.h>
-
-using namespace qpid::client;
-using namespace qpid::sys;
-using std::string;
-
-/**
- * A simple message listener implementation that prints out the
- * message content then notifies a montitor allowing the test to
- * complete.
- */
-class SimpleListener : public virtual MessageListener{
- Monitor* monitor;
-
-public:
- inline SimpleListener(Monitor* _monitor) : monitor(_monitor){}
-
- inline virtual void received(Message& msg){
- std::cout << "Received message " << msg.getData() << std::endl;
- monitor->notify();
- }
-};
-
-int main(int argc, char**)
-{
- try{
- //Use a custom exchange
- Exchange exchange("MyExchange", Exchange::TOPIC_EXCHANGE);
- //Use a named, temporary queue
- Queue queue("MyQueue", true);
-
-
- Connection con(argc > 1);
- con.setTcpNoDelay(true);
- string host("localhost");
- con.open(host, 5672, "guest", "guest", "/test");
- std::cout << "Opened connection." << std::endl;
-
- //Create and open a channel on the connection through which
- //most functionality is exposed
- Channel channel;
- con.openChannel(&channel);
- std::cout << "Opened channel." << std::endl;
-
- //'declare' the exchange and the queue, which will create them
- //as they don't exist
- channel.declareExchange(exchange);
- std::cout << "Declared exchange." << std::endl;
- channel.declareQueue(queue);
- std::cout << "Declared queue." << std::endl;
-
- //now bind the queue to the exchange
- qpid::framing::FieldTable args;
- channel.bind(exchange, queue, "MyTopic", args);
- std::cout << "Bound queue to exchange." << std::endl;
-
- //Set up a message listener to receive any messages that
- //arrive in our queue on the broker. We only expect one, and
- //as it will be received on another thread, we create a
- //montior to use to notify the main thread when that message
- //is received.
- Monitor monitor;
- SimpleListener listener(&monitor);
- string tag("MyTag");
- channel.consume(queue, tag, &listener);
- std::cout << "Registered consumer." << std::endl;
-
- //we need to enable the message dispatching for this channel
- //and we want that to occur on another thread so we call
- //start().
- channel.start();
-
- //Now we create and publish a message to our exchange with a
- //routing key that will cause it to be routed to our queue
- Message msg;
- string data("MyMessage");
- msg.setData(data);
- channel.publish(msg, exchange, "MyTopic");
- std::cout << "Published message: " << data << std::endl;
-
- {
- Monitor::ScopedLock l(monitor);
- //now we wait until we receive notification that the
- //message was received
- monitor.wait();
- }
-
- //close the channel & connection
- con.closeChannel(&channel);
- std::cout << "Closed channel." << std::endl;
- con.close();
- std::cout << "Closed connection." << std::endl;
- }catch(qpid::QpidError error){
- std::cout << "Error [" << error.code << "] " << error.msg << " ("
- << error.location.file << ":" << error.location.line
- << ")" << std::endl;
- return 1;
- }
- return 0;
-}
diff --git a/Final/cpp/tests/daemon_test b/Final/cpp/tests/daemon_test
deleted file mode 100755
index 05e9ed88a0..0000000000
--- a/Final/cpp/tests/daemon_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.
-#
-# Without arguments run all daemon tests, exit status is number of failures.
-# With arguments run just the test named by $1.
-#
-
-TEMP=`mktemp`
-trap 'rm -f $TEMP' 0
-qpidd=../src/qpidd
-client_test=./client_test
-
-fail() { echo FAIL: $0:$* 1>&2; exit 1; }
-
-# Start and stop daemon.
-PID=`$qpidd --check>/dev/null 2>&1` && fail $LINENO: qpidd already running $PID
-$qpidd -d || $LINENO: qpidd -d failed
-$qpidd --check >/dev/null || fail $LINENO: qpidd --check says qpidd didnt start
-$client_test > $TEMP || fail $LINENO: client_test: `cat $TEMP`
-$qpidd -q || fail $LINENO: qpidd -q failed
-true
diff --git a/Final/cpp/tests/echo_service.cpp b/Final/cpp/tests/echo_service.cpp
deleted file mode 100644
index 666c8cfa46..0000000000
--- a/Final/cpp/tests/echo_service.cpp
+++ /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.
- *
- */
-
-/**
- * This class provides an example of using AMQP for a request-response
- * style system. 'Requests' are messages sent to a well known
- * destination. A 'service' process consumes these message and
- * responds by echoing the message back to the sender on a
- * sender-specified private queue.
- */
-
-#include <QpidError.h>
-#include <ClientChannel.h>
-#include <Connection.h>
-#include <ClientExchange.h>
-#include <MessageListener.h>
-#include <ClientQueue.h>
-#include <sys/Time.h>
-#include <iostream>
-#include <sstream>
-
-using namespace qpid::client;
-using namespace qpid::sys;
-using std::string;
-
-
-/**
- * A message listener implementation representing the 'service', this
- * will 'echo' any requests received.
- */
-class EchoServer : public MessageListener{
- Channel* const channel;
-public:
- EchoServer(Channel* channel);
- virtual void received(Message& msg);
-};
-
-/**
- * A message listener implementation that merely prints received
- * messages to the console. Used to report on 'echo' responses.
- */
-class LoggingListener : public MessageListener{
-public:
- virtual void received(Message& msg);
-};
-
-/**
- * A utility class that manages the command line options needed to run
- * the example confirgurably.
- */
-class Args{
- string host;
- int port;
- bool trace;
- bool help;
- bool client;
-public:
- inline Args() : host("localhost"), port(5672), trace(false), help(false), client(false){}
- void parse(int argc, char** argv);
- void usage();
-
- inline const string& getHost() const { return host;}
- inline int getPort() const { return port; }
- inline bool getTrace() const { return trace; }
- inline bool getHelp() const { return help; }
- inline bool getClient() const { return client; }
-};
-
-/**
- * The main test path. There are two basic modes: 'client' and
- * 'service'. First one or more services are started, then one or more
- * clients are started and messages can be sent.
- */
-int main(int argc, char** argv){
- const std::string echo_service("echo_service");
- Args args;
- args.parse(argc, argv);
- if (args.getHelp()) {
- args.usage();
- } else if (args.getClient()) {
- //we have been started in 'client' mode, i.e. we will send an
- //echo requests and print responses received.
- try {
- //Create connection & open a channel
- Connection connection(args.getTrace());
- connection.open(args.getHost(), args.getPort());
- Channel channel;
- connection.openChannel(&channel);
-
- //Setup: declare the private 'response' queue and bind it
- //to the direct exchange by its name which will be
- //generated by the server
- Queue response;
- channel.declareQueue(response);
- qpid::framing::FieldTable emptyArgs;
- channel.bind(Exchange::STANDARD_DIRECT_EXCHANGE, response, response.getName(), emptyArgs);
-
- //Consume from the response queue, logging all echoed message to console:
- LoggingListener listener;
- std::string tag;
- channel.consume(response, tag, &listener);
-
- //Process incoming requests on a new thread
- channel.start();
-
- //get messages from console and send them:
- std::string text;
- std::cout << "Enter text to send:" << std::endl;
- while (std::getline(std::cin, text)) {
- std::cout << "Sending " << text << " to echo server." << std::endl;
- Message msg;
- msg.getHeaders().setString("RESPONSE_QUEUE", response.getName());
- msg.setData(text);
- channel.publish(msg, Exchange::STANDARD_DIRECT_EXCHANGE, echo_service);
-
- std::cout << "Enter text to send:" << std::endl;
- }
-
- connection.close();
- } catch(qpid::QpidError error) {
- std::cout << error.what() << std::endl;
- }
- } else {
- // we are in 'service' mode, i.e. we will consume messages
- // from the request queue and echo each request back to the
- // senders own private response queue.
- try {
- //Create connection & open a channel
- Connection connection(args.getTrace());
- connection.open(args.getHost(), args.getPort());
- Channel channel;
- connection.openChannel(&channel);
-
- //Setup: declare the 'request' queue and bind it to the direct exchange with a 'well known' name
- Queue request("request");
- channel.declareQueue(request);
- qpid::framing::FieldTable emptyArgs;
- channel.bind(Exchange::STANDARD_DIRECT_EXCHANGE, request, echo_service, emptyArgs);
-
- //Consume from the request queue, echoing back all messages received to the client that sent them
- EchoServer server(&channel);
- std::string tag = "server_tag";
- channel.consume(request, tag, &server);
-
- //Process incoming requests on the main thread
- channel.run();
-
- connection.close();
- } catch(qpid::QpidError error) {
- std::cout << error.what() << std::endl;
- }
- }
-}
-
-EchoServer::EchoServer(Channel* _channel) : channel(_channel){}
-
-void EchoServer::received(Message& message)
-{
- //get name of response queues binding to the default direct exchange:
- const std::string name = message.getHeaders().getString("RESPONSE_QUEUE");
-
- if (name.empty()) {
- std::cout << "Cannot echo " << message.getData() << ", no response queue specified." << std::endl;
- } else {
- //print message to console:
- std::cout << "Echoing " << message.getData() << " back to " << name << std::endl;
-
- //'echo' the message back:
- channel->publish(message, Exchange::STANDARD_DIRECT_EXCHANGE, name);
- }
-}
-
-void LoggingListener::received(Message& message)
-{
- //print message to console:
- std::cout << "Received echo: " << message.getData() << std::endl;
-}
-
-
-void Args::parse(int argc, char** argv){
- for(int i = 1; i < argc; i++){
- string name(argv[i]);
- if("-help" == name){
- help = true;
- break;
- }else if("-host" == name){
- host = argv[++i];
- }else if("-port" == name){
- port = atoi(argv[++i]);
- }else if("-trace" == name){
- trace = true;
- }else if("-client" == name){
- client = true;
- }else{
- std::cout << "Warning: unrecognised option " << name << std::endl;
- }
- }
-}
-
-void Args::usage(){
- std::cout << "Options:" << std::endl;
- std::cout << " -help" << std::endl;
- std::cout << " Prints this usage message" << std::endl;
- std::cout << " -host <host>" << std::endl;
- std::cout << " Specifies host to connect to (default is localhost)" << std::endl;
- std::cout << " -port <port>" << std::endl;
- std::cout << " Specifies port to conect to (default is 5762)" << std::endl;
- std::cout << " -trace" << std::endl;
- std::cout << " Indicates that the frames sent and received should be logged" << std::endl;
- std::cout << " -client" << std::endl;
- std::cout << " Run as a client (else will run as a server)" << std::endl;
-}
diff --git a/Final/cpp/tests/env b/Final/cpp/tests/env
deleted file mode 100755
index 2d88077ae5..0000000000
--- a/Final/cpp/tests/env
+++ /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.
-#
-# Set environment variables for test scripts.
-
-pathmunge () {
- if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
- if [ "$2" = "after" ] ; then
- PATH=$PATH:$1
- else
- PATH=$1:$PATH
- fi
- fi
-}
-
-if [ -z QPID_ROOT ] ; then echo "You must set QPID_ROOT" ; fi
-
-pathmunge $QPID_ROOT/cpp/tests
-# pathmunge $QPID_ROOT/cpp/build/*/bin
-# pathmunge $QPID_ROOT/cpp/build/*/test
-
-export QPID_HOME=${QPID_HOME:-$QPID_ROOT/java/build}
-pathmunge $QPID_HOME/bin
-
-
diff --git a/Final/cpp/tests/examples.Makefile b/Final/cpp/tests/examples.Makefile
deleted file mode 100644
index 4a0fd808a1..0000000000
--- a/Final/cpp/tests/examples.Makefile
+++ /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.
-#
-#
-# XXX: Edit these locations to suit.
-#
-BOOST_LOCATION := $(HOME)/local/boost-1.33.1
-APR_LOCATION := $(HOME)/local/apr-1.2.7
-
-CXXFLAGS := -DNDEBUG -DUSE_APR -MMD -fpic
-
-#
-# Configure Boost.
-#
-BOOST_CFLAGS := -I$(BOOST_LOCATION)/include/boost-1_33_1
-CXXFLAGS := $(CXXFLAGS) $(BOOST_CFLAGS)
-
-#
-# Configure APR.
-#
-APR_CFLAGS := -I$(APR_LOCATION)/include/apr-1
-APR_LDFLAGS := $(shell $(APR_LOCATION)/bin/apr-1-config --libs) -L$(APR_LOCATION)/lib -lapr-1
-CXXFLAGS := $(CXXFLAGS) $(APR_CFLAGS)
-LDFLAGS := $(LDFLAGS) $(APR_LDFLAGS)
-
-#
-# Configure Qpid cpp client.
-#
-QPID_CLIENT_LDFLAGS := ../lib/libcommon.so ../lib/libclient.so
-includeDir := ../include
-QPID_CLIENT_CFLAGS := \
- -I$(includeDir)/gen \
- -I$(includeDir)/client \
- -I$(includeDir)/broker \
- -I$(includeDir)/common \
- -I$(includeDir)/common/sys \
- -I$(includeDir)/common/framing
-
-CXXFLAGS := $(CXXFLAGS) $(QPID_CLIENT_CFLAGS)
-LDFLAGS := $(LDFLAGS) $(QPID_CLIENT_LDFLAGS)
-
-CXX := g++
-
-#
-# Add rule to build examples.
-#
-.SUFFIX: .cpp
-%: %.cpp
- $(CXX) $(CXXFLAGS) $(LDFLAGS) $< -o $@
-
-#
-# Define targets.
-#
-
-EXAMPLES := client_test topic_listener topic_publisher echo_service
-
-cppFiles := $(wildcard *.cpp)
-programs = $(foreach cppFile, $(cppFiles), $(subst .cpp, ,$(cppFile)))
-
-.PHONY:
-all: $(programs)
-
-debug:
- @echo cppFiles = $(cppFiles)
- @echo programs = $(programs)
-
-.PHONY:
-clean:
- -rm $(EXAMPLES)
diff --git a/Final/cpp/tests/examples.README b/Final/cpp/tests/examples.README
deleted file mode 100644
index 65f908c249..0000000000
--- a/Final/cpp/tests/examples.README
+++ /dev/null
@@ -1,18 +0,0 @@
-Building the examples
----------------------
-
-You had better edit the Makefile and provide the locations for APR and boost.
-
-Then just type 'make'.
-
-
-Running the examples
---------------------
-
-Before running the examples ensure that you have setup your LD_LIBRARY_PATH.
-
-Most of the examples take the following connection parameters for your
-AMQP broker:
-
- -host host
- -port port
diff --git a/Final/cpp/tests/interop_runner.cpp b/Final/cpp/tests/interop_runner.cpp
deleted file mode 100644
index 7cb9f1ead5..0000000000
--- a/Final/cpp/tests/interop_runner.cpp
+++ /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.
- *
- */
-
-#include <CommonOptions.h>
-#include <Connection.h>
-#include <ClientChannel.h>
-#include <ClientExchange.h>
-#include <ClientQueue.h>
-#include <Exception.h>
-#include <MessageListener.h>
-#include <QpidError.h>
-#include <sys/Thread.h>
-#include <sys/Time.h>
-#include <iostream>
-#include <memory>
-#include "BasicP2PTest.h"
-#include "BasicPubSubTest.h"
-#include "P2PMessageSizeTest.h"
-#include "PubSubMessageSizeTest.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::TestOptions;
-using qpid::framing::FieldTable;
-using std::string;
-
-class DummyRun : public TestCase
-{
-public:
- DummyRun() {}
- void assign(const std::string&, FieldTable&, TestOptions&) {}
- 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<std::string, TestCase> TestMap;
-
- Channel& channel;
- TestOptions& options;
- TestMap tests;
- const string name;
- const string topic;
- TestMap::iterator test;
- std::auto_ptr<Thread> runner;
- string reportTo;
- string reportCorrelator;
-
- void shutdown();
- bool invite(const string& name);
- void run();
-
- void sendResponse(Message& response, string replyTo);
- void sendResponse(Message& response, Message& request);
- void sendSimpleResponse(const string& type, Message& request);
- void sendReport();
-public:
- Listener(Channel& channel, TestOptions& options);
- void received(Message& msg);
- void bindAndConsume();
- void registerTest(std::string name, TestCase* test);
-};
-
-/**
- * TODO: Add clock synching. CLOCK_SYNCH command is currently ignored.
- */
-int main(int argc, char** argv){
- TestOptions options;
- options.parse(argc, argv);
-
- if (options.help) {
- options.usage();
- } else {
- try{
- Connection connection(options.trace);
- connection.open(options.broker, 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.registerTest("TC4_P2PMessageSize", new qpid::P2PMessageSizeTest());
- listener.registerTest("TC5_PubSubMessageSize", new qpid::PubSubMessageSizeTest());
-
- listener.bindAndConsume();
-
- channel.run();
- connection.close();
- } catch(qpid::Exception error) {
- std::cout << error.what() << std::endl;
- }
- }
-}
-
-Listener::Listener(Channel& _channel, TestOptions& _options) : channel(_channel), options(_options), name(options.clientid), topic("iop.control." + name)
-{}
-
-void Listener::registerTest(std::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);
-
- std::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.setCorrelationId(request.getCorrelationId());
- sendResponse(response, request);
-}
-
-void Listener::sendResponse(Message& response, Message& request)
-{
- sendResponse(response, request.getReplyTo());
-}
-
-void Listener::sendResponse(Message& response, string replyTo)
-{
- //Exchange and routing key need to be extracted from the reply-to
- //field. Format is assumed to be:
- //
- // <exchange type>://<exchange name>/<routing key>?<options>
- //
- //and all we need is the exchange name and routing key
- //
- if (replyTo.empty()) throw qpid::Exception("Reply address not set!");
- const string delims(":/?=");
-
- string::size_type start = replyTo.find(':');//skip exchange type
- string exchange = parse_next_word(replyTo, delims, start);
- string routingKey = parse_next_word(replyTo, delims, start);
- channel.publish(response, exchange, routingKey);
-}
-
-void Listener::received(Message& message)
-{
- std::string type(message.getHeaders().getString("CONTROL_TYPE"));
-
- if (type == "INVITE") {
- std::string name(message.getHeaders().getString("TEST_NAME"));
- if (name.empty() || invite(name)) {
- sendSimpleResponse("ENLIST", message);
- //std::cout << "Enlisting in test '" << name << "'" << std::endl;
- } else {
- std::cout << "Can't take part in '" << name << "'" << std::endl;
- }
- } else if (type == "ASSIGN_ROLE") {
- //std::cout << "Got role assignment request for '" << name << "'" << std::endl;
- test->assign(message.getHeaders().getString("ROLE"), message.getHeaders(), options);
- sendSimpleResponse("ACCEPT_ROLE", message);
- } else if (type == "START") {
- reportTo = message.getReplyTo();
- reportCorrelator = message.getCorrelationId();
- runner = std::auto_ptr<Thread>(new Thread(this));
- } else if (type == "STATUS_REQUEST") {
- reportTo = message.getReplyTo();
- reportCorrelator = message.getCorrelationId();
- test->stop();
- sendReport();
- } else if (type == "TERMINATE") {
- if (test != tests.end()) test->stop();
- shutdown();
- } else if (type == "CLOCK_SYNCH") {
- // Just ignore for now.
- } else {
- std::cerr <<"ERROR!: Received unknown control message: " << type << std::endl;
- shutdown();
- }
-}
-
-void Listener::shutdown()
-{
- channel.close();
-}
-
-bool Listener::invite(const string& name)
-{
- test = tests.find(name);
- return test != tests.end();
-}
-
-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.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/Final/cpp/tests/qpid_test_plugin.h b/Final/cpp/tests/qpid_test_plugin.h
deleted file mode 100644
index b2f4a8ffed..0000000000
--- a/Final/cpp/tests/qpid_test_plugin.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#ifndef _qpid_test_plugin_
-#define _qpid_test_plugin_
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-/**
- * Convenience to include cppunit headers needed by qpid test plugins and
- * workaround for warning from superfluous main() declaration
- * in cppunit/TestPlugIn.h
- */
-
-#include <cppunit/TestCase.h>
-#include <cppunit/TextTestRunner.h>
-#include <cppunit/extensions/HelperMacros.h>
-#include <cppunit/plugin/TestPlugIn.h>
-
-// Redefine CPPUNIT_PLUGIN_IMPLEMENT_MAIN to a dummy typedef to avoid warnings.
-//
-#if defined(CPPUNIT_HAVE_UNIX_DLL_LOADER) || defined(CPPUNIT_HAVE_UNIX_SHL_LOADER)
-#undef CPPUNIT_PLUGIN_IMPLEMENT_MAIN
-#define CPPUNIT_PLUGIN_IMPLEMENT_MAIN() typedef char __CppUnitPlugInImplementMainDummyTypeDef
-#endif
-
-#endif /*!_qpid_test_plugin_*/
diff --git a/Final/cpp/tests/run-python-tests b/Final/cpp/tests/run-python-tests
deleted file mode 100755
index 5148f644eb..0000000000
--- a/Final/cpp/tests/run-python-tests
+++ /dev/null
@@ -1,58 +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 -x $abs_srcdir/../../python/run-tests || {
- echo WARNING: Python tests not available, skipping.
- exit 0;
-}
-
-if test "$VERBOSE" = yes; then
- set -x
- qpidd --version
-fi
-
-. $srcdir/setup
-
-fail=0
-pid=0
-
-# Start the daemon, recording its PID.
-$vg $abs_builddir/../src/qpidd > log 2>&1 & pid=$!
-
-# FIXME: remove this sleep kludge once qpidd provides a way
-sleep 4
-
-# Run the tests.
-( cd $abs_srcdir/../../python \
- && python ./run-tests -v -I cpp_failing.txt ) || fail=1
-
-kill $pid || { echo FAIL: process already died; cat log; fail=1; }
-
-wait $pid
-# FIXME: when we have a way to make qpidd shutdown gracefully
-# (i.e. with expected exit status of 0), replace the above with this:
-# wait $pid || fail=1
-
-vg_check log || fail=1
-
-# Tell the exit trap not to kill any process.
-pid=0
-
-(exit $fail); exit $fail
diff --git a/Final/cpp/tests/run-system-tests b/Final/cpp/tests/run-system-tests
deleted file mode 100755
index 2f2728da32..0000000000
--- a/Final/cpp/tests/run-system-tests
+++ /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.
-#
-
-set -e
-log=`pwd`/qpidd.log
-# Start the daemon, recording its PID.
-../src/qpidd > $log 2>&1 & pid=$!
-
-# Arrange to kill the daemon upon any type of termination.
-trap 'status=$?; kill $pid; exit $status' 0
-trap '(exit $?); exit $?' 1 2 13 15
-
-# Run C++ client tests.
-run_test() {
- test="$*"
- echo -n "Running: $test ... "
- if $test >test.out 2>&1 ; then
- echo " Passed" ;
- else
- echo " FAILED. Output:";
- cat test.out
- FAILED=yes
- fi
- rm -f test.out
-}
-
-run_test ./client_test
-run_test ./topictest -l2 -m2 -b1
-
-# Run the python tests.
-if test -d ../../python ; then
- cd ../../python && ./run-tests -v -I cpp_failing.txt
-else
- echo Warning: python tests not found.
-fi
-
-# TODO aconway 2006-12-13: run the other client tests.
-
-rm -f $log
diff --git a/Final/cpp/tests/run-unit-tests b/Final/cpp/tests/run-unit-tests
deleted file mode 100755
index 27e88a5d9d..0000000000
--- a/Final/cpp/tests/run-unit-tests
+++ /dev/null
@@ -1,27 +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/setup
-
-fail=0
-$vg DllPlugInTester -c -b $pwd/.libs/*.so 2> out || fail=1
-vg_check out || fail=1
-
-exit $fail
diff --git a/Final/cpp/tests/setup b/Final/cpp/tests/setup
deleted file mode 100644
index f46435864b..0000000000
--- a/Final/cpp/tests/setup
+++ /dev/null
@@ -1,92 +0,0 @@
-# -*- 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.
-#
-
-test "$VERBOSE" = yes && set -x
-
-pwd=`pwd`
-t0=`echo "$0"|sed 's,.*/,,'`.tmp; tmp=$t0/$$
-pid=0
-test -z "$TEST_DEBUG" &&
-trap 's=$?;test $pid = 0||kill -2 $pid;cd "$pwd" && rm -rf $t0 && exit $s' 0
-test -z "$TEST_DEBUG" && trap '(exit $?); exit $?' 1 2 13 15
-
-framework_failure=0
-mkdir -p $tmp || framework_failure=1
-cd $tmp || framework_failure=1
-
-gen_supp=--gen-suppressions=all
-# This option makes valgrind significantly slower.
-full_leak_check=--leak-check=full
-
-vg_options="
- --suppressions=$abs_srcdir/.vg-supp
- --num-callers=25
- --demangle=no
- --track-fds=yes
- $full_leak_check
- $gen_supp
- "
-# configure tests for the existence of valgrind.
-# If it's not available, then make $vg and vg_check no-ops.
-if test x$VALGRIND = x; then
- vg=
-else
- vg="libtool --mode=execute valgrind `echo $vg_options` --"
-fi
-
-vg_leak_check()
-{
- local file=$1
- local fail
- # If we detect a leak, dump all output to stderr.
- grep -E '^==[0-9]+== +definitely lost: [^0]' $file \
- && { fail=1; cat $file 1>&2;
- echo "found memory leaks (see log file, $file); see above" 1>&2; }
- test "$fail" = ''
-}
-
-
-# Ensure 1) that there is an ERROR SUMMARY line, and
-# 2) that the number of errors is 0.
-# An offending line looks like this:
-# ==29302== ERROR SUMMARY: 4 errors from 2 contexts (suppressed: 16 from 5)
-vg_error_check()
-{
- local file=$1
- local fail
- # If we detect a leak, dump all output to stderr.
- grep -E '^==[0-9]+== ERROR SUMMARY:' $file > /dev/null \
- || { fail=1; cat $file 1>&2;
- echo "no valgrind ERROR SUMMARY line in $file" 1>&2; }
- if test "$fail" = ''; then
- grep -E '^==[0-9]+== ERROR SUMMARY: [^0] ' $file \
- && { fail=1; cat $file 1>&2;
- echo "valgrind reported errors in $file; see above" 1>&2; }
- fi
- test "$fail" = ''
-}
-
-vg_check()
-{
- local file=$1
- if test x$VALGRIND != x; then
- vg_error_check $file && vg_leak_check $file
- fi
-}
diff --git a/Final/cpp/tests/topic_listener.cpp b/Final/cpp/tests/topic_listener.cpp
deleted file mode 100644
index 7a32373492..0000000000
--- a/Final/cpp/tests/topic_listener.cpp
+++ /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.
- *
- */
-
-/**
- * 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 <QpidError.h>
-#include <ClientChannel.h>
-#include <Connection.h>
-#include <ClientExchange.h>
-#include <MessageListener.h>
-#include <ClientQueue.h>
-#include <sys/Time.h>
-#include <iostream>
-#include <sstream>
-
-using namespace qpid::client;
-using namespace qpid::sys;
-using std::string;
-
-/**
- * A message listener implementation in which the runtime logic is
- * defined.
- */
-class Listener : public MessageListener{
- Channel* const channel;
- const std::string responseQueue;
- const bool transactional;
- bool init;
- int count;
- Time start;
-
- void shutdown();
- void report();
-public:
- Listener(Channel* channel, const std::string& reponseQueue, bool tx);
- virtual void received(Message& msg);
-};
-
-/**
- * A utility class for managing the options passed in.
- */
-class Args{
- string host;
- int port;
- int ackMode;
- bool transactional;
- int prefetch;
- bool trace;
- bool help;
-public:
- inline Args() : host("localhost"), port(5672), ackMode(NO_ACK), transactional(false), prefetch(1000), trace(false), help(false){}
- void parse(int argc, char** argv);
- void usage();
-
- inline const string& getHost() const { return host;}
- inline int getPort() const { return port; }
- inline int getAckMode(){ return ackMode; }
- inline bool getTransactional() const { return transactional; }
- inline int getPrefetch(){ return prefetch; }
- inline bool getTrace() const { return trace; }
- inline bool getHelp() const { return help; }
-};
-
-/**
- * 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){
- Args args;
- args.parse(argc, argv);
- if(args.getHelp()){
- args.usage();
- }else{
- try{
- Connection connection(args.getTrace());
- connection.open(args.getHost(), args.getPort(), "guest", "guest", "/test");
- Channel channel(args.getTransactional(), args.getPrefetch());
- connection.openChannel(&channel);
-
- //declare exchange, queue and bind them:
- Queue response("response");
- channel.declareQueue(response);
-
- Queue control;
- channel.declareQueue(control);
- qpid::framing::FieldTable bindArgs;
- channel.bind(Exchange::STANDARD_TOPIC_EXCHANGE, control, "topic_control", bindArgs);
- //set up listener
- Listener listener(&channel, response.getName(), args.getTransactional());
- std::string tag;
- channel.consume(control, tag, &listener, args.getAckMode());
- channel.run();
- connection.close();
- }catch(qpid::QpidError error){
- std::cout << error.what() << std::endl;
- }
- }
-}
-
-Listener::Listener(Channel* _channel, const std::string& _responseq, bool tx) :
- channel(_channel), responseQueue(_responseq), transactional(tx), init(false), count(0){}
-
-void Listener::received(Message& message){
- if(!init){
- start = now();
- count = 0;
- init = true;
- }
- std::string type(message.getHeaders().getString("TYPE"));
-
- if(type == "TERMINATION_REQUEST"){
- shutdown();
- }else if(type == "REPORT_REQUEST"){
- //send a report:
- report();
- init = false;
- }else if (++count % 100 == 0){
- std::cout <<"Received " << count << " messages." << std::endl;
- }
-}
-
-void Listener::shutdown(){
- channel->close();
-}
-
-void Listener::report(){
- Time finish = now();
- Time time = finish - start;
- std::stringstream reportstr;
- reportstr << "Received " << count << " messages in "
- << time/TIME_MSEC << " ms.";
- Message msg;
- msg.setData(reportstr.str());
- channel->publish(msg, string(), responseQueue);
- if(transactional){
- channel->commit();
- }
-}
-
-
-void Args::parse(int argc, char** argv){
- for(int i = 1; i < argc; i++){
- string name(argv[i]);
- if("-help" == name){
- help = true;
- break;
- }else if("-host" == name){
- host = argv[++i];
- }else if("-port" == name){
- port = atoi(argv[++i]);
- }else if("-ack_mode" == name){
- ackMode = atoi(argv[++i]);
- }else if("-transactional" == name){
- transactional = true;
- }else if("-prefetch" == name){
- prefetch = atoi(argv[++i]);
- }else if("-trace" == name){
- trace = true;
- }else{
- std::cout << "Warning: unrecognised option " << name << std::endl;
- }
- }
-}
-
-void Args::usage(){
- std::cout << "Options:" << std::endl;
- std::cout << " -help" << std::endl;
- std::cout << " Prints this usage message" << std::endl;
- std::cout << " -host <host>" << std::endl;
- std::cout << " Specifies host to connect to (default is localhost)" << std::endl;
- std::cout << " -port <port>" << std::endl;
- std::cout << " Specifies port to conect to (default is 5762)" << std::endl;
- std::cout << " -ack_mode <mode>" << std::endl;
- std::cout << " Sets the acknowledgement mode" << std::endl;
- std::cout << " 0=NO_ACK (default), 1=AUTO_ACK, 2=LAZY_ACK" << std::endl;
- std::cout << " -transactional" << std::endl;
- std::cout << " Indicates the client should use transactions" << std::endl;
- std::cout << " -prefetch <count>" << std::endl;
- std::cout << " Specifies the prefetch count (default is 1000)" << std::endl;
- std::cout << " -trace" << std::endl;
- std::cout << " Indicates that the frames sent and received should be logged" << std::endl;
-}
diff --git a/Final/cpp/tests/topic_publisher.cpp b/Final/cpp/tests/topic_publisher.cpp
deleted file mode 100644
index 31e5fc3fc2..0000000000
--- a/Final/cpp/tests/topic_publisher.cpp
+++ /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.
- *
- */
-
-/**
- * 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 <QpidError.h>
-#include <ClientChannel.h>
-#include <Connection.h>
-#include <ClientExchange.h>
-#include <MessageListener.h>
-#include <ClientQueue.h>
-#include <sys/Monitor.h>
-#include "unistd.h"
-#include <sys/Time.h>
-#include <cstdlib>
-#include <iostream>
-
-using namespace qpid::client;
-using namespace qpid::sys;
-using std::string;
-
-/**
- * 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 : public MessageListener{
- Channel* const channel;
- const std::string controlTopic;
- const bool transactional;
- Monitor monitor;
- int count;
-
- void waitForCompletion(int msgs);
- string generateData(int size);
-
-public:
- Publisher(Channel* channel, const std::string& controlTopic, bool tx);
- virtual void received(Message& msg);
- int64_t publish(int msgs, int listeners, int size);
- void terminate();
-};
-
-/**
- * A utility class for managing the options passed in to the test
- */
-class Args{
- string host;
- int port;
- int messages;
- int subscribers;
- int ackMode;
- bool transactional;
- int prefetch;
- int batches;
- int delay;
- int size;
- bool trace;
- bool help;
-public:
- inline Args() : host("localhost"), port(5672), messages(1000), subscribers(1),
- ackMode(NO_ACK), transactional(false), prefetch(1000), batches(1),
- delay(0), size(256), trace(false), help(false){}
-
- void parse(int argc, char** argv);
- void usage();
-
- inline const string& getHost() const { return host;}
- inline int getPort() const { return port; }
- inline int getMessages() const { return messages; }
- inline int getSubscribers() const { return subscribers; }
- inline int getAckMode(){ return ackMode; }
- inline bool getTransactional() const { return transactional; }
- inline int getPrefetch(){ return prefetch; }
- inline int getBatches(){ return batches; }
- inline int getDelay(){ return delay; }
- inline int getSize(){ return size; }
- inline bool getTrace() const { return trace; }
- inline bool getHelp() const { return help; }
-};
-
-int main(int argc, char** argv){
- Args args;
- args.parse(argc, argv);
- if(args.getHelp()){
- args.usage();
- }else{
- try{
- Connection connection(args.getTrace());
- connection.open(args.getHost(), args.getPort(), "guest", "guest", "/test");
- Channel channel(args.getTransactional(), args.getPrefetch());
- connection.openChannel(&channel);
-
- //declare queue (relying on default binding):
- Queue response("response");
- channel.declareQueue(response);
-
- //set up listener
- Publisher publisher(&channel, "topic_control", args.getTransactional());
- std::string tag("mytag");
- channel.consume(response, tag, &publisher, args.getAckMode());
- channel.start();
-
- int batchSize(args.getBatches());
- int64_t max(0);
- int64_t min(0);
- int64_t sum(0);
- for(int i = 0; i < batchSize; i++){
- if(i > 0 && args.getDelay()) sleep(args.getDelay());
- Time time = publisher.publish(
- args.getMessages(), args.getSubscribers(), args.getSize());
- if(!max || time > max) max = time;
- if(!min || time < min) min = time;
- sum += time;
- std::cout << "Completed " << (i+1) << " of " << batchSize
- << " in " << time/TIME_MSEC << "ms" << std::endl;
- }
- publisher.terminate();
- int64_t avg = sum / batchSize;
- if(batchSize > 1){
- std::cout << batchSize << " batches completed. avg=" << avg <<
- ", max=" << max << ", min=" << min << std::endl;
- }
- channel.close();
- connection.close();
- }catch(qpid::QpidError error){
- std::cout << error.what() << std::endl;
- }
- }
-}
-
-Publisher::Publisher(Channel* _channel, const std::string& _controlTopic, bool tx) :
- channel(_channel), controlTopic(_controlTopic), transactional(tx){}
-
-void Publisher::received(Message& ){
- //count responses and when all are received end the current batch
- Monitor::ScopedLock l(monitor);
- if(--count == 0){
- monitor.notify();
- }
-}
-
-void Publisher::waitForCompletion(int msgs){
- count = msgs;
- monitor.wait();
-}
-
-int64_t Publisher::publish(int msgs, int listeners, int size){
- Message msg;
- msg.setData(generateData(size));
- Time start = now();
- {
- Monitor::ScopedLock l(monitor);
- for(int i = 0; i < msgs; i++){
- channel->publish(msg, Exchange::STANDARD_TOPIC_EXCHANGE, controlTopic);
- }
- //send report request
- Message reportRequest;
- reportRequest.getHeaders().setString("TYPE", "REPORT_REQUEST");
- channel->publish(reportRequest, Exchange::STANDARD_TOPIC_EXCHANGE, controlTopic);
- if(transactional){
- channel->commit();
- }
-
- waitForCompletion(listeners);
- }
-
- Time finish = now();
- return finish - start;
-}
-
-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;
- terminationRequest.getHeaders().setString("TYPE", "TERMINATION_REQUEST");
- channel->publish(terminationRequest, Exchange::STANDARD_TOPIC_EXCHANGE, controlTopic);
- if(transactional){
- channel->commit();
- }
-}
-
-void Args::parse(int argc, char** argv){
- for(int i = 1; i < argc; i++){
- string name(argv[i]);
- if("-help" == name){
- help = true;
- break;
- }else if("-host" == name){
- host = argv[++i];
- }else if("-port" == name){
- port = atoi(argv[++i]);
- }else if("-messages" == name){
- messages = atoi(argv[++i]);
- }else if("-subscribers" == name){
- subscribers = atoi(argv[++i]);
- }else if("-ack_mode" == name){
- ackMode = atoi(argv[++i]);
- }else if("-transactional" == name){
- transactional = true;
- }else if("-prefetch" == name){
- prefetch = atoi(argv[++i]);
- }else if("-batches" == name){
- batches = atoi(argv[++i]);
- }else if("-delay" == name){
- delay = atoi(argv[++i]);
- }else if("-size" == name){
- size = atoi(argv[++i]);
- }else if("-trace" == name){
- trace = true;
- }else{
- std::cout << "Warning: unrecognised option " << name << std::endl;
- }
- }
-}
-
-void Args::usage(){
- std::cout << "Options:" << std::endl;
- std::cout << " -help" << std::endl;
- std::cout << " Prints this usage message" << std::endl;
- std::cout << " -host <host>" << std::endl;
- std::cout << " Specifies host to connect to (default is localhost)" << std::endl;
- std::cout << " -port <port>" << std::endl;
- std::cout << " Specifies port to conect to (default is 5762)" << std::endl;
- std::cout << " -messages <count>" << std::endl;
- std::cout << " Specifies how many messages to send" << std::endl;
- std::cout << " -subscribers <count>" << std::endl;
- std::cout << " Specifies how many subscribers to expect reports from" << std::endl;
- std::cout << " -ack_mode <mode>" << std::endl;
- std::cout << " Sets the acknowledgement mode" << std::endl;
- std::cout << " 0=NO_ACK (default), 1=AUTO_ACK, 2=LAZY_ACK" << std::endl;
- std::cout << " -transactional" << std::endl;
- std::cout << " Indicates the client should use transactions" << std::endl;
- std::cout << " -prefetch <count>" << std::endl;
- std::cout << " Specifies the prefetch count (default is 1000)" << std::endl;
- std::cout << " -batches <count>" << std::endl;
- std::cout << " Specifies how many batches to run" << std::endl;
- std::cout << " -delay <seconds>" << std::endl;
- std::cout << " Causes a delay between each batch" << std::endl;
- std::cout << " -size <bytes>" << std::endl;
- std::cout << " Sets the size of the published messages (default is 256 bytes)" << std::endl;
- std::cout << " -trace" << std::endl;
- std::cout << " Indicates that the frames sent and received should be logged" << std::endl;
-}
diff --git a/Final/cpp/tests/topicall b/Final/cpp/tests/topicall
deleted file mode 100755
index 5f80955309..0000000000
--- a/Final/cpp/tests/topicall
+++ /dev/null
@@ -1,43 +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.
-#
-# Do 3 runs of topictests for C++ and Java brokers with reduced output.
-
-. `dirname $0`/env
-
-# Run a short topictest to warm up the broker and iron out startup effects.
-flush() {
- topic_listener >/dev/null 2>&1 &
- topic_publisher >/dev/null 2>&1
-}
-
-echo Java broker
-broker j ; flush
-topictest c | tail -n1
-topictest c | tail -n1
-topictest c | tail -n1
-
-echo C++ broker
-broker c ; flush
-topictest c | tail -n1
-topictest c | tail -n1
-topictest c | tail -n1
-
-# Don't bother with java clients we know they're slower.
-
diff --git a/Final/cpp/tests/topictest b/Final/cpp/tests/topictest
deleted file mode 100755
index 28af55951e..0000000000
--- a/Final/cpp/tests/topictest
+++ /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.
-#
-# Run the c++ or java topic test
-
-. `dirname $0`/env
-
-# Edit parameters here:
-
-# Big test:
-# LISTENERS=10
-# MESSAGES=10000
-# BATCHES=20
-
-LISTENERS=10
-MESSAGES=2000
-BATCHES=10
-
-cppcmds() {
- LISTEN_CMD=./topic_listener
- PUBLISH_CMD="./topic_publisher -messages $MESSAGES -batches $BATCHES -subscribers $LISTENERS"
-}
-
-javacmds() {
- DEF=-Damqj.logging.level="error"
- LISTEN_CMD="qpid-run $DEF org.apache.qpid.topic.Listener"
- PUBLISH_CMD="qpid-run $DEF org.apache.qpid.topic.Publisher -messages $MESSAGES -batch $BATCHES -clients $LISTENERS"
-}
-
-case $1 in
- c) cppcmds ;;
- j) javacmds ;;
- *) cppcmds ;;
-esac
-
-for ((i=$LISTENERS ; i--; )); do
- $LISTEN_CMD > /dev/null 2>&1 &
-done
-sleep 1
-echo $PUBLISH_CMD $OPTIONS
-
-STATS=~/bin/topictest.times
-echo "---- topictest `date`" >> $STATS
-$PUBLISH_CMD $OPTIONS | tee -a $STATS
diff --git a/Final/cpp/versions b/Final/cpp/versions
deleted file mode 100755
index 2aa52bf877..0000000000
--- a/Final/cpp/versions
+++ /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.
-#
-# 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/Final/dotnet/LICENSE.txt b/Final/dotnet/LICENSE.txt
deleted file mode 100644
index 6b0b1270ff..0000000000
--- a/Final/dotnet/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/Final/dotnet/NOTICE.txt b/Final/dotnet/NOTICE.txt
deleted file mode 100644
index 910974b01c..0000000000
--- a/Final/dotnet/NOTICE.txt
+++ /dev/null
@@ -1,26 +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/ \ No newline at end of file
diff --git a/Final/dotnet/Qpid.Buffer.Tests/Properties/AssemblyInfo.cs b/Final/dotnet/Qpid.Buffer.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index 1191d49954..0000000000
--- a/Final/dotnet/Qpid.Buffer.Tests/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-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("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Apache.Qpid.Buffer.Tests")]
-[assembly: AssemblyCopyright("Copyright © 2007")]
-[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("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Final/dotnet/Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj b/Final/dotnet/Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj
deleted file mode 100644
index c3459aff29..0000000000
--- a/Final/dotnet/Qpid.Buffer.Tests/Qpid.Buffer.Tests.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<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>{74640962-99D0-4D06-B57A-9CD66517CF52}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Buffer.Tests</RootNamespace>
- <AssemblyName>Apache.Qpid.Buffer.Tests</AssemblyName>
- </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="SlicedByteBufferTests.cs" />
- <Compile Include="SimpleByteBufferTests.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>
- </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/Final/dotnet/Qpid.Buffer.Tests/SimpleByteBufferTests.cs b/Final/dotnet/Qpid.Buffer.Tests/SimpleByteBufferTests.cs
deleted file mode 100644
index 9af8801627..0000000000
--- a/Final/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/Final/dotnet/Qpid.Buffer.Tests/SlicedByteBufferTests.cs b/Final/dotnet/Qpid.Buffer.Tests/SlicedByteBufferTests.cs
deleted file mode 100644
index 071aa23830..0000000000
--- a/Final/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/Final/dotnet/Qpid.Buffer.Tests/default.build b/Final/dotnet/Qpid.Buffer.Tests/default.build
deleted file mode 100644
index 688633fc11..0000000000
--- a/Final/dotnet/Qpid.Buffer.Tests/default.build
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<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/Final/dotnet/Qpid.Buffer/BufferOverflowException.cs b/Final/dotnet/Qpid.Buffer/BufferOverflowException.cs
deleted file mode 100644
index 5a2fff74a7..0000000000
--- a/Final/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/Final/dotnet/Qpid.Buffer/BufferUnderflowException.cs b/Final/dotnet/Qpid.Buffer/BufferUnderflowException.cs
deleted file mode 100644
index 13939b77a8..0000000000
--- a/Final/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/Final/dotnet/Qpid.Buffer/ByteBuffer.cs b/Final/dotnet/Qpid.Buffer/ByteBuffer.cs
deleted file mode 100644
index 67f0edd440..0000000000
--- a/Final/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/Final/dotnet/Qpid.Buffer/ByteBufferHexDumper.cs b/Final/dotnet/Qpid.Buffer/ByteBufferHexDumper.cs
deleted file mode 100644
index 4c2856c333..0000000000
--- a/Final/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/Final/dotnet/Qpid.Buffer/IByteBufferAllocator.cs b/Final/dotnet/Qpid.Buffer/IByteBufferAllocator.cs
deleted file mode 100644
index 0f457df065..0000000000
--- a/Final/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/Final/dotnet/Qpid.Buffer/Properties/AssemblyInfo.cs b/Final/dotnet/Qpid.Buffer/Properties/AssemblyInfo.cs
deleted file mode 100644
index 4dd92ccdc2..0000000000
--- a/Final/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("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Qpid")]
-[assembly: AssemblyProduct("Apache.Qpid.ByteBuffer")]
-[assembly: AssemblyCopyright("Copyright (c) 2006 The 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("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Final/dotnet/Qpid.Buffer/Qpid.Buffer.csproj b/Final/dotnet/Qpid.Buffer/Qpid.Buffer.csproj
deleted file mode 100644
index 9320438f6f..0000000000
--- a/Final/dotnet/Qpid.Buffer/Qpid.Buffer.csproj
+++ /dev/null
@@ -1,59 +0,0 @@
-<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>{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>
- </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="BufferOverflowException.cs" />
- <Compile Include="BufferUnderflowException.cs" />
- <Compile Include="ByteBuffer.cs" />
- <Compile Include="ByteBufferHexDumper.cs" />
- <Compile Include="IByteBufferAllocator.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="SimpleByteBuffer.cs" />
- <Compile Include="SimpleByteBufferAllocator.cs" />
- <Compile Include="SlicedByteBuffer.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/Final/dotnet/Qpid.Buffer/SimpleByteBuffer.cs b/Final/dotnet/Qpid.Buffer/SimpleByteBuffer.cs
deleted file mode 100644
index d3b7245cb1..0000000000
--- a/Final/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/Final/dotnet/Qpid.Buffer/SimpleByteBufferAllocator.cs b/Final/dotnet/Qpid.Buffer/SimpleByteBufferAllocator.cs
deleted file mode 100644
index e772e59ae3..0000000000
--- a/Final/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/Final/dotnet/Qpid.Buffer/SlicedByteBuffer.cs b/Final/dotnet/Qpid.Buffer/SlicedByteBuffer.cs
deleted file mode 100644
index c27b7949b6..0000000000
--- a/Final/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/Final/dotnet/Qpid.Buffer/default.build b/Final/dotnet/Qpid.Buffer/default.build
deleted file mode 100644
index c2d36d15e6..0000000000
--- a/Final/dotnet/Qpid.Buffer/default.build
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<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/Final/dotnet/Qpid.Client.Tests/App.config b/Final/dotnet/Qpid.Client.Tests/App.config
deleted file mode 100644
index fd7c412a57..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/App.config
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<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/Final/dotnet/Qpid.Client.Tests/BrokerDetails/BrokerDetailsTest.cs b/Final/dotnet/Qpid.Client.Tests/BrokerDetails/BrokerDetailsTest.cs
deleted file mode 100644
index 8e8d8ced3b..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client.Tests/Channel/ChannelMessageCreationTests.cs b/Final/dotnet/Qpid.Client.Tests/Channel/ChannelMessageCreationTests.cs
deleted file mode 100644
index c27aa9a503..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client.Tests/Channel/ChannelQueueTest.cs b/Final/dotnet/Qpid.Client.Tests/Channel/ChannelQueueTest.cs
deleted file mode 100644
index a9a39f87f8..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/Channel/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.Messaging;
-using NUnit.Framework;
-
-namespace Apache.Qpid.Client.Tests.Channel
-{
- /// <summary>
- /// Test the queue methods
- /// </summary>
- [TestFixture]
- 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("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("Message 1");
- SendTestMessage("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/Final/dotnet/Qpid.Client.Tests/Common/BaseMessagingTestFixture.cs b/Final/dotnet/Qpid.Client.Tests/Common/BaseMessagingTestFixture.cs
deleted file mode 100644
index 9f91958028..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/Common/BaseMessagingTestFixture.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 log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Qms;
-
-namespace Apache.Qpid.Client.Tests
-{
- /// <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, on the default exchange,
- /// 'test' queue.
- /// </summary>
- public class BaseMessagingTestFixture
- {
- private static ILog _logger = LogManager.GetLogger(typeof(BaseMessagingTestFixture));
-
- /// <summary> The default AMQ connection URL to use for tests. </summary>
- const string connectionUri = "amqp://guest:guest@default/test?brokerlist='tcp://localhost:5672'";
-
- /// <summary> Holds the test connection. </summary>
- protected IConnection _connection;
-
- /// <summary> Holds the test channel. </summary>
- protected IChannel _channel;
-
- /// <summary>
- /// Creates the test connection and channel.
- /// </summary>
- [SetUp]
- public virtual void Init()
- {
- _logger.Info("public virtual void Init(): called");
-
- try
- {
- IConnectionInfo connectionInfo = QpidConnectionInfo.FromUrl(connectionUri);
- _connection = new AMQConnection(connectionInfo);
- _channel = _connection.CreateChannel(false, AcknowledgeMode.NoAcknowledge, 500, 300);
- }
- catch (QpidException e)
- {
- _logger.Error("Error initialisng test fixture: " + e, e);
- throw e;
- }
- }
-
- /// <summary>
- /// Disposes 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()
- {
- _logger.Info("public virtual void Shutdown(): called");
-
- if (_connection != null)
- {
- _logger.Info("Disposing connection.");
- _connection.Dispose();
- _logger.Info("Connection disposed.");
- }
- }
- }
-}
diff --git a/Final/dotnet/Qpid.Client.Tests/HeadersExchange/HeadersExchangeTest.cs b/Final/dotnet/Qpid.Client.Tests/HeadersExchange/HeadersExchangeTest.cs
deleted file mode 100644
index f3ce695de8..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/HeadersExchange/HeadersExchangeTest.cs
+++ /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.
- *
- */
-using System;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Framing;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.Tests
-{
- /// <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]
- 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 = 1000;
-
- /// <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;
-
- [SetUp]
- public override void Init()
- {
- // Ensure that the base init method is called. It establishes a connection with the broker.
- base.Init();
-
- _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();
-
- 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/Final/dotnet/Qpid.Client.Tests/Messages/MessageFactoryRegistryTests.cs b/Final/dotnet/Qpid.Client.Tests/Messages/MessageFactoryRegistryTests.cs
deleted file mode 100644
index 1211196541..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client.Tests/MultiConsumer/ProducerMultiConsumer.cs b/Final/dotnet/Qpid.Client.Tests/MultiConsumer/ProducerMultiConsumer.cs
deleted file mode 100644
index dc3b436a41..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/MultiConsumer/ProducerMultiConsumer.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.Text;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.Tests
-{
- [TestFixture]
- public class ProducerMultiConsumer : BaseMessagingTestFixture
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(ProducerMultiConsumer));
-
- private string _commandQueueName = "ServiceQ1";
-
- private const int CONSUMER_COUNT = 5;
-
- private const int MESSAGE_COUNT = 1000;
-
- private const string MESSAGE_DATA_BYTES = "****jfd ghljgl hjvhlj cvhvjf ldhfsj lhfdsjf hldsjfk hdslkfj hsdflk ";
-
- AutoResetEvent _finishedEvent = new AutoResetEvent(false);
-
- private static String GetData(int size)
- {
- StringBuilder buf = new StringBuilder(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();
- }
-
- private IMessagePublisher _publisher;
-
- private IMessageConsumer[] _consumers = new IMessageConsumer[CONSUMER_COUNT];
-
- private int _messageReceivedCount = 0;
-
- [SetUp]
- public override void Init()
- {
- base.Init();
- _publisher = _channel.CreatePublisherBuilder()
- .WithRoutingKey(_commandQueueName)
- .WithExchangeName(ExchangeNameDefaults.TOPIC)
- .Create();
-
- _publisher.DisableMessageTimestamp = true;
- _publisher.DeliveryMode = DeliveryMode.NonPersistent;
-
- for (int i = 0; i < CONSUMER_COUNT; i++)
- {
- string queueName = _channel.GenerateUniqueName();
- _channel.DeclareQueue(queueName, false, true, true);
-
- _channel.Bind(queueName, ExchangeNameDefaults.TOPIC, _commandQueueName);
-
- _consumers[i] = _channel.CreateConsumerBuilder(queueName)
- .WithPrefetchLow(100).Create();
- _consumers[i].OnMessage = new MessageReceivedDelegate(OnMessage);
- }
- _connection.Start();
- }
-
- public void OnMessage(IMessage m)
- {
- int newCount = Interlocked.Increment(ref _messageReceivedCount);
- if (newCount % 1000 == 0) _logger.Info("Received count=" + newCount);
- if (newCount == (MESSAGE_COUNT * CONSUMER_COUNT))
- {
- _logger.Info("All messages received");
- _finishedEvent.Set();
- }
- if ( newCount % 100 == 0 )
- System.Diagnostics.Debug.WriteLine(((ITextMessage)m).Text);
- }
-
- [Test]
- public void RunTest()
- {
- for (int i = 0; i < MESSAGE_COUNT; i++)
- {
- ITextMessage msg;
- try
- {
- msg = _channel.CreateTextMessage(GetData(512 + 8*i));
- }
- catch (Exception e)
- {
- _logger.Error("Error creating message: " + e, e);
- break;
- }
- _publisher.Send(msg);
- }
- _finishedEvent.WaitOne();
- }
- }
-}
diff --git a/Final/dotnet/Qpid.Client.Tests/Properties/AssemblyInfo.cs b/Final/dotnet/Qpid.Client.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index b3648391c1..0000000000
--- a/Final/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("Test Suite for Qpid Clients")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Qpid")]
-[assembly: AssemblyProduct("Apache.Qpid.Client.Tests")]
-[assembly: AssemblyCopyright("Copyright (c) 2006 The 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("0.5.*")]
diff --git a/Final/dotnet/Qpid.Client.Tests/Qpid.Client.Tests.csproj b/Final/dotnet/Qpid.Client.Tests/Qpid.Client.Tests.csproj
deleted file mode 100644
index 16f73ea621..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/Qpid.Client.Tests.csproj
+++ /dev/null
@@ -1,113 +0,0 @@
-<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>{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>
- </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="BrokerDetails\BrokerDetailsTest.cs" />
- <Compile Include="Channel\ChannelMessageCreationTests.cs" />
- <Compile Include="Channel\ChannelQueueTest.cs" />
- <Compile Include="interop\InteropClientTestCase.cs" />
- <Compile Include="interop\TestCases\TestCase1DummyRun.cs" />
- <Compile Include="interop\TestCases\TestCase2BasicP2P.cs" />
- <Compile Include="interop\TestCases\TestCase3BasicPubSub.cs" />
- <Compile Include="interop\TestClient.cs" />
- <Compile Include="Messages\MessageFactoryRegistryTests.cs" />
- <Compile Include="connection\ConnectionTest.cs" />
- <Compile Include="connection\SslConnectionTest.cs" />
- <Compile Include="failover\FailoverTest.cs" />
- <Compile Include="HeadersExchange\HeadersExchangeTest.cs" />
- <Compile Include="interop\TopicListener.cs" />
- <Compile Include="interop\TopicPublisher.cs" />
- <Compile Include="MultiConsumer\ProducerMultiConsumer.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Common\BaseMessagingTestFixture.cs" />
- <Compile Include="requestreply1\ServiceProvidingClient.cs" />
- <Compile Include="requestreply1\ServiceRequestingClient.cs" />
- <Compile Include="Security\CallbackHandlerRegistryTests.cs" />
- <Compile Include="SimpleConsumer\TestSyncConsumer.cs" />
- <Compile Include="undeliverable\UndeliverableTest.cs" />
- <Compile Include="url\ConnectionUrlTest.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" />
- <None Include="Qpid.Common.DLL.config">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </None>
- </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/Final/dotnet/Qpid.Client.Tests/Qpid.Common.DLL.config b/Final/dotnet/Qpid.Client.Tests/Qpid.Common.DLL.config
deleted file mode 100644
index e1300549d7..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/Qpid.Common.DLL.config
+++ /dev/null
@@ -1,5 +0,0 @@
-<configuration>
- <assemblySettings>
- <add key="OpenAMQ1d4Compatibility" value="false"/>
- </assemblySettings>
-</configuration> \ No newline at end of file
diff --git a/Final/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs b/Final/dotnet/Qpid.Client.Tests/Security/CallbackHandlerRegistryTests.cs
deleted file mode 100644
index 1345511cbf..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client.Tests/SimpleConsumer/TestSyncConsumer.cs b/Final/dotnet/Qpid.Client.Tests/SimpleConsumer/TestSyncConsumer.cs
deleted file mode 100644
index f299812989..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/SimpleConsumer/TestSyncConsumer.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.Text;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.Tests
-{
- [TestFixture]
- public class TestSyncConsumer : BaseMessagingTestFixture
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(TestSyncConsumer));
-
- private string _commandQueueName = "ServiceQ1";
- private const int MESSAGE_COUNT = 1000;
- private const string MESSAGE_DATA_BYTES = "jfd ghljgl hjvhlj cvhvjf ldhfsj lhfdsjf hldsjfk hdslkfj hsdflk ";
-
- private static String GetData(int size)
- {
- StringBuilder buf = new StringBuilder(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();
- }
-
- private IMessageConsumer _consumer;
- private IMessagePublisher _publisher;
-
- [SetUp]
- public override void Init()
- {
- base.Init();
- _publisher = _channel.CreatePublisherBuilder()
- .WithRoutingKey(_commandQueueName)
- .WithExchangeName(ExchangeNameDefaults.TOPIC)
- .Create();
-
- _publisher.DisableMessageTimestamp = true;
- _publisher.DeliveryMode = DeliveryMode.NonPersistent;
-
- string queueName = _channel.GenerateUniqueName();
- _channel.DeclareQueue(queueName, false, true, true);
-
- _channel.Bind(queueName, ExchangeNameDefaults.TOPIC, _commandQueueName);
-
- _consumer = _channel.CreateConsumerBuilder(queueName)
- .WithPrefetchLow(100).Create();
- _connection.Start();
- }
-
- [Test]
- public void ReceiveWithInfiniteWait()
- {
- // send all messages
- for ( int i = 0; i < MESSAGE_COUNT; i++ )
- {
- ITextMessage msg;
- try
- {
- msg = _channel.CreateTextMessage(GetData(512 + 8 * i));
- } catch ( Exception e )
- {
- _logger.Error("Error creating message: " + e, e);
- break;
- }
- _publisher.Send(msg);
- }
-
- _logger.Debug("All messages sent");
- // receive all messages
- for ( int i = 0; i < MESSAGE_COUNT; i++ )
- {
- try
- {
- IMessage msg = _consumer.Receive();
- Assert.IsNotNull(msg);
- } catch ( Exception e )
- {
- _logger.Error("Error receiving message: " + e, e);
- Assert.Fail(e.ToString());
- }
- }
- }
-
- [Test]
- public void ReceiveWithTimeout()
- {
- ITextMessage msg = _channel.CreateTextMessage(GetData(512 + 8));
- _publisher.Send(msg);
-
- IMessage recvMsg = _consumer.Receive();
- Assert.IsNotNull(recvMsg);
- // empty queue, should timeout
- Assert.IsNull(_consumer.Receive(1000));
- }
- }
-}
diff --git a/Final/dotnet/Qpid.Client.Tests/connection/ConnectionTest.cs b/Final/dotnet/Qpid.Client.Tests/connection/ConnectionTest.cs
deleted file mode 100644
index 165da62828..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/connection/ConnectionTest.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 NUnit.Framework;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.Tests.Connection
-{
- [TestFixture]
- 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/Final/dotnet/Qpid.Client.Tests/connection/SslConnectionTest.cs b/Final/dotnet/Qpid.Client.Tests/connection/SslConnectionTest.cs
deleted file mode 100644
index e1c61f9059..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/connection/SslConnectionTest.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 System.IO;
-using System.Reflection;
-using System.Security.Cryptography.X509Certificates;
-using NUnit.Framework;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.Tests.Connection
-{
- /// <summary>
- /// Test SSL/TLS connections to the broker
- /// </summary>
- [TestFixture, Category("SSL")]
- 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/Final/dotnet/Qpid.Client.Tests/default.build b/Final/dotnet/Qpid.Client.Tests/default.build
deleted file mode 100644
index d1b1496a8b..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/default.build
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-<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>
- <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="Failover"/>
- <exclude name="SSL" if="${framework::get-target-framework() == 'mono-2.0'}"/>
- </categories>
- </test>
- </nunit2>
- </target>
-
-</project>
-
diff --git a/Final/dotnet/Qpid.Client.Tests/failover/FailoverTest.cs b/Final/dotnet/Qpid.Client.Tests/failover/FailoverTest.cs
deleted file mode 100644
index 15e2eb6757..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/failover/FailoverTest.cs
+++ /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.
- *
- */
-using System;
-using System.Runtime.InteropServices;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Client.Qms;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.Tests.failover
-{
- [TestFixture, Category("Failover")]
- 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>
- /// 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)
- {
- // Reset all counts.
- messagesSent = 0;
- messagesReceived = 0;
-
- // 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()
- {
- 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:5672;tcp://localhost:5673'&failover='roundrobin'";
- IConnectionInfo connectionInfo = QpidConnectionInfo.FromUrl(defaultUrl);
-
- Init(connectionInfo);
- DoFailoverTest();
- }
-
- /// <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()
- {
- _log.Debug("void DoFailoverTest(IConnectionInfo connectionInfo): called");
-
- for (int i = 1; i <= NUM_MESSAGES; ++i)
- {
- ITextMessage msg = publishingChannel.CreateTextMessage("message=" + messagesSent);
- //_log.Debug("sending message = " + msg.Text);
- publisher.Send(msg);
- messagesSent++;
-
- _log.Debug("messagesSent = " + messagesSent);
-
- if (transacted)
- {
- publishingChannel.Commit();
- }
-
- // Prompt the user to cause a failure if at the fail point.
- if (i == FAIL_POINT)
- {
- PromptAndWait("Cause a broker failure now, then press return...");
- }
-
- //Thread.Sleep(SLEEP_MILLIS);
- }
-
- // Wait for all of the test messages to be received, checking that this occurs within the test time limit.
- bool withinTimeout;
-
- 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");
- }
-
- /// <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)
- {
- lock (testComplete)
- {
- 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()
- {
- _log.Debug("public void FailoverComplete(): called");
- }
- }
-}
diff --git a/Final/dotnet/Qpid.Client.Tests/interop/InteropClientTestCase.cs b/Final/dotnet/Qpid.Client.Tests/interop/InteropClientTestCase.cs
deleted file mode 100644
index a667265ba4..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/interop/InteropClientTestCase.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System;
-using System.Text;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.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/Final/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase1DummyRun.cs b/Final/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase1DummyRun.cs
deleted file mode 100644
index 7ff686e1cb..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase1DummyRun.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using System.Text;
-using log4net;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.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/Final/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase2BasicP2P.cs b/Final/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase2BasicP2P.cs
deleted file mode 100644
index 657c512a67..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase2BasicP2P.cs
+++ /dev/null
@@ -1,185 +0,0 @@
-using System;
-using System.Text;
-using log4net;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.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/Final/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase3BasicPubSub.cs b/Final/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase3BasicPubSub.cs
deleted file mode 100644
index 937730576d..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/interop/TestCases/TestCase3BasicPubSub.cs
+++ /dev/null
@@ -1,224 +0,0 @@
-using System;
-using System.Text;
-using log4net;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.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/Final/dotnet/Qpid.Client.Tests/interop/TestClient.cs b/Final/dotnet/Qpid.Client.Tests/interop/TestClient.cs
deleted file mode 100644
index 3edd28a892..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/interop/TestClient.cs
+++ /dev/null
@@ -1,358 +0,0 @@
-using System;
-using System.Collections;
-using System.Text;
-using System.Threading;
-using Apache.Qpid.Messaging;
-using Apache.Qpid.Client.Qms;
-using log4net;
-using Apache.Qpid.Client.Tests.interop.TestCases;
-
-namespace Apache.Qpid.Client.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/Final/dotnet/Qpid.Client.Tests/interop/TopicListener.cs b/Final/dotnet/Qpid.Client.Tests/interop/TopicListener.cs
deleted file mode 100644
index 13141d52b8..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client.Tests/interop/TopicPublisher.cs b/Final/dotnet/Qpid.Client.Tests/interop/TopicPublisher.cs
deleted file mode 100644
index ef5d39f0bc..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/interop/TopicPublisher.cs
+++ /dev/null
@@ -1,188 +0,0 @@
-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/Final/dotnet/Qpid.Client.Tests/lib/nunit/nunit-licence.txt b/Final/dotnet/Qpid.Client.Tests/lib/nunit/nunit-licence.txt
deleted file mode 100644
index b2316295d3..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client.Tests/lib/nunit/nunit.framework.dll b/Final/dotnet/Qpid.Client.Tests/lib/nunit/nunit.framework.dll
deleted file mode 100644
index 53666e74c9..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/lib/nunit/nunit.framework.dll
+++ /dev/null
Binary files differ
diff --git a/Final/dotnet/Qpid.Client.Tests/log4net.config b/Final/dotnet/Qpid.Client.Tests/log4net.config
deleted file mode 100644
index 8753c9c431..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/log4net.config
+++ /dev/null
@@ -1,48 +0,0 @@
-<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> \ No newline at end of file
diff --git a/Final/dotnet/Qpid.Client.Tests/requestreply1/ServiceProvidingClient.cs b/Final/dotnet/Qpid.Client.Tests/requestreply1/ServiceProvidingClient.cs
deleted file mode 100644
index cbc93ae2fe..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/requestreply1/ServiceProvidingClient.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.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.Tests
-{
- [TestFixture]
- 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/Final/dotnet/Qpid.Client.Tests/requestreply1/ServiceRequestingClient.cs b/Final/dotnet/Qpid.Client.Tests/requestreply1/ServiceRequestingClient.cs
deleted file mode 100644
index f35fb2dac9..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/requestreply1/ServiceRequestingClient.cs
+++ /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.Client.Tests
-{
- 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/Final/dotnet/Qpid.Client.Tests/undeliverable/UndeliverableTest.cs b/Final/dotnet/Qpid.Client.Tests/undeliverable/UndeliverableTest.cs
deleted file mode 100644
index bcf57e586e..0000000000
--- a/Final/dotnet/Qpid.Client.Tests/undeliverable/UndeliverableTest.cs
+++ /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 System;
-using System.Threading;
-using log4net;
-using NUnit.Framework;
-using Apache.Qpid.Messaging;
-
-namespace Apache.Qpid.Client.Tests
-{
- /// <summary>
- /// Tests that when sending undeliverable messages with the
- /// mandatory flag set, an exception is raised on the connection
- /// as the message is bounced back by the broker
- /// </summary>
- [TestFixture]
- public class UndeliverableTest : BaseMessagingTestFixture
- {
- private static ILog _logger = LogManager.GetLogger(typeof(UndeliverableTest));
- private ManualResetEvent _event;
- public const int TIMEOUT = 1000;
- private Exception _lastException;
-
- [SetUp]
- public override void Init()
- {
- base.Init();
- _event = new ManualResetEvent(false);
- _lastException = null;
-
- try
- {
- _connection.ExceptionListener = new ExceptionListenerDelegate(OnException);
- } catch ( QpidException e )
- {
- _logger.Error("Could not add ExceptionListener", e);
- }
- }
-
- public void OnException(Exception e)
- {
- // Here we dig out the AMQUndelivered exception (if present) in order to log the returned message.
-
- _lastException = e;
- _logger.Error("OnException handler received connection-level exception", e);
- if ( e is QpidException )
- {
- QpidException qe = (QpidException)e;
- if ( qe.InnerException is AMQUndeliveredException )
- {
- AMQUndeliveredException ue = (AMQUndeliveredException)qe.InnerException;
- _logger.Error("inner exception is AMQUndeliveredException", ue);
- _logger.Error(string.Format("Returned message = {0}", ue.GetUndeliveredMessage()));
- }
- }
- _event.Set();
- }
-
- [Test]
- public void SendUndeliverableMessageOnDefaultExchange()
- {
- SendOne("default exchange", null);
- }
- [Test]
- public void SendUndeliverableMessageOnDirectExchange()
- {
- SendOne("direct exchange", ExchangeNameDefaults.DIRECT);
- }
- [Test]
- public void SendUndeliverableMessageOnTopicExchange()
- {
- SendOne("topic exchange", ExchangeNameDefaults.TOPIC);
- }
- [Test]
- public void SendUndeliverableMessageOnHeadersExchange()
- {
- SendOne("headers exchange", ExchangeNameDefaults.HEADERS);
- }
-
- private void SendOne(string exchangeNameFriendly, string exchangeName)
- {
- _logger.Info("Sending undeliverable message to " + exchangeNameFriendly);
-
- // Send a test message to a non-existant queue
- // on the specified exchange. See if message is returned!
- MessagePublisherBuilder builder = _channel.CreatePublisherBuilder()
- .WithRoutingKey("Non-existant route key!")
- .WithMandatory(true); // necessary so that the server bounces the message back
- if ( exchangeName != null )
- {
- builder.WithExchangeName(exchangeName);
- }
- IMessagePublisher publisher = builder.Create();
- publisher.Send(_channel.CreateTextMessage("Hiya!"));
-
- // check we received an exception on the connection
- // and that it is of the right type
- _event.WaitOne(TIMEOUT, true);
-
- Type expectedException = typeof(AMQUndeliveredException);
- Exception ex = _lastException;
- Assert.IsNotNull(ex, "No exception was thrown by the test. Expected " + expectedException);
-
- if ( ex.InnerException != null )
- ex = ex.InnerException;
-
- Assert.IsInstanceOfType(expectedException, ex);
- }
- }
-}
diff --git a/Final/dotnet/Qpid.Client.Tests/url/ConnectionUrlTest.cs b/Final/dotnet/Qpid.Client.Tests/url/ConnectionUrlTest.cs
deleted file mode 100644
index 3c9f8dd4e2..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketProcessor.cs b/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketProcessor.cs
deleted file mode 100644
index badaa48111..0000000000
--- a/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketProcessor.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.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);
-
- 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);
- }
- }
-
- 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);
-
- 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/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketTransport.cs b/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/BlockingSocketTransport.cs
deleted file mode 100644
index 17f911fb6d..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/ByteChannel.cs b/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/ByteChannel.cs
deleted file mode 100644
index 19da2fceb9..0000000000
--- a/Final/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("Qpid.Client.ByteChannel.Tracing");
-
- 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/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/Properties/AssemblyInfo.cs b/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/Properties/AssemblyInfo.cs
deleted file mode 100644
index 00f366b5a9..0000000000
--- a/Final/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("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Qpid")]
-[assembly: AssemblyProduct("Apache.Qpid.Transport.Blocking")]
-[assembly: AssemblyCopyright("Copyright (c) 2006 The 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("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.csproj b/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.csproj
deleted file mode 100644
index a12b6695e2..0000000000
--- a/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.csproj
+++ /dev/null
@@ -1,71 +0,0 @@
-<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/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.mdp b/Final/dotnet/Qpid.Client.Transport.Socket.Blocking/Qpid.Client.Transport.Socket.Blocking.mdp
deleted file mode 100644
index 8f95000a4a..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/AMQAuthenticationException.cs b/Final/dotnet/Qpid.Client/Client/AMQAuthenticationException.cs
deleted file mode 100644
index 6382eaaf39..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/AMQConnection.cs b/Final/dotnet/Qpid.Client/Client/AMQConnection.cs
deleted file mode 100644
index d74cf6b5e4..0000000000
--- a/Final/dotnet/Qpid.Client/Client/AMQConnection.cs
+++ /dev/null
@@ -1,889 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR 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 { 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 (_failoverPolicy.FailoverAllowed());
-
- _log.Debug("Are we connected:" + _connected);
-
- if (!_failoverPolicy.FailoverAllowed())
- {
- if ( lastException is AMQException )
- throw lastException;
- else
- throw new AMQConnectionException("Unable to connect", lastException);
- }
-
- // TODO: this needs to be redone so that we are not spinning.
- // A suitable object should be set that is then waited on
- // and only notified when a connection is made or when
- // the AMQConnection gets closed.
- while (!_connected && !Closed)
- {
- _log.Debug("Sleeping.");
- Thread.Sleep(100);
- }
- if (!_failoverPolicy.FailoverAllowed() || _failoverPolicy.GetCurrentBrokerInfo() == null)
- {
- if (_lastAMQException != null)
- {
- throw _lastAMQException;
- }
- }
- }
-
- /*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");
-
- _stateManager.AttainState(AMQState.CONNECTION_CLOSED);
- 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, (uint)prefetchHigh, 0, 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/Final/dotnet/Qpid.Client/Client/AMQConnectionException.cs b/Final/dotnet/Qpid.Client/Client/AMQConnectionException.cs
deleted file mode 100644
index c8a48814bb..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/AMQDestination.cs b/Final/dotnet/Qpid.Client/Client/AMQDestination.cs
deleted file mode 100644
index 07ce3c2354..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/AMQNoConsumersException.cs b/Final/dotnet/Qpid.Client/Client/AMQNoConsumersException.cs
deleted file mode 100644
index 0d93176734..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/AMQNoRouteException.cs b/Final/dotnet/Qpid.Client/Client/AMQNoRouteException.cs
deleted file mode 100644
index bde3cdd989..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs b/Final/dotnet/Qpid.Client/Client/AmqBrokerInfo.cs
deleted file mode 100644
index 591c5b941f..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/AmqChannel.cs b/Final/dotnet/Qpid.Client/Client/AmqChannel.cs
deleted file mode 100644
index 84f08729dd..0000000000
--- a/Final/dotnet/Qpid.Client/Client/AmqChannel.cs
+++ /dev/null
@@ -1,1009 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR 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
-{
- public class AmqChannel : Closeable, IChannel
- {
- private static readonly ILog _logger = LogManager.GetLogger(typeof(AmqChannel));
-
- internal const int BASIC_CONTENT_TYPE = 60;
-
- private static int _nextSessionNumber = 0;
-
- 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;
-
- public const int DEFAULT_PREFETCH_HIGH_MARK = 5000;
- public const int DEFAULT_PREFETCH_LOW_MARK = 2500;
-
- private AMQConnection _connection;
-
- 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>
- /// Set of all producers created by this session
- /// </summary>
- private Hashtable _producers = Hashtable.Synchronized(new Hashtable());
-
- /// <summary>
- /// Maps from consumer tag to JMSMessageConsumer instance
- /// </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>
- /// Responsible for decoding a message fragment and passing it to the appropriate message consumer.
- /// </summary>
- private class Dispatcher
- {
- private int _stopped = 0;
-
- private AmqChannel _containingChannel;
-
- public Dispatcher(AmqChannel containingChannel)
- {
- _containingChannel = containingChannel;
- }
-
- /// <summary>
- /// Runs the dispatcher. This is intended to be Run in a separate thread.
- /// </summary>
- public void RunDispatcher()
- {
- UnprocessedMessage message;
-
- while (_stopped == 0 && (message = (UnprocessedMessage)_containingChannel._queue.Dequeue()) != null)
- {
- //_queue.size()
- DispatchMessage(message);
- }
-
- _logger.Debug("Dispatcher thread terminating for channel " + _containingChannel._channelId);
- }
-
- private void DispatchMessage(UnprocessedMessage message)
- {
- 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 mina 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);
- }
- }
- }
-
- public void StopDispatcher()
- {
- Interlocked.Exchange(ref _stopped, 1);
- }
- }
-
- /// <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>
- /// 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 IBytesMessage CreateBytesMessage()
- {
- return (IBytesMessage)_messageFactoryRegistry.CreateMessage("application/octet-stream");
- }
-
- public IMessage CreateMessage()
- {
- // TODO: this is supposed to create a message consisting only of message headers
- return (IBytesMessage)_messageFactoryRegistry.CreateMessage("application/octet-stream");
- }
-
- public IMessage CreateMessage(string mimeType)
- {
- return _messageFactoryRegistry.CreateMessage(mimeType);
- }
-
- public ITextMessage CreateTextMessage()
- {
- return CreateTextMessage(String.Empty);
- }
-
- public ITextMessage CreateTextMessage(string text)
- {
- ITextMessage msg = (ITextMessage)_messageFactoryRegistry.CreateMessage("text/plain");
- msg.Text = text;
- return msg;
- }
-
- public bool Transacted
- {
- get
- {
- CheckNotClosed();
- return _transacted;
- }
- }
-
- public AcknowledgeMode AcknowledgeMode
- {
- get
- {
- CheckNotClosed();
- return _acknowledgeMode;
- }
- }
-
- 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.AcknowledgeLastDelivered();
- }
-
- // 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);
- }
- }
-
- public void Rollback()
- {
- lock ( _suspensionLock )
- {
- CheckTransacted(); // throws IllegalOperationException if not a transacted session
-
- try
- {
- bool suspended = IsSuspended;
- if ( !suspended )
- Suspend(true);
-
- // todo: rollback dispatcher when TX support is added
- //if ( _dispatcher != null )
- // _dispatcher.Rollback();
-
- _connection.ConvenientProtocolWriter.SyncWrite(
- TxRollbackBody.CreateAMQFrame(_channelId), typeof(TxRollbackOkBody));
-
- if ( !suspended )
- Suspend(false);
- } catch ( AMQException e )
- {
- throw new QpidException("Failed to rollback", e);
- }
- }
- }
-
- 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);
- }
- }
- }
- }
-
- 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);
- }
- }
-
- /**
- * 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);
- }
- }
-
- /// <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
- }
-
- public void Recover()
- {
- CheckNotClosed();
- CheckNotTransacted(); // throws IllegalOperationException if not a transacted session
-
- // TODO: This cannot be implemented using 0.8 semantics
- throw new NotImplementedException();
- }
-
- public void Run()
- {
- throw new NotImplementedException();
- }
-
- 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);
- }
-
- public 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);
- }
- }
- }
-
- public IMessageConsumer CreateConsumer(string queueName,
- int prefetchLow,
- int prefetchHigh,
- bool noLocal,
- bool exclusive,
- bool durable,
- string subscriptionName)
- {
- _logger.Debug(String.Format("CreateConsumer queueName={0} prefetchLow={1} prefetchHigh={2} noLocal={3} exclusive={4} durable={5} subscriptionName={6}",
- queueName, prefetchLow, prefetchHigh, noLocal, exclusive, durable, subscriptionName));
- return CreateConsumerImpl(queueName, prefetchLow, prefetchHigh, noLocal, exclusive, durable, subscriptionName);
- }
-
- private IMessageConsumer CreateConsumerImpl(string queueName,
- int prefetchLow,
- int prefetchHigh,
- bool noLocal,
- bool exclusive,
- bool durable,
- string subscriptionName)
- {
- if (durable || subscriptionName != null)
- {
- throw new NotImplementedException(); // TODO: durable subscriptions.
- }
-
- 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;
- }
- }
-
- public void Unsubscribe(String name)
- {
- throw new NotImplementedException(); // FIXME
- }
-
- private void CheckTransacted()
- {
- if (!Transacted)
- {
- throw new InvalidOperationException("Channel is not transacted");
- }
- }
-
- private void CheckNotTransacted()
- {
- if (Transacted)
- {
- throw new InvalidOperationException("Channel is transacted");
- }
- }
-
- 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 int DefaultPrefetch
- {
- get { return DefaultPrefetchHigh; }
- }
- public int DefaultPrefetchLow
- {
- get { return _defaultPrefetchLowMark; }
- }
- public int DefaultPrefetchHigh
- {
- get { return _defaultPrefetchHighMark; }
- }
- public bool IsSuspended
- {
- get { return _suspended; }
- }
-
- public ushort ChannelId
- {
- get
- {
- return _channelId;
- }
- }
-
- public AMQConnection Connection
- {
- get
- {
- return _connection;
- }
- }
-
- 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;
- }
-
- public void Dispose()
- {
- Close();
- }
-
- /**
- * 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
- }
-
- public void PurgeQueue(string queueName, bool noWait)
- {
- DoPurgeQueue(queueName, noWait);
- }
-
- 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>
- void RegisterConsumer(BasicMessageConsumer consumer)
- {
- String consumerTag = ConsumeFromQueue(consumer.QueueName, consumer.NoLocal,
- consumer.Exclusive, consumer.AcknowledgeMode);
- consumer.ConsumerTag = consumerTag;
- _consumers.Add(consumerTag, consumer);
- }
-
- public void Bind(string queueName, string exchangeName, string routingKey, IFieldTable args)
- {
- DoBind(queueName, exchangeName, routingKey, (FieldTable)args);
- }
-
- public void Bind(string queueName, string exchangeName, string routingKey)
- {
- DoBind(queueName, exchangeName, routingKey, new FieldTable());
- }
-
- 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, true, args);
- _replayFrames.Add(queueBind);
-
- lock (_connection.FailoverMutex)
- {
- _connection.ProtocolWriter.Write(queueBind);
- }
- }
-
- private String ConsumeFromQueue(String queueName, bool noLocal, bool exclusive, AcknowledgeMode acknowledgeMode)
- {
- // Need to generate a consumer tag on the client so we can exploit the nowait flag.
- String tag = string.Format("{0}-{1}", _sessionNumber, _nextConsumerNumber++);
-
- 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;
- }
-
- public void DeleteExchange(string exchangeName)
- {
- throw new NotImplementedException(); // FIXME
- }
-
- public void DeleteQueue(string queueName, bool ifUnused, bool ifEmpty, bool noWait)
- {
- DoDeleteQueue(queueName, ifUnused, ifEmpty, noWait);
- }
-
- 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, // queueName
- ifUnused, // IfUnUsed
- ifEmpty, // IfEmpty
- noWait); // NoWait
-
- _replayFrames.Add(queueDelete);
-
- if (noWait)
- _connection.ProtocolWriter.Write(queueDelete);
- else
- _connection.ConvenientProtocolWriter.SyncWrite(queueDelete, typeof(QueueDeleteOkBody));
- }
- catch (AMQException)
- {
- throw;
- }
- }
-
- public MessageConsumerBuilder CreateConsumerBuilder(string queueName)
- {
- return new MessageConsumerBuilder(this, queueName);
- }
-
- public MessagePublisherBuilder CreatePublisherBuilder()
- {
- return new MessagePublisherBuilder(this);
- }
-
- public string GenerateUniqueName()
- {
- string result = _connection.ProtocolSession.GenerateQueueName();
- return Regex.Replace(result, "[^a-z0-9_]", "_");
- }
-
- public void DeclareQueue(string queueName, bool isDurable, bool isExclusive, bool isAutoDelete)
- {
- DoQueueDeclare(queueName, isDurable, isExclusive, isAutoDelete);
- }
-
- 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, true, null);
-
- _replayFrames.Add(queueDeclare);
-
- lock (_connection.FailoverMutex)
- {
- _connection.ProtocolWriter.Write(queueDeclare);
- }
- }
-
- 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);
- }
-
- // 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);
-
- _replayFrames.Add(declareExchange);
-
- if (noWait)
- {
- lock (_connection.FailoverMutex)
- {
- _connection.ProtocolWriter.Write(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);
- }
-
- /// <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));
- }
- }
-
- }
-}
diff --git a/Final/dotnet/Qpid.Client/Client/BasicMessageConsumer.cs b/Final/dotnet/Qpid.Client/Client/BasicMessageConsumer.cs
deleted file mode 100644
index fd4ff79505..0000000000
--- a/Final/dotnet/Qpid.Client/Client/BasicMessageConsumer.cs
+++ /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 System;
-using System.Threading;
-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;
-
- /**
- * We store the exclusive field in order to be able to reuse it when resubscribing in the event of failover
- */
- 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>
- /// 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;
- }
-
- #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()
- {
- // 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 AcknowledgeLastDelivered()
- {
- if (_lastDeliveryTag > 0)
- {
- _channel.AcknowledgeMessage((ulong)_lastDeliveryTag, true); // XXX evil cast
- _lastDeliveryTag = -1;
- }
- }
-
- 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:
- _lastDeliveryTag = msg.DeliveryTag;
- break;
- }
- }
-
- }
-}
diff --git a/Final/dotnet/Qpid.Client/Client/BasicMessageProducer.cs b/Final/dotnet/Qpid.Client/Client/BasicMessageProducer.cs
deleted file mode 100644
index ca6d2abee5..0000000000
--- a/Final/dotnet/Qpid.Client/Client/BasicMessageProducer.cs
+++ /dev/null
@@ -1,402 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR 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;
- 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/Final/dotnet/Qpid.Client/Client/Closeable.cs b/Final/dotnet/Qpid.Client/Client/Closeable.cs
deleted file mode 100644
index d70f75ee6b..0000000000
--- a/Final/dotnet/Qpid.Client/Client/Closeable.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;
-
-namespace Apache.Qpid.Client
-{
- public abstract class Closeable
- {
- /// <summary>
- /// Used to ensure orderly closing of the object. The only method that is allowed to be called
- /// from another thread of control is close().
- /// </summary>
- protected readonly object _closingLock = new object();
-
- /// <summary>
- /// All access to this field should be using the Inerlocked class, to make it atomic.
- /// Hence it is an int since you cannot use a bool with the Interlocked class.
- /// </summary>
- protected int _closed = NOT_CLOSED;
-
- protected const int CLOSED = 1;
- protected const int NOT_CLOSED = 2;
-
- /// <summary>
- /// Checks the not closed.
- /// </summary>
- protected void CheckNotClosed()
- {
- if (_closed == CLOSED)
- {
- throw new InvalidOperationException("Object " + ToString() + " has been closed");
- }
- }
-
- /// <summary>
- /// Gets a value indicating whether this <see cref="Closeable"/> is closed.
- /// </summary>
- /// <value><c>true</c> if closed; otherwise, <c>false</c>.</value>
- public bool Closed
- {
- get
- {
- return _closed == CLOSED;
- }
- }
-
- /// <summary>
- /// Close the resource
- /// </summary>
- /// <exception cref="QpidMessagingException">If something goes wrong</exception>
- public abstract void Close();
- }
-}
diff --git a/Final/dotnet/Qpid.Client/Client/Configuration/AuthenticationConfigurationSectionHandler.cs b/Final/dotnet/Qpid.Client/Client/Configuration/AuthenticationConfigurationSectionHandler.cs
deleted file mode 100644
index ae9225a53a..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/ConnectionTuneParameters.cs b/Final/dotnet/Qpid.Client/Client/ConnectionTuneParameters.cs
deleted file mode 100644
index b21486bfa8..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Failover/FailoverException.cs b/Final/dotnet/Qpid.Client/Client/Failover/FailoverException.cs
deleted file mode 100644
index 7013746414..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Failover/FailoverHandler.cs b/Final/dotnet/Qpid.Client/Client/Failover/FailoverHandler.cs
deleted file mode 100644
index 83c69b7d25..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Failover/FailoverState.cs b/Final/dotnet/Qpid.Client/Client/Failover/FailoverState.cs
deleted file mode 100644
index 3058cdcd69..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Failover/FailoverSupport.cs b/Final/dotnet/Qpid.Client/Client/Failover/FailoverSupport.cs
deleted file mode 100644
index afa5301f39..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Handler/BasicDeliverMethodHandler.cs b/Final/dotnet/Qpid.Client/Client/Handler/BasicDeliverMethodHandler.cs
deleted file mode 100644
index def1e78e8c..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Handler/BasicReturnMethodHandler.cs b/Final/dotnet/Qpid.Client/Client/Handler/BasicReturnMethodHandler.cs
deleted file mode 100644
index f413dfc9c6..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs b/Final/dotnet/Qpid.Client/Client/Handler/ChannelCloseMethodHandler.cs
deleted file mode 100644
index 9ed09a0d01..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Handler/ConnectionCloseMethodHandler.cs b/Final/dotnet/Qpid.Client/Client/Handler/ConnectionCloseMethodHandler.cs
deleted file mode 100644
index 66cff3bc65..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Handler/ConnectionCloseOkHandler.cs b/Final/dotnet/Qpid.Client/Client/Handler/ConnectionCloseOkHandler.cs
deleted file mode 100644
index 038da15731..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Handler/ConnectionOpenOkMethodHandler.cs b/Final/dotnet/Qpid.Client/Client/Handler/ConnectionOpenOkMethodHandler.cs
deleted file mode 100644
index a12e4ead60..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Handler/ConnectionRedirectMethodHandler.cs b/Final/dotnet/Qpid.Client/Client/Handler/ConnectionRedirectMethodHandler.cs
deleted file mode 100644
index 08cc580b17..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Handler/ConnectionSecureMethodHandler.cs b/Final/dotnet/Qpid.Client/Client/Handler/ConnectionSecureMethodHandler.cs
deleted file mode 100644
index 9333d4d0a6..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Handler/ConnectionStartMethodHandler.cs b/Final/dotnet/Qpid.Client/Client/Handler/ConnectionStartMethodHandler.cs
deleted file mode 100644
index 1710c19080..0000000000
--- a/Final/dotnet/Qpid.Client/Client/Handler/ConnectionStartMethodHandler.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.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();
- 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/Final/dotnet/Qpid.Client/Client/Handler/ConnectionTuneMethodHandler.cs b/Final/dotnet/Qpid.Client/Client/Handler/ConnectionTuneMethodHandler.cs
deleted file mode 100644
index 15a1d908b7..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Handler/QueueDeleteOkMethodHandler.cs b/Final/dotnet/Qpid.Client/Client/Handler/QueueDeleteOkMethodHandler.cs
deleted file mode 100644
index 7290d758f8..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Handler/QueuePurgeOkMethodHandler.cs b/Final/dotnet/Qpid.Client/Client/Handler/QueuePurgeOkMethodHandler.cs
deleted file mode 100644
index 8bde707b00..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Message/AMQMessage.cs b/Final/dotnet/Qpid.Client/Client/Message/AMQMessage.cs
deleted file mode 100644
index e58de2ab96..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Message/AMQMessageFactory.cs b/Final/dotnet/Qpid.Client/Client/Message/AMQMessageFactory.cs
deleted file mode 100644
index f352d62c11..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs b/Final/dotnet/Qpid.Client/Client/Message/AbstractQmsMessage.cs
deleted file mode 100644
index 34b47137e5..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Message/IMessageFactory.cs b/Final/dotnet/Qpid.Client/Client/Message/IMessageFactory.cs
deleted file mode 100644
index bed379290f..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Message/MessageFactoryRegistry.cs b/Final/dotnet/Qpid.Client/Client/Message/MessageFactoryRegistry.cs
deleted file mode 100644
index fdb5e14aa6..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs b/Final/dotnet/Qpid.Client/Client/Message/QpidBytesMessage.cs
deleted file mode 100644
index fb3efb1b0f..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Message/QpidBytesMessageFactory.cs b/Final/dotnet/Qpid.Client/Client/Message/QpidBytesMessageFactory.cs
deleted file mode 100644
index 3cc96cbddc..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Message/QpidHeaders.cs b/Final/dotnet/Qpid.Client/Client/Message/QpidHeaders.cs
deleted file mode 100644
index d27c1df853..0000000000
--- a/Final/dotnet/Qpid.Client/Client/Message/QpidHeaders.cs
+++ /dev/null
@@ -1,213 +0,0 @@
-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/Final/dotnet/Qpid.Client/Client/Message/QpidTextMessage.cs b/Final/dotnet/Qpid.Client/Client/Message/QpidTextMessage.cs
deleted file mode 100644
index 24aef92aa5..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs b/Final/dotnet/Qpid.Client/Client/Message/QpidTextMessageFactory.cs
deleted file mode 100644
index 79871e85ca..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs b/Final/dotnet/Qpid.Client/Client/Message/UnexpectedBodyReceivedException.cs
deleted file mode 100644
index 4317ef3474..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Message/UnprocessedMessage.cs b/Final/dotnet/Qpid.Client/Client/Message/UnprocessedMessage.cs
deleted file mode 100644
index d329712334..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Protocol/AMQMethodEvent.cs b/Final/dotnet/Qpid.Client/Client/Protocol/AMQMethodEvent.cs
deleted file mode 100644
index a7ce808862..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs b/Final/dotnet/Qpid.Client/Client/Protocol/AMQProtocolListener.cs
deleted file mode 100644
index c51538b70e..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Protocol/AMQProtocolSession.cs b/Final/dotnet/Qpid.Client/Client/Protocol/AMQProtocolSession.cs
deleted file mode 100644
index e0fa22e7a3..0000000000
--- a/Final/dotnet/Qpid.Client/Client/Protocol/AMQProtocolSession.cs
+++ /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.
- *
- */
-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;
-
- /**
- * Counter to ensure unique queue names
- */
- private int _queueId = 1;
- private readonly Object _queueIdLock = new Object();
-
- /// <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 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()
- {
- int id;
- lock(_queueIdLock)
- {
- id = _queueId++;
- }
-
- return "tmp_" + _connection.Transport.LocalEndpoint + "_" + id;
- }
- }
-}
diff --git a/Final/dotnet/Qpid.Client/Client/Protocol/DefaultTimeouts.cs b/Final/dotnet/Qpid.Client/Client/Protocol/DefaultTimeouts.cs
deleted file mode 100644
index 6841b46f54..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Protocol/IConnectionCloser.cs b/Final/dotnet/Qpid.Client/Client/Protocol/IConnectionCloser.cs
deleted file mode 100644
index e3298200c4..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Protocol/IProtocolListener.cs b/Final/dotnet/Qpid.Client/Client/Protocol/IProtocolListener.cs
deleted file mode 100644
index 3b53f015f8..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Protocol/Listener/BlockingMethodFrameListener.cs b/Final/dotnet/Qpid.Client/Client/Protocol/Listener/BlockingMethodFrameListener.cs
deleted file mode 100644
index 9cc9f8cee5..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Protocol/Listener/IAMQMethodListener.cs b/Final/dotnet/Qpid.Client/Client/Protocol/Listener/IAMQMethodListener.cs
deleted file mode 100644
index b5450d00f7..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Protocol/Listener/SpecificMethodFrameListener.cs b/Final/dotnet/Qpid.Client/Client/Protocol/Listener/SpecificMethodFrameListener.cs
deleted file mode 100644
index 8cdc1dbba9..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Protocol/ProtocolWriter.cs b/Final/dotnet/Qpid.Client/Client/Protocol/ProtocolWriter.cs
deleted file mode 100644
index 11918f1ea2..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/QpidConnectionInfo.cs b/Final/dotnet/Qpid.Client/Client/QpidConnectionInfo.cs
deleted file mode 100644
index ede8966f37..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Security/CallbackHandlerRegistry.cs b/Final/dotnet/Qpid.Client/Client/Security/CallbackHandlerRegistry.cs
deleted file mode 100644
index 85be927ff4..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Security/IAMQCallbackHandler.cs b/Final/dotnet/Qpid.Client/Client/Security/IAMQCallbackHandler.cs
deleted file mode 100644
index 2560c1d96b..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Security/UsernamePasswordCallbackHandler.cs b/Final/dotnet/Qpid.Client/Client/Security/UsernamePasswordCallbackHandler.cs
deleted file mode 100644
index 489d4d1665..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/SslOptions.cs b/Final/dotnet/Qpid.Client/Client/SslOptions.cs
deleted file mode 100644
index d637101000..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/State/AMQState.cs b/Final/dotnet/Qpid.Client/Client/State/AMQState.cs
deleted file mode 100644
index 67f8427fb2..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/State/AMQStateChangedEvent.cs b/Final/dotnet/Qpid.Client/Client/State/AMQStateChangedEvent.cs
deleted file mode 100644
index a464bbb6f5..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/State/AMQStateManager.cs b/Final/dotnet/Qpid.Client/Client/State/AMQStateManager.cs
deleted file mode 100644
index 881e01e697..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/State/IAMQStateListener.cs b/Final/dotnet/Qpid.Client/Client/State/IAMQStateListener.cs
deleted file mode 100644
index 31e4b5046d..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/State/IStateAwareMethodListener.cs b/Final/dotnet/Qpid.Client/Client/State/IStateAwareMethodListener.cs
deleted file mode 100644
index 0874f39665..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/State/IStateListener.cs b/Final/dotnet/Qpid.Client/Client/State/IStateListener.cs
deleted file mode 100644
index edd7382f93..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs b/Final/dotnet/Qpid.Client/Client/State/IllegalStateTransitionException.cs
deleted file mode 100644
index 81de622617..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/State/StateWaiter.cs b/Final/dotnet/Qpid.Client/Client/State/StateWaiter.cs
deleted file mode 100644
index e739d0cb44..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Transport/AMQProtocolProvider.cs b/Final/dotnet/Qpid.Client/Client/Transport/AMQProtocolProvider.cs
deleted file mode 100644
index dd0bb404cb..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Transport/AmqpChannel.cs b/Final/dotnet/Qpid.Client/Client/Transport/AmqpChannel.cs
deleted file mode 100644
index dc72846bbe..0000000000
--- a/Final/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("Qpid.Client.ProtocolChannel.Tracing");
-
- 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/Final/dotnet/Qpid.Client/Client/Transport/IByteChannel.cs b/Final/dotnet/Qpid.Client/Client/Transport/IByteChannel.cs
deleted file mode 100644
index 35806f2a6e..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Transport/IProtocolChannel.cs b/Final/dotnet/Qpid.Client/Client/Transport/IProtocolChannel.cs
deleted file mode 100644
index 0b59ee8799..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Transport/IProtocolWriter.cs b/Final/dotnet/Qpid.Client/Client/Transport/IProtocolWriter.cs
deleted file mode 100644
index 592dff3a19..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Transport/IStreamFilter.cs b/Final/dotnet/Qpid.Client/Client/Transport/IStreamFilter.cs
deleted file mode 100644
index 7195b3ab04..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Transport/ITransport.cs b/Final/dotnet/Qpid.Client/Client/Transport/ITransport.cs
deleted file mode 100644
index 693a9a9534..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Transport/IoHandler.cs b/Final/dotnet/Qpid.Client/Client/Transport/IoHandler.cs
deleted file mode 100644
index 9ac513069e..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Transport/ProtocolDecoderOutput.cs b/Final/dotnet/Qpid.Client/Client/Transport/ProtocolDecoderOutput.cs
deleted file mode 100644
index 357aab0f45..0000000000
--- a/Final/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("Qpid.Client.ProtocolChannel.Tracing");
-
- 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/Final/dotnet/Qpid.Client/Client/Transport/SingleProtocolEncoderOutput.cs b/Final/dotnet/Qpid.Client/Client/Transport/SingleProtocolEncoderOutput.cs
deleted file mode 100644
index a1aa889ba0..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/BlockingSocketTransport.cs b/Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/BlockingSocketTransport.cs
deleted file mode 100644
index 8a16f9a675..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ByteChannel.cs b/Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ByteChannel.cs
deleted file mode 100644
index 077f69541f..0000000000
--- a/Final/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("Qpid.Client.ByteChannel.Tracing");
-
- 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/Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ISocketConnector.cs b/Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/ISocketConnector.cs
deleted file mode 100644
index 3d5d2898cf..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SocketConnector.cs b/Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SocketConnector.cs
deleted file mode 100644
index 83f7287e9b..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SslSocketConnector.cs b/Final/dotnet/Qpid.Client/Client/Transport/Socket/Blocking/SslSocketConnector.cs
deleted file mode 100644
index 708edde48c..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Client/Util/FlowControlQueue.cs b/Final/dotnet/Qpid.Client/Client/Util/FlowControlQueue.cs
deleted file mode 100644
index 87bb2a2859..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/Properties/AssemblyInfo.cs b/Final/dotnet/Qpid.Client/Properties/AssemblyInfo.cs
deleted file mode 100644
index 8722a02db9..0000000000
--- a/Final/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("Qpid Client API implementation")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Qpid")]
-[assembly: AssemblyProduct("Apache.Qpid.Client")]
-[assembly: AssemblyCopyright("Copyright (c) 2006 The 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("0.5.*")]
diff --git a/Final/dotnet/Qpid.Client/Qpid.Client.csproj b/Final/dotnet/Qpid.Client/Qpid.Client.csproj
deleted file mode 100644
index 9294d76764..0000000000
--- a/Final/dotnet/Qpid.Client/Qpid.Client.csproj
+++ /dev/null
@@ -1,163 +0,0 @@
-<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>{68987C05-3768-452C-A6FC-6BA1D372852F}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Client</RootNamespace>
- <AssemblyName>Apache.Qpid.Client</AssemblyName>
- </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="Client\AmqBrokerInfo.cs" />
- <Compile Include="Client\AMQConnection.cs" />
- <Compile Include="Client\AMQConnectionException.cs" />
- <Compile Include="Client\AMQDestination.cs" />
- <Compile Include="Client\AmqChannel.cs" />
- <Compile Include="Client\AMQAuthenticationException.cs" />
- <Compile Include="Client\AMQNoConsumersException.cs" />
- <Compile Include="Client\AMQNoRouteException.cs" />
- <Compile Include="Client\Configuration\AuthenticationConfigurationSectionHandler.cs" />
- <Compile Include="Client\Handler\QueueDeleteOkMethodHandler.cs" />
- <Compile Include="Client\Handler\QueuePurgeOkMethodHandler.cs" />
- <Compile Include="Client\Protocol\DefaultTimeouts.cs" />
- <Compile Include="Client\SslOptions.cs" />
- <Compile Include="Client\Message\QpidHeaders.cs" />
- <Compile Include="Client\QpidConnectionInfo.cs" />
- <Compile Include="Client\BasicMessageConsumer.cs" />
- <Compile Include="Client\BasicMessageProducer.cs" />
- <Compile Include="Client\Closeable.cs" />
- <Compile Include="Client\ConnectionTuneParameters.cs" />
- <Compile Include="Client\Failover\FailoverException.cs" />
- <Compile Include="Client\Failover\FailoverHandler.cs" />
- <Compile Include="Client\Failover\FailoverState.cs" />
- <Compile Include="Client\Failover\FailoverSupport.cs" />
- <Compile Include="Client\Handler\BasicDeliverMethodHandler.cs" />
- <Compile Include="Client\Handler\BasicReturnMethodHandler.cs" />
- <Compile Include="Client\Handler\ChannelCloseMethodHandler.cs" />
- <Compile Include="Client\Handler\ConnectionCloseMethodHandler.cs" />
- <Compile Include="Client\Handler\ConnectionCloseOkHandler.cs" />
- <Compile Include="Client\Handler\ConnectionOpenOkMethodHandler.cs" />
- <Compile Include="Client\Handler\ConnectionRedirectMethodHandler.cs" />
- <Compile Include="Client\Handler\ConnectionSecureMethodHandler.cs" />
- <Compile Include="Client\Handler\ConnectionStartMethodHandler.cs" />
- <Compile Include="Client\Handler\ConnectionTuneMethodHandler.cs" />
- <Compile Include="Client\Message\AbstractQmsMessage.cs" />
- <Compile Include="Client\Message\AMQMessage.cs" />
- <Compile Include="Client\Message\AMQMessageFactory.cs" />
- <Compile Include="Client\Message\IMessageFactory.cs" />
- <Compile Include="Client\Message\MessageFactoryRegistry.cs" />
- <Compile Include="Client\Message\UnexpectedBodyReceivedException.cs" />
- <Compile Include="Client\Message\UnprocessedMessage.cs" />
- <Compile Include="Client\Message\QpidBytesMessage.cs" />
- <Compile Include="Client\Message\QpidBytesMessageFactory.cs" />
- <Compile Include="Client\Message\QpidTextMessage.cs" />
- <Compile Include="Client\Message\QpidTextMessageFactory.cs" />
- <Compile Include="Client\Protocol\AMQMethodEvent.cs" />
- <Compile Include="Client\Protocol\AMQProtocolListener.cs" />
- <Compile Include="Client\Protocol\AMQProtocolSession.cs" />
- <Compile Include="Client\Protocol\Listener\BlockingMethodFrameListener.cs" />
- <Compile Include="Client\Protocol\Listener\IAMQMethodListener.cs" />
- <Compile Include="Client\Protocol\IConnectionCloser.cs" />
- <Compile Include="Client\Protocol\ProtocolWriter.cs" />
- <Compile Include="Client\Protocol\IProtocolListener.cs" />
- <Compile Include="Client\Security\CallbackHandlerRegistry.cs" />
- <Compile Include="Client\Security\IAMQCallbackHandler.cs" />
- <Compile Include="Client\Security\UsernamePasswordCallbackHandler.cs" />
- <Compile Include="Client\State\AMQState.cs" />
- <Compile Include="Client\State\AMQStateChangedEvent.cs" />
- <Compile Include="Client\State\AMQStateManager.cs" />
- <Compile Include="Client\State\IAMQStateListener.cs" />
- <Compile Include="Client\State\IllegalStateTransitionException.cs" />
- <Compile Include="Client\State\IStateAwareMethodListener.cs" />
- <Compile Include="Client\State\IStateListener.cs" />
- <Compile Include="Client\Protocol\Listener\SpecificMethodFrameListener.cs" />
- <Compile Include="Client\State\StateWaiter.cs" />
- <Compile Include="Client\Transport\AmqpChannel.cs" />
- <Compile Include="Client\Transport\AMQProtocolProvider.cs" />
- <Compile Include="Client\Transport\IStreamFilter.cs" />
- <Compile Include="Client\Transport\IoHandler.cs" />
- <Compile Include="Client\Transport\IByteChannel.cs" />
- <Compile Include="Client\Transport\IProtocolChannel.cs" />
- <Compile Include="Client\Transport\IProtocolWriter.cs" />
- <Compile Include="Client\Transport\ITransport.cs" />
- <Compile Include="Client\Transport\ProtocolDecoderOutput.cs" />
- <Compile Include="Client\Transport\SingleProtocolEncoderOutput.cs" />
- <Compile Include="Client\Transport\Socket\Blocking\BlockingSocketTransport.cs" />
- <Compile Include="Client\Transport\Socket\Blocking\ByteChannel.cs" />
- <Compile Include="Client\Transport\Socket\Blocking\SslSocketConnector.cs" />
- <Compile Include="Client\Transport\Socket\Blocking\SocketConnector.cs" />
- <Compile Include="Client\Transport\Socket\Blocking\ISocketConnector.cs" />
- <Compile Include="Client\Util\FlowControlQueue.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="qms\BrokerInfo.cs" />
- <Compile Include="qms\ConnectionInfo.cs" />
- <Compile Include="qms\FailoverPolicy.cs" />
- <Compile Include="qms\failover\FailoverMethod.cs" />
- <Compile Include="qms\failover\FailoverRoundRobin.cs" />
- <Compile Include="qms\failover\FailoverSingleServer.cs" />
- <Compile Include="qms\UrlSyntaxException.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/Final/dotnet/Qpid.Client/default.build b/Final/dotnet/Qpid.Client/default.build
deleted file mode 100644
index 14e457203e..0000000000
--- a/Final/dotnet/Qpid.Client/default.build
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<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/Final/dotnet/Qpid.Client/qms/BrokerInfo.cs b/Final/dotnet/Qpid.Client/qms/BrokerInfo.cs
deleted file mode 100644
index 93c00af6e0..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/qms/ConnectionInfo.cs b/Final/dotnet/Qpid.Client/qms/ConnectionInfo.cs
deleted file mode 100644
index 4d3f7698b5..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/qms/FailoverPolicy.cs b/Final/dotnet/Qpid.Client/qms/FailoverPolicy.cs
deleted file mode 100644
index 179a695bf9..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/qms/UrlSyntaxException.cs b/Final/dotnet/Qpid.Client/qms/UrlSyntaxException.cs
deleted file mode 100644
index ab3de325d4..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/qms/failover/FailoverMethod.cs b/Final/dotnet/Qpid.Client/qms/failover/FailoverMethod.cs
deleted file mode 100644
index f32b275e84..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/qms/failover/FailoverRoundRobin.cs b/Final/dotnet/Qpid.Client/qms/failover/FailoverRoundRobin.cs
deleted file mode 100644
index 8103940fb4..0000000000
--- a/Final/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/Final/dotnet/Qpid.Client/qms/failover/FailoverSingleServer.cs b/Final/dotnet/Qpid.Client/qms/failover/FailoverSingleServer.cs
deleted file mode 100644
index 5e502b897e..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs b/Final/dotnet/Qpid.Codec/CumulativeProtocolDecoder.cs
deleted file mode 100644
index 6cfd75c851..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/Demux/DemuxingProtocolCodecFactory.cs b/Final/dotnet/Qpid.Codec/Demux/DemuxingProtocolCodecFactory.cs
deleted file mode 100644
index 78276202d6..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/Demux/IMessageDecoder.cs b/Final/dotnet/Qpid.Codec/Demux/IMessageDecoder.cs
deleted file mode 100644
index 5892673440..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs b/Final/dotnet/Qpid.Codec/Demux/IMessageDecoderFactory.cs
deleted file mode 100644
index 9e333d670f..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/Demux/IMessageEncoder.cs b/Final/dotnet/Qpid.Codec/Demux/IMessageEncoder.cs
deleted file mode 100644
index 75ae23592b..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs b/Final/dotnet/Qpid.Codec/Demux/IMessageEncoderFactory.cs
deleted file mode 100644
index 3001d1a963..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/Demux/MessageDecoderResult.cs b/Final/dotnet/Qpid.Codec/Demux/MessageDecoderResult.cs
deleted file mode 100644
index ab01864bc0..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/IProtocolCodecFactory.cs b/Final/dotnet/Qpid.Codec/IProtocolCodecFactory.cs
deleted file mode 100644
index a26b91b16c..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/IProtocolDecoder.cs b/Final/dotnet/Qpid.Codec/IProtocolDecoder.cs
deleted file mode 100644
index 3cccb0f7da..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/IProtocolDecoderOutput.cs b/Final/dotnet/Qpid.Codec/IProtocolDecoderOutput.cs
deleted file mode 100644
index 77a1aea9db..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/IProtocolEncoder.cs b/Final/dotnet/Qpid.Codec/IProtocolEncoder.cs
deleted file mode 100644
index a16f2ad9d6..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/IProtocolEncoderOutput.cs b/Final/dotnet/Qpid.Codec/IProtocolEncoderOutput.cs
deleted file mode 100644
index 70f9be38dc..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/Properties/AssemblyInfo.cs b/Final/dotnet/Qpid.Codec/Properties/AssemblyInfo.cs
deleted file mode 100644
index aa1d6a662e..0000000000
--- a/Final/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("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Qpid")]
-[assembly: AssemblyProduct("Apache.Qpid.Codec")]
-[assembly: AssemblyCopyright("Copyright (c) 2006 The 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("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Final/dotnet/Qpid.Codec/ProtocolCodecException.cs b/Final/dotnet/Qpid.Codec/ProtocolCodecException.cs
deleted file mode 100644
index 49678d2c11..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/ProtocolDecoderException.cs b/Final/dotnet/Qpid.Codec/ProtocolDecoderException.cs
deleted file mode 100644
index 8e7e6da145..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/ProtocolEncoderException.cs b/Final/dotnet/Qpid.Codec/ProtocolEncoderException.cs
deleted file mode 100644
index ac565a308b..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/Qpid.Codec.csproj b/Final/dotnet/Qpid.Codec/Qpid.Codec.csproj
deleted file mode 100644
index ebe4681397..0000000000
--- a/Final/dotnet/Qpid.Codec/Qpid.Codec.csproj
+++ /dev/null
@@ -1,73 +0,0 @@
-<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>{22D0D0C2-77AF-4DE3-B456-7FF3893F9F88}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Codec</RootNamespace>
- <AssemblyName>Apache.Qpid.Codec</AssemblyName>
- </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="CumulativeProtocolDecoder.cs" />
- <Compile Include="Demux\DemuxingProtocolCodecFactory.cs" />
- <Compile Include="Demux\IMessageDecoder.cs" />
- <Compile Include="Demux\IMessageDecoderFactory.cs" />
- <Compile Include="Demux\IMessageEncoder.cs" />
- <Compile Include="Demux\IMessageEncoderFactory.cs" />
- <Compile Include="Demux\MessageDecoderResult.cs" />
- <Compile Include="IProtocolCodecFactory.cs" />
- <Compile Include="IProtocolDecoder.cs" />
- <Compile Include="IProtocolDecoderOutput.cs" />
- <Compile Include="IProtocolEncoder.cs" />
- <Compile Include="IProtocolEncoderOutput.cs" />
- <Compile Include="ProtocolCodecException.cs" />
- <Compile Include="ProtocolDecoderException.cs" />
- <Compile Include="ProtocolEncoderException.cs" />
- <Compile Include="Support\SimpleProtocolDecoderOutput.cs" />
- <Compile Include="Support\SimpleProtocolEncoderOutput.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>
- </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/Final/dotnet/Qpid.Codec/Support/SimpleProtocolDecoderOutput.cs b/Final/dotnet/Qpid.Codec/Support/SimpleProtocolDecoderOutput.cs
deleted file mode 100644
index 0a4ff10ff0..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/Support/SimpleProtocolEncoderOutput.cs b/Final/dotnet/Qpid.Codec/Support/SimpleProtocolEncoderOutput.cs
deleted file mode 100644
index 2e4224ef98..0000000000
--- a/Final/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/Final/dotnet/Qpid.Codec/default.build b/Final/dotnet/Qpid.Codec/default.build
deleted file mode 100644
index db9e8d1166..0000000000
--- a/Final/dotnet/Qpid.Codec/default.build
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<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/Final/dotnet/Qpid.Common.Tests/Properties/AssemblyInfo.cs b/Final/dotnet/Qpid.Common.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index 32dcae60ae..0000000000
--- a/Final/dotnet/Qpid.Common.Tests/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-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("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Qpid")]
-[assembly: AssemblyProduct("Apache.Qpid.Common.Tests")]
-[assembly: AssemblyCopyright("Copyright (c) 2006 The 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("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Final/dotnet/Qpid.Common.Tests/Qpid.Common.Tests.csproj b/Final/dotnet/Qpid.Common.Tests/Qpid.Common.Tests.csproj
deleted file mode 100644
index b51faf92c7..0000000000
--- a/Final/dotnet/Qpid.Common.Tests/Qpid.Common.Tests.csproj
+++ /dev/null
@@ -1,65 +0,0 @@
-<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>{F83624B0-762B-4D82-900D-FF4C1B36E36E}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Tests</RootNamespace>
- <AssemblyName>Apache.Qpid.Common.Tests</AssemblyName>
- </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="Properties\AssemblyInfo.cs" />
- <Compile Include="Qpid\Collections\TestConsumerProducerQueue.cs" />
- <Compile Include="Qpid\Collections\TestLinkedHashtable.cs" />
- <Compile Include="Qpid\Framing\TestEncodingUtils.cs" />
- <Compile Include="Qpid\Framing\TestAMQType.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/Final/dotnet/Qpid.Common.Tests/Qpid/Collections/TestConsumerProducerQueue.cs b/Final/dotnet/Qpid.Common.Tests/Qpid/Collections/TestConsumerProducerQueue.cs
deleted file mode 100644
index 03ed999999..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common.Tests/Qpid/Collections/TestLinkedHashtable.cs b/Final/dotnet/Qpid.Common.Tests/Qpid/Collections/TestLinkedHashtable.cs
deleted file mode 100644
index dbbc98a2e6..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common.Tests/Qpid/Framing/TestAMQType.cs b/Final/dotnet/Qpid.Common.Tests/Qpid/Framing/TestAMQType.cs
deleted file mode 100644
index ab4cb4409c..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common.Tests/Qpid/Framing/TestEncodingUtils.cs b/Final/dotnet/Qpid.Common.Tests/Qpid/Framing/TestEncodingUtils.cs
deleted file mode 100644
index 720d7697d3..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common.Tests/default.build b/Final/dotnet/Qpid.Common.Tests/default.build
deleted file mode 100644
index 00658bdbe2..0000000000
--- a/Final/dotnet/Qpid.Common.Tests/default.build
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<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/Final/dotnet/Qpid.Common/AMQChannelClosedException.cs b/Final/dotnet/Qpid.Common/AMQChannelClosedException.cs
deleted file mode 100644
index 98c6966cd1..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/AMQConnectionClosedException.cs b/Final/dotnet/Qpid.Common/AMQConnectionClosedException.cs
deleted file mode 100644
index 136131144b..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/AMQDisconnectedException.cs b/Final/dotnet/Qpid.Common/AMQDisconnectedException.cs
deleted file mode 100644
index b5c4d544cd..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/AMQException.cs b/Final/dotnet/Qpid.Common/AMQException.cs
deleted file mode 100644
index f9f7158a26..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/AMQInvalidArgumentException.cs b/Final/dotnet/Qpid.Common/AMQInvalidArgumentException.cs
deleted file mode 100644
index 0fb4ddae99..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/AMQInvalidRoutingKeyException.cs b/Final/dotnet/Qpid.Common/AMQInvalidRoutingKeyException.cs
deleted file mode 100644
index 3f8dead94d..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/AMQUndeliveredException.cs b/Final/dotnet/Qpid.Common/AMQUndeliveredException.cs
deleted file mode 100644
index 70ad86c8a3..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/AssemblySettings.cs b/Final/dotnet/Qpid.Common/AssemblySettings.cs
deleted file mode 100644
index 888de692e8..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Collections/BlockingQueue.cs b/Final/dotnet/Qpid.Common/Collections/BlockingQueue.cs
deleted file mode 100644
index dcfacf8474..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Collections/ConsumerProducerQueue.cs b/Final/dotnet/Qpid.Common/Collections/ConsumerProducerQueue.cs
deleted file mode 100644
index ea4526faaf..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Collections/LinkedBlockingQueue.cs b/Final/dotnet/Qpid.Common/Collections/LinkedBlockingQueue.cs
deleted file mode 100644
index be92576951..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Collections/LinkedHashtable.cs b/Final/dotnet/Qpid.Common/Collections/LinkedHashtable.cs
deleted file mode 100644
index 10ab5c674d..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Collections/SynchronousQueue.cs b/Final/dotnet/Qpid.Common/Collections/SynchronousQueue.cs
deleted file mode 100644
index 3c12df6067..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/AMQDataBlockDecoder.cs b/Final/dotnet/Qpid.Common/Framing/AMQDataBlockDecoder.cs
deleted file mode 100644
index 7867650e50..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/AMQDataBlockEncoder.cs b/Final/dotnet/Qpid.Common/Framing/AMQDataBlockEncoder.cs
deleted file mode 100644
index e2645c630e..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/AMQFrame.cs b/Final/dotnet/Qpid.Common/Framing/AMQFrame.cs
deleted file mode 100644
index 912be72d30..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/AMQFrameDecodingException.cs b/Final/dotnet/Qpid.Common/Framing/AMQFrameDecodingException.cs
deleted file mode 100644
index cda8c84ecf..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/AMQMethodBody.cs b/Final/dotnet/Qpid.Common/Framing/AMQMethodBody.cs
deleted file mode 100644
index a3c4337147..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/AMQMethodBodyFactory.cs b/Final/dotnet/Qpid.Common/Framing/AMQMethodBodyFactory.cs
deleted file mode 100644
index c1fd3f887a..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/AMQProtocolHeaderException.cs b/Final/dotnet/Qpid.Common/Framing/AMQProtocolHeaderException.cs
deleted file mode 100644
index 379e5d00ba..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/AMQType.cs b/Final/dotnet/Qpid.Common/Framing/AMQType.cs
deleted file mode 100644
index 618ab31d32..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/AMQTypeMap.cs b/Final/dotnet/Qpid.Common/Framing/AMQTypeMap.cs
deleted file mode 100644
index ed38c203a9..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/AMQTypedValue.cs b/Final/dotnet/Qpid.Common/Framing/AMQTypedValue.cs
deleted file mode 100644
index 8d21a60831..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/BasicContentHeaderProperties.cs b/Final/dotnet/Qpid.Common/Framing/BasicContentHeaderProperties.cs
deleted file mode 100644
index 47db7b0887..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/CompositeAMQDataBlock.cs b/Final/dotnet/Qpid.Common/Framing/CompositeAMQDataBlock.cs
deleted file mode 100644
index d2b7f606b2..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/ContentBody.cs b/Final/dotnet/Qpid.Common/Framing/ContentBody.cs
deleted file mode 100644
index 7a2142985d..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/ContentBodyFactory.cs b/Final/dotnet/Qpid.Common/Framing/ContentBodyFactory.cs
deleted file mode 100644
index 400b2aec08..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/ContentHeaderBody.cs b/Final/dotnet/Qpid.Common/Framing/ContentHeaderBody.cs
deleted file mode 100644
index 82889c23c8..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/ContentHeaderBodyFactory.cs b/Final/dotnet/Qpid.Common/Framing/ContentHeaderBodyFactory.cs
deleted file mode 100644
index c95a10871d..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/ContentHeaderPropertiesFactory.cs b/Final/dotnet/Qpid.Common/Framing/ContentHeaderPropertiesFactory.cs
deleted file mode 100644
index bac5d10fd4..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/EncodingUtils.cs b/Final/dotnet/Qpid.Common/Framing/EncodingUtils.cs
deleted file mode 100644
index 4d424656f9..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/FieldTable.cs b/Final/dotnet/Qpid.Common/Framing/FieldTable.cs
deleted file mode 100644
index 6567bf58ab..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/HeartbeatBody.cs b/Final/dotnet/Qpid.Common/Framing/HeartbeatBody.cs
deleted file mode 100644
index a8906f5ba8..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/HeartbeatBodyFactory.cs b/Final/dotnet/Qpid.Common/Framing/HeartbeatBodyFactory.cs
deleted file mode 100644
index 90e5c7768e..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/IBody.cs b/Final/dotnet/Qpid.Common/Framing/IBody.cs
deleted file mode 100644
index 97b4459e5c..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/IBodyFactory.cs b/Final/dotnet/Qpid.Common/Framing/IBodyFactory.cs
deleted file mode 100644
index dd7960ddbe..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/IContentHeaderProperties.cs b/Final/dotnet/Qpid.Common/Framing/IContentHeaderProperties.cs
deleted file mode 100644
index 676d0910d4..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/IDataBlock.cs b/Final/dotnet/Qpid.Common/Framing/IDataBlock.cs
deleted file mode 100644
index c61ed90d10..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/IEncodableAMQDataBlock.cs b/Final/dotnet/Qpid.Common/Framing/IEncodableAMQDataBlock.cs
deleted file mode 100644
index da8bf9fef9..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Framing/ProtocolInitiation.cs b/Final/dotnet/Qpid.Common/Framing/ProtocolInitiation.cs
deleted file mode 100644
index a9f5697144..0000000000
--- a/Final/dotnet/Qpid.Common/Framing/ProtocolInitiation.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 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/Final/dotnet/Qpid.Common/Properties/AssemblyInfo.cs b/Final/dotnet/Qpid.Common/Properties/AssemblyInfo.cs
deleted file mode 100644
index e876015bc3..0000000000
--- a/Final/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("Common AMQ Framing Code")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Qpid")]
-[assembly: AssemblyProduct("Apache.Qpid.Common")]
-[assembly: AssemblyCopyright("Copyright © J.P. Morgan Chase & Co. 2006")]
-[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("0.5.*")]
diff --git a/Final/dotnet/Qpid.Common/Protocol/AMQConstant.cs b/Final/dotnet/Qpid.Common/Protocol/AMQConstant.cs
deleted file mode 100644
index fcf94c29f4..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/Qpid.Common.csproj b/Final/dotnet/Qpid.Common/Qpid.Common.csproj
deleted file mode 100644
index d15c1887b7..0000000000
--- a/Final/dotnet/Qpid.Common/Qpid.Common.csproj
+++ /dev/null
@@ -1,213 +0,0 @@
-<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>{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>
- </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="AMQChannelClosedException.cs" />
- <Compile Include="AMQConnectionClosedException.cs" />
- <Compile Include="AMQDisconnectedException.cs" />
- <Compile Include="AMQException.cs" />
- <Compile Include="AMQInvalidArgumentException.cs" />
- <Compile Include="AMQInvalidRoutingKeyException.cs" />
- <Compile Include="AMQUndeliveredException.cs" />
- <Compile Include="AssemblySettings.cs" />
- <Compile Include="Collections\LinkedHashtable.cs" />
- <Compile Include="Collections\ConsumerProducerQueue.cs" />
- <Compile Include="Framing\AMQDataBlockDecoder.cs" />
- <Compile Include="Framing\AMQDataBlockEncoder.cs" />
- <Compile Include="Framing\AMQFrame.cs" />
- <Compile Include="Framing\AMQMethodBody.cs" />
- <Compile Include="Framing\AMQMethodBodyFactory.cs" />
- <Compile Include="Framing\AMQProtocolHeaderException.cs" />
- <Compile Include="Framing\AMQType.cs" />
- <Compile Include="Framing\BasicContentHeaderProperties.cs" />
- <Compile Include="Framing\CompositeAMQDataBlock.cs" />
- <Compile Include="Framing\ContentBody.cs" />
- <Compile Include="Framing\ContentBodyFactory.cs" />
- <Compile Include="Framing\ContentHeaderBody.cs" />
- <Compile Include="Framing\ContentHeaderBodyFactory.cs" />
- <Compile Include="Framing\ContentHeaderPropertiesFactory.cs" />
- <Compile Include="Framing\AMQTypedValue.cs" />
- <Compile Include="Framing\AMQTypeMap.cs" />
- <Compile Include="Framing\EncodingUtils.cs" />
- <Compile Include="Framing\FieldTable.cs" />
- <Compile Include="Framing\HeartbeatBody.cs" />
- <Compile Include="Framing\HeartbeatBodyFactory.cs" />
- <Compile Include="Framing\IBody.cs" />
- <Compile Include="Framing\IDataBlock.cs" />
- <Compile Include="Framing\AMQFrameDecodingException.cs" />
- <Compile Include="Framing\IEncodableAMQDataBlock.cs" />
- <Compile Include="Framing\IBodyFactory.cs" />
- <Compile Include="Framing\IContentHeaderProperties.cs" />
- <Compile Include="Framing\ProtocolInitiation.cs" />
- <Compile Include="generated\AccessRequestBody.cs" />
- <Compile Include="generated\AccessRequestOkBody.cs" />
- <Compile Include="generated\BasicAckBody.cs" />
- <Compile Include="generated\BasicCancelBody.cs" />
- <Compile Include="generated\BasicCancelOkBody.cs" />
- <Compile Include="generated\BasicConsumeBody.cs" />
- <Compile Include="generated\BasicConsumeOkBody.cs" />
- <Compile Include="generated\BasicDeliverBody.cs" />
- <Compile Include="generated\BasicGetBody.cs" />
- <Compile Include="generated\BasicGetEmptyBody.cs" />
- <Compile Include="generated\BasicGetOkBody.cs" />
- <Compile Include="generated\BasicPublishBody.cs" />
- <Compile Include="generated\BasicQosBody.cs" />
- <Compile Include="generated\BasicQosOkBody.cs" />
- <Compile Include="generated\BasicRecoverBody.cs" />
- <Compile Include="generated\BasicRecoverOkBody.cs" />
- <Compile Include="generated\BasicRejectBody.cs" />
- <Compile Include="generated\BasicReturnBody.cs" />
- <Compile Include="generated\ChannelAlertBody.cs" />
- <Compile Include="generated\ChannelCloseBody.cs" />
- <Compile Include="generated\ChannelCloseOkBody.cs" />
- <Compile Include="generated\ChannelFlowBody.cs" />
- <Compile Include="generated\ChannelFlowOkBody.cs" />
- <Compile Include="generated\ChannelOpenBody.cs" />
- <Compile Include="generated\ChannelOpenOkBody.cs" />
- <Compile Include="generated\ConnectionCloseBody.cs" />
- <Compile Include="generated\ConnectionCloseOkBody.cs" />
- <Compile Include="generated\ConnectionOpenBody.cs" />
- <Compile Include="generated\ConnectionOpenOkBody.cs" />
- <Compile Include="generated\ConnectionRedirectBody.cs" />
- <Compile Include="generated\ConnectionSecureBody.cs" />
- <Compile Include="generated\ConnectionSecureOkBody.cs" />
- <Compile Include="generated\ConnectionStartBody.cs" />
- <Compile Include="generated\ConnectionStartOkBody.cs" />
- <Compile Include="generated\ConnectionTuneBody.cs" />
- <Compile Include="generated\ConnectionTuneOkBody.cs" />
- <Compile Include="generated\DtxSelectBody.cs" />
- <Compile Include="generated\DtxSelectOkBody.cs" />
- <Compile Include="generated\DtxStartBody.cs" />
- <Compile Include="generated\DtxStartOkBody.cs" />
- <Compile Include="generated\ExchangeBoundBody.cs" />
- <Compile Include="generated\ExchangeBoundOkBody.cs" />
- <Compile Include="generated\ExchangeDeclareBody.cs" />
- <Compile Include="generated\ExchangeDeclareOkBody.cs" />
- <Compile Include="generated\ExchangeDeleteBody.cs" />
- <Compile Include="generated\ExchangeDeleteOkBody.cs" />
- <Compile Include="generated\FileAckBody.cs" />
- <Compile Include="generated\FileCancelBody.cs" />
- <Compile Include="generated\FileCancelOkBody.cs" />
- <Compile Include="generated\FileConsumeBody.cs" />
- <Compile Include="generated\FileConsumeOkBody.cs" />
- <Compile Include="generated\FileDeliverBody.cs" />
- <Compile Include="generated\FileOpenBody.cs" />
- <Compile Include="generated\FileOpenOkBody.cs" />
- <Compile Include="generated\FilePublishBody.cs" />
- <Compile Include="generated\FileQosBody.cs" />
- <Compile Include="generated\FileQosOkBody.cs" />
- <Compile Include="generated\FileRejectBody.cs" />
- <Compile Include="generated\FileReturnBody.cs" />
- <Compile Include="generated\FileStageBody.cs" />
- <Compile Include="generated\MainRegistry.cs" />
- <Compile Include="generated\MethodBodyDecoderRegistry.cs" />
- <Compile Include="generated\QueueBindBody.cs" />
- <Compile Include="generated\QueueBindOkBody.cs" />
- <Compile Include="generated\QueueDeclareBody.cs" />
- <Compile Include="generated\QueueDeclareOkBody.cs" />
- <Compile Include="generated\QueueDeleteBody.cs" />
- <Compile Include="generated\QueueDeleteOkBody.cs" />
- <Compile Include="generated\QueuePurgeBody.cs" />
- <Compile Include="generated\QueuePurgeOkBody.cs" />
- <Compile Include="generated\StreamCancelBody.cs" />
- <Compile Include="generated\StreamCancelOkBody.cs" />
- <Compile Include="generated\StreamConsumeBody.cs" />
- <Compile Include="generated\StreamConsumeOkBody.cs" />
- <Compile Include="generated\StreamDeliverBody.cs" />
- <Compile Include="generated\StreamPublishBody.cs" />
- <Compile Include="generated\StreamQosBody.cs" />
- <Compile Include="generated\StreamQosOkBody.cs" />
- <Compile Include="generated\StreamReturnBody.cs" />
- <Compile Include="generated\TestContentBody.cs" />
- <Compile Include="generated\TestContentOkBody.cs" />
- <Compile Include="generated\TestIntegerBody.cs" />
- <Compile Include="generated\TestIntegerOkBody.cs" />
- <Compile Include="generated\TestStringBody.cs" />
- <Compile Include="generated\TestStringOkBody.cs" />
- <Compile Include="generated\TestTableBody.cs" />
- <Compile Include="generated\TestTableOkBody.cs" />
- <Compile Include="generated\TunnelRequestBody.cs" />
- <Compile Include="generated\TxCommitBody.cs" />
- <Compile Include="generated\TxCommitOkBody.cs" />
- <Compile Include="generated\TxRollbackBody.cs" />
- <Compile Include="generated\TxRollbackOkBody.cs" />
- <Compile Include="generated\TxSelectBody.cs" />
- <Compile Include="generated\TxSelectOkBody.cs" />
- <Compile Include="Collections\BlockingQueue.cs" />
- <Compile Include="Collections\LinkedBlockingQueue.cs" />
- <Compile Include="Collections\SynchronousQueue.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="Protocol\AMQConstant.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/Final/dotnet/Qpid.Common/amqp.xml b/Final/dotnet/Qpid.Common/amqp.xml
deleted file mode 100644
index 8ad0f17a2c..0000000000
--- a/Final/dotnet/Qpid.Common/amqp.xml
+++ /dev/null
@@ -1,3908 +0,0 @@
-<?xml version="1.0"?>
-
-<!--
-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/Final/dotnet/Qpid.Common/build.xml b/Final/dotnet/Qpid.Common/build.xml
deleted file mode 100644
index b6a8fb63b9..0000000000
--- a/Final/dotnet/Qpid.Common/build.xml
+++ /dev/null
@@ -1,73 +0,0 @@
-<!--
- 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/Final/dotnet/Qpid.Common/default.build b/Final/dotnet/Qpid.Common/default.build
deleted file mode 100644
index 36055b9ca9..0000000000
--- a/Final/dotnet/Qpid.Common/default.build
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<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/Final/dotnet/Qpid.Common/lib/log4net/log4net-licence.txt b/Final/dotnet/Qpid.Common/lib/log4net/log4net-licence.txt
deleted file mode 100644
index 261eeb9e9f..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/lib/log4net/log4net.dll b/Final/dotnet/Qpid.Common/lib/log4net/log4net.dll
deleted file mode 100644
index 995816f27b..0000000000
--- a/Final/dotnet/Qpid.Common/lib/log4net/log4net.dll
+++ /dev/null
Binary files differ
diff --git a/Final/dotnet/Qpid.Common/lib/log4net/log4net.xml b/Final/dotnet/Qpid.Common/lib/log4net/log4net.xml
deleted file mode 100644
index b8fd000170..0000000000
--- a/Final/dotnet/Qpid.Common/lib/log4net/log4net.xml
+++ /dev/null
@@ -1,28655 +0,0 @@
-<?xml version="1.0"?>
-<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/Final/dotnet/Qpid.Common/lib/saxon/saxon-licence.txt b/Final/dotnet/Qpid.Common/lib/saxon/saxon-licence.txt
deleted file mode 100644
index 1bf2b1279d..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/lib/saxon/saxon8.jar b/Final/dotnet/Qpid.Common/lib/saxon/saxon8.jar
deleted file mode 100644
index 197ce75c5b..0000000000
--- a/Final/dotnet/Qpid.Common/lib/saxon/saxon8.jar
+++ /dev/null
Binary files differ
diff --git a/Final/dotnet/Qpid.Common/lib/seclib-1.0.0/Org.Mentalis.Security.dll b/Final/dotnet/Qpid.Common/lib/seclib-1.0.0/Org.Mentalis.Security.dll
deleted file mode 100644
index c3b95d71ba..0000000000
--- a/Final/dotnet/Qpid.Common/lib/seclib-1.0.0/Org.Mentalis.Security.dll
+++ /dev/null
Binary files differ
diff --git a/Final/dotnet/Qpid.Common/lib/seclib-1.0.0/seclib-license.txt b/Final/dotnet/Qpid.Common/lib/seclib-1.0.0/seclib-license.txt
deleted file mode 100644
index e837183135..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/resources/registry.template b/Final/dotnet/Qpid.Common/resources/registry.template
deleted file mode 100644
index 1c0a695f10..0000000000
--- a/Final/dotnet/Qpid.Common/resources/registry.template
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<registries>
- <registry name="MainRegistry"/>
-</registries>
diff --git a/Final/dotnet/Qpid.Common/stylesheets/csharp.xsl b/Final/dotnet/Qpid.Common/stylesheets/csharp.xsl
deleted file mode 100644
index 674c971559..0000000000
--- a/Final/dotnet/Qpid.Common/stylesheets/csharp.xsl
+++ /dev/null
@@ -1,230 +0,0 @@
-<?xml version='1.0'?>
-<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/Final/dotnet/Qpid.Common/stylesheets/framing.xsl b/Final/dotnet/Qpid.Common/stylesheets/framing.xsl
deleted file mode 100644
index e015d4c40b..0000000000
--- a/Final/dotnet/Qpid.Common/stylesheets/framing.xsl
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version='1.0'?>
-<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/Final/dotnet/Qpid.Common/stylesheets/java.xsl b/Final/dotnet/Qpid.Common/stylesheets/java.xsl
deleted file mode 100644
index f9904c9e94..0000000000
--- a/Final/dotnet/Qpid.Common/stylesheets/java.xsl
+++ /dev/null
@@ -1,209 +0,0 @@
-<?xml version='1.0'?>
-<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/Final/dotnet/Qpid.Common/stylesheets/prepare1.xsl b/Final/dotnet/Qpid.Common/stylesheets/prepare1.xsl
deleted file mode 100644
index 9661fb47f6..0000000000
--- a/Final/dotnet/Qpid.Common/stylesheets/prepare1.xsl
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version='1.0'?>
-<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/Final/dotnet/Qpid.Common/stylesheets/prepare2.xsl b/Final/dotnet/Qpid.Common/stylesheets/prepare2.xsl
deleted file mode 100644
index d98365d1f3..0000000000
--- a/Final/dotnet/Qpid.Common/stylesheets/prepare2.xsl
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version='1.0'?>
-<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/Final/dotnet/Qpid.Common/stylesheets/prepare3.xsl b/Final/dotnet/Qpid.Common/stylesheets/prepare3.xsl
deleted file mode 100644
index 92a2648cd6..0000000000
--- a/Final/dotnet/Qpid.Common/stylesheets/prepare3.xsl
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version='1.0'?>
-<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/Final/dotnet/Qpid.Common/stylesheets/readme.txt b/Final/dotnet/Qpid.Common/stylesheets/readme.txt
deleted file mode 100644
index c2f98050a6..0000000000
--- a/Final/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/Final/dotnet/Qpid.Common/stylesheets/registry.xsl b/Final/dotnet/Qpid.Common/stylesheets/registry.xsl
deleted file mode 100644
index ae2a25a792..0000000000
--- a/Final/dotnet/Qpid.Common/stylesheets/registry.xsl
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version='1.0'?>
-<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/Final/dotnet/Qpid.Common/stylesheets/utils.xsl b/Final/dotnet/Qpid.Common/stylesheets/utils.xsl
deleted file mode 100644
index 422b757b5c..0000000000
--- a/Final/dotnet/Qpid.Common/stylesheets/utils.xsl
+++ /dev/null
@@ -1,164 +0,0 @@
-<?xml version='1.0'?>
-<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/Final/dotnet/Qpid.Messaging/AcknowledgeMode.cs b/Final/dotnet/Qpid.Messaging/AcknowledgeMode.cs
deleted file mode 100644
index 4896b64f68..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/ChannelLimitReachedException.cs b/Final/dotnet/Qpid.Messaging/ChannelLimitReachedException.cs
deleted file mode 100644
index 8b43422f5c..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/DeliveryMode.cs b/Final/dotnet/Qpid.Messaging/DeliveryMode.cs
deleted file mode 100644
index 3c4713ee2a..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/ExchangeClassConstants.cs b/Final/dotnet/Qpid.Messaging/ExchangeClassConstants.cs
deleted file mode 100644
index 984e8b0f17..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/ExchangeNameDefaults.cs b/Final/dotnet/Qpid.Messaging/ExchangeNameDefaults.cs
deleted file mode 100644
index 2689fb5e46..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/IBytesMessage.cs b/Final/dotnet/Qpid.Messaging/IBytesMessage.cs
deleted file mode 100644
index 5be942423d..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/IChannel.cs b/Final/dotnet/Qpid.Messaging/IChannel.cs
deleted file mode 100644
index 4da41a773d..0000000000
--- a/Final/dotnet/Qpid.Messaging/IChannel.cs
+++ /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.
- *
- */
-using System;
-
-namespace Apache.Qpid.Messaging
-{
- public delegate void MessageReceivedDelegate(IMessage msg);
-
- /// <summary>
- /// Interface used to manipulate an AMQP channel.
- /// </summary>
- /// <remarks>
- /// You can create a channel by using the CreateChannel() method
- /// of the connection object.
- /// </remarks>
- public interface IChannel : IDisposable
- {
- /// <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>
- /// <param name="durable">If true, create a durable subscription</param>
- /// <param name="subscriptionName">Subscription name</param>
- /// <returns>The new consumer</returns>
- IMessageConsumer CreateConsumer(string queueName,
- int prefetchLow,
- int prefetchHigh,
- bool noLocal,
- bool exclusive,
- bool durable,
- string subscriptionName);
-
- /// <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/Final/dotnet/Qpid.Messaging/IConnection.cs b/Final/dotnet/Qpid.Messaging/IConnection.cs
deleted file mode 100644
index 420228fa8e..0000000000
--- a/Final/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
- {
- /// <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/Final/dotnet/Qpid.Messaging/IConnectionFactory.cs b/Final/dotnet/Qpid.Messaging/IConnectionFactory.cs
deleted file mode 100644
index f141d509be..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/IConnectionListener.cs b/Final/dotnet/Qpid.Messaging/IConnectionListener.cs
deleted file mode 100644
index 02d9eb38da..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/IFieldTable.cs b/Final/dotnet/Qpid.Messaging/IFieldTable.cs
deleted file mode 100644
index 730ce399d4..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/IHeaders.cs b/Final/dotnet/Qpid.Messaging/IHeaders.cs
deleted file mode 100644
index 7fdf26ebda..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/IMessage.cs b/Final/dotnet/Qpid.Messaging/IMessage.cs
deleted file mode 100644
index 20ae5ee130..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/IMessageConsumer.cs b/Final/dotnet/Qpid.Messaging/IMessageConsumer.cs
deleted file mode 100644
index 82d697bf61..0000000000
--- a/Final/dotnet/Qpid.Messaging/IMessageConsumer.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;
-
-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
- {
- /// <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/Final/dotnet/Qpid.Messaging/IMessagePublisher.cs b/Final/dotnet/Qpid.Messaging/IMessagePublisher.cs
deleted file mode 100644
index fab0df0c2b..0000000000
--- a/Final/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
- {
- /// <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/Final/dotnet/Qpid.Messaging/ITextMessage.cs b/Final/dotnet/Qpid.Messaging/ITextMessage.cs
deleted file mode 100644
index 902beb70f8..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/MessageConsumerBuilder.cs b/Final/dotnet/Qpid.Messaging/MessageConsumerBuilder.cs
deleted file mode 100644
index 2d6f76d639..0000000000
--- a/Final/dotnet/Qpid.Messaging/MessageConsumerBuilder.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.Messaging
-{
- 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, _durable, _subscriptionName);
- }
- }
-}
diff --git a/Final/dotnet/Qpid.Messaging/MessageNotReadableException.cs b/Final/dotnet/Qpid.Messaging/MessageNotReadableException.cs
deleted file mode 100644
index 2afcffd531..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/MessageNotWritableException.cs b/Final/dotnet/Qpid.Messaging/MessageNotWritableException.cs
deleted file mode 100644
index 9b00f01948..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/MessagePublisherBuilder.cs b/Final/dotnet/Qpid.Messaging/MessagePublisherBuilder.cs
deleted file mode 100644
index 79c7575d0a..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/Properties/AssemblyInfo.cs b/Final/dotnet/Qpid.Messaging/Properties/AssemblyInfo.cs
deleted file mode 100644
index 8683ad08b2..0000000000
--- a/Final/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("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Qpid")]
-[assembly: AssemblyProduct("Apache.Qpid.Messaging")]
-[assembly: AssemblyCopyright("Copyright (c) 2006 The 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("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-
-[assembly: CLSCompliant(true)]
diff --git a/Final/dotnet/Qpid.Messaging/Qpid.Messaging.csproj b/Final/dotnet/Qpid.Messaging/Qpid.Messaging.csproj
deleted file mode 100644
index 90354bece6..0000000000
--- a/Final/dotnet/Qpid.Messaging/Qpid.Messaging.csproj
+++ /dev/null
@@ -1,69 +0,0 @@
-<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>{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>
- </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="AcknowledgeMode.cs" />
- <Compile Include="ChannelLimitReachedException.cs" />
- <Compile Include="DeliveryMode.cs" />
- <Compile Include="ExchangeClassConstants.cs" />
- <Compile Include="ExchangeNameDefaults.cs" />
- <Compile Include="IBytesMessage.cs" />
- <Compile Include="IConnection.cs" />
- <Compile Include="IConnectionFactory.cs" />
- <Compile Include="IConnectionListener.cs" />
- <Compile Include="IFieldTable.cs" />
- <Compile Include="IHeaders.cs" />
- <Compile Include="IMessage.cs" />
- <Compile Include="IMessageConsumer.cs" />
- <Compile Include="IMessagePublisher.cs" />
- <Compile Include="IChannel.cs" />
- <Compile Include="ITextMessage.cs" />
- <Compile Include="MessageConsumerBuilder.cs" />
- <Compile Include="MessageNotReadableException.cs" />
- <Compile Include="MessageNotWritableException.cs" />
- <Compile Include="MessagePublisherBuilder.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="QpidException.cs" />
- <Compile Include="ResourceAllocationException.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/Final/dotnet/Qpid.Messaging/QpidException.cs b/Final/dotnet/Qpid.Messaging/QpidException.cs
deleted file mode 100644
index 3e39f2293d..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/ResourceAllocationException.cs b/Final/dotnet/Qpid.Messaging/ResourceAllocationException.cs
deleted file mode 100644
index 954dcdd94c..0000000000
--- a/Final/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/Final/dotnet/Qpid.Messaging/default.build b/Final/dotnet/Qpid.Messaging/default.build
deleted file mode 100644
index 789258bfad..0000000000
--- a/Final/dotnet/Qpid.Messaging/default.build
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-<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/Final/dotnet/Qpid.NET.FxCop b/Final/dotnet/Qpid.NET.FxCop
deleted file mode 100644
index cfc5445e40..0000000000
--- a/Final/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/Final/dotnet/Qpid.NET.sln b/Final/dotnet/Qpid.NET.sln
deleted file mode 100644
index 8b174db90f..0000000000
--- a/Final/dotnet/Qpid.NET.sln
+++ /dev/null
@@ -1,87 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-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", "{9A112DF2-146F-4CF4-919B-9D3BE7D088E9}"
-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
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/Final/dotnet/Qpid.Sasl.Tests/App.config b/Final/dotnet/Qpid.Sasl.Tests/App.config
deleted file mode 100644
index 539f341e7c..0000000000
--- a/Final/dotnet/Qpid.Sasl.Tests/App.config
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<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/Final/dotnet/Qpid.Sasl.Tests/Mechanisms/AnonymousSaslClientTests.cs b/Final/dotnet/Qpid.Sasl.Tests/Mechanisms/AnonymousSaslClientTests.cs
deleted file mode 100644
index 09260736f0..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl.Tests/Mechanisms/CramMD5SaslClientTests.cs b/Final/dotnet/Qpid.Sasl.Tests/Mechanisms/CramMD5SaslClientTests.cs
deleted file mode 100644
index e8b0ae5468..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl.Tests/Mechanisms/DigestSaslClientTests.cs b/Final/dotnet/Qpid.Sasl.Tests/Mechanisms/DigestSaslClientTests.cs
deleted file mode 100644
index eb7e7ebbd5..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl.Tests/Mechanisms/ExternalSaslClientTests.cs b/Final/dotnet/Qpid.Sasl.Tests/Mechanisms/ExternalSaslClientTests.cs
deleted file mode 100644
index 1864a6c957..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl.Tests/Mechanisms/PlainSaslClientTests.cs b/Final/dotnet/Qpid.Sasl.Tests/Mechanisms/PlainSaslClientTests.cs
deleted file mode 100644
index 4c82f7b126..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl.Tests/Properties/AssemblyInfo.cs b/Final/dotnet/Qpid.Sasl.Tests/Properties/AssemblyInfo.cs
deleted file mode 100644
index 657b15e3ea..0000000000
--- a/Final/dotnet/Qpid.Sasl.Tests/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-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("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("Apache.Qpid.Sasl.Tests")]
-[assembly: AssemblyCopyright("Copyright © 2007")]
-[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("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Final/dotnet/Qpid.Sasl.Tests/Qpid.Sasl.Tests.csproj b/Final/dotnet/Qpid.Sasl.Tests/Qpid.Sasl.Tests.csproj
deleted file mode 100644
index 8c807e2385..0000000000
--- a/Final/dotnet/Qpid.Sasl.Tests/Qpid.Sasl.Tests.csproj
+++ /dev/null
@@ -1,67 +0,0 @@
-<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>{587B3520-EBB9-41ED-B019-E96116B651CE}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Sasl.Tests</RootNamespace>
- <AssemblyName>Apache.Qpid.Sasl.Tests</AssemblyName>
- </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="Mechanisms\ExternalSaslClientTests.cs" />
- <Compile Include="TestClientFactory.cs" />
- <Compile Include="Mechanisms\AnonymousSaslClientTests.cs" />
- <Compile Include="Mechanisms\DigestSaslClientTests.cs" />
- <Compile Include="Mechanisms\CramMD5SaslClientTests.cs" />
- <Compile Include="Mechanisms\PlainSaslClientTests.cs" />
- <Compile Include="SaslTests.cs" />
- <Compile Include="Properties\AssemblyInfo.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/Final/dotnet/Qpid.Sasl.Tests/SaslTests.cs b/Final/dotnet/Qpid.Sasl.Tests/SaslTests.cs
deleted file mode 100644
index 5b27949b98..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl.Tests/TestClientFactory.cs b/Final/dotnet/Qpid.Sasl.Tests/TestClientFactory.cs
deleted file mode 100644
index 73c68ea2b3..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl.Tests/default.build b/Final/dotnet/Qpid.Sasl.Tests/default.build
deleted file mode 100644
index eb0514d417..0000000000
--- a/Final/dotnet/Qpid.Sasl.Tests/default.build
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<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/Final/dotnet/Qpid.Sasl/Callbacks.cs b/Final/dotnet/Qpid.Sasl/Callbacks.cs
deleted file mode 100644
index 90e36beeb8..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/Configuration/SaslConfiguration.cs b/Final/dotnet/Qpid.Sasl/Configuration/SaslConfiguration.cs
deleted file mode 100644
index 3446261724..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/Configuration/SaslConfigurationSectionHandler.cs b/Final/dotnet/Qpid.Sasl/Configuration/SaslConfigurationSectionHandler.cs
deleted file mode 100644
index 21f6b92414..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/DefaultClientFactory.cs b/Final/dotnet/Qpid.Sasl/DefaultClientFactory.cs
deleted file mode 100644
index d552aa80c0..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/ISaslCallbackHandler.cs b/Final/dotnet/Qpid.Sasl/ISaslCallbackHandler.cs
deleted file mode 100644
index 0dfc482333..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/ISaslClient.cs b/Final/dotnet/Qpid.Sasl/ISaslClient.cs
deleted file mode 100644
index 526cc1f43a..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/ISaslClientFactory.cs b/Final/dotnet/Qpid.Sasl/ISaslClientFactory.cs
deleted file mode 100644
index fc81057ec4..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/MD5HMAC.cs b/Final/dotnet/Qpid.Sasl/MD5HMAC.cs
deleted file mode 100644
index 134332284a..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/Mechanisms/AnonymousSaslClient.cs b/Final/dotnet/Qpid.Sasl/Mechanisms/AnonymousSaslClient.cs
deleted file mode 100644
index 5e8c56ff51..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/Mechanisms/CramMD5SaslClient.cs b/Final/dotnet/Qpid.Sasl/Mechanisms/CramMD5SaslClient.cs
deleted file mode 100644
index 672cc64c6a..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/Mechanisms/DigestSaslClient.cs b/Final/dotnet/Qpid.Sasl/Mechanisms/DigestSaslClient.cs
deleted file mode 100644
index 59d3a88991..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/Mechanisms/ExternalSaslClient.cs b/Final/dotnet/Qpid.Sasl/Mechanisms/ExternalSaslClient.cs
deleted file mode 100644
index 5b513bda87..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/Mechanisms/PlainSaslClient.cs b/Final/dotnet/Qpid.Sasl/Mechanisms/PlainSaslClient.cs
deleted file mode 100644
index 3addeb2e83..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/Properties/AssemblyInfo.cs b/Final/dotnet/Qpid.Sasl/Properties/AssemblyInfo.cs
deleted file mode 100644
index f38725e53f..0000000000
--- a/Final/dotnet/Qpid.Sasl/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-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("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Apache Qpid")]
-[assembly: AssemblyProduct("Apache.Qpid.Sasl")]
-[assembly: AssemblyCopyright("Copyright © 2007 The 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("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
-[assembly: CLSCompliant(true)]
diff --git a/Final/dotnet/Qpid.Sasl/Qpid.Sasl.csproj b/Final/dotnet/Qpid.Sasl/Qpid.Sasl.csproj
deleted file mode 100644
index 891d710379..0000000000
--- a/Final/dotnet/Qpid.Sasl/Qpid.Sasl.csproj
+++ /dev/null
@@ -1,64 +0,0 @@
-<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>{1465B0EE-6452-42A6-AB73-B2F9EABEEE75}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Sasl</RootNamespace>
- <AssemblyName>Apache.Qpid.Sasl</AssemblyName>
- </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="Callbacks.cs" />
- <Compile Include="Configuration\SaslConfiguration.cs" />
- <Compile Include="Configuration\SaslConfigurationSectionHandler.cs" />
- <Compile Include="MD5HMAC.cs" />
- <Compile Include="Mechanisms\ExternalSaslClient.cs" />
- <Compile Include="SaslException.cs" />
- <Compile Include="Mechanisms\AnonymousSaslClient.cs" />
- <Compile Include="Mechanisms\DigestSaslClient.cs" />
- <Compile Include="Sasl.cs" />
- <Compile Include="DefaultClientFactory.cs" />
- <Compile Include="ISaslCallbackHandler.cs" />
- <Compile Include="ISaslClientFactory.cs" />
- <Compile Include="Mechanisms\CramMD5SaslClient.cs" />
- <Compile Include="SaslProperties.cs" />
- <Compile Include="ISaslClient.cs" />
- <Compile Include="Mechanisms\PlainSaslClient.cs" />
- <Compile Include="SaslClient.cs" />
- <Compile Include="Properties\AssemblyInfo.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/Final/dotnet/Qpid.Sasl/Sasl.cs b/Final/dotnet/Qpid.Sasl/Sasl.cs
deleted file mode 100644
index 5a744a30d9..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/SaslClient.cs b/Final/dotnet/Qpid.Sasl/SaslClient.cs
deleted file mode 100644
index 1390b1b352..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/SaslException.cs b/Final/dotnet/Qpid.Sasl/SaslException.cs
deleted file mode 100644
index 8f6e00a7ba..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/SaslProperties.cs b/Final/dotnet/Qpid.Sasl/SaslProperties.cs
deleted file mode 100644
index 0658acda21..0000000000
--- a/Final/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/Final/dotnet/Qpid.Sasl/default.build b/Final/dotnet/Qpid.Sasl/default.build
deleted file mode 100644
index 5b44d6b9c4..0000000000
--- a/Final/dotnet/Qpid.Sasl/default.build
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-<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/Final/dotnet/README.txt b/Final/dotnet/README.txt
deleted file mode 100644
index 1c0be05c11..0000000000
--- a/Final/dotnet/README.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-Info
-====
-
-AMQP version currently 0.8 (see /Qpid.Common/amqp.xml)
-
-
-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 framing from /Qpid.Common/amqp.xml specificiation file:
-
- $ build-framing
-
-Alternatively, just switch to /Qpid.Common and run "ant" there.
-
-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):
-
- $ build-dotnet20
-
-To build .NET 1.1 executables (to bin/net-1.1):
-
- $ build-dotnet11
-
-To build for Mono on Linux (to bin/mono-2.0):
-
- $ build-mono
-
-
-Releasing
-=========
-
-For .NET 1.1
-
- $ release net-1.1
-
-Generates ./bin/net-1.1/release/Qpid.NET-net-1.1-yyyyMMdd.zip
-
-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/Final/dotnet/RELEASE_NOTES.txt b/Final/dotnet/RELEASE_NOTES.txt
deleted file mode 100644
index 97e8a6f3b8..0000000000
--- a/Final/dotnet/RELEASE_NOTES.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-Apache Incubator Qpid .NET M2 Release Notes
--------------------------------------------
-
-The Qpid M2 release contains support the for AMQP 0-8 specification.
-You can access the 0-8 specification using the following link.
-http://www.amqp.org/tikiwiki/tiki-index.php?page=Download
-
-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
-
-
-M2 Tasks Completed
--------------------
-
-The set of JIRA tasks completed as part of the M2 effort is available at:
-https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310520&styleName=Html&version=12312116
-
-Here is a filtered list of JIRA items for the .NET Client
-
-Test QPID-435 HeadersExchangeTest fails
-
-New Feature QPID-136 implement prefetch
-New Feature QPID-291 Support SASL authentication in .NET client
-
-Improvement QPID-246 Custom Exception types should be serializable
-Improvement QPID-312 Inconsistency in naming conventions
-Improvement QPID-338 Integrate JDK 1.4 compatible SASL API Library & CRAM-MD5 Implementation
-Improvement QPID-345 Implement Blocking receive modes in BasicMessageConsumer
-Improvement QPID-398 Implement SSL/TLS support in the .NET Client
-Improvement QPID-452 Improve Message Classes and Message Creation APIs
-Improvement QPID-489 Create new build system for .NET Client
-Improvement QPID-490 Improve AmqChannel.PurgeQueue() and AmqChannel.DeleteQueue() methods
-Improvement QPID-495 Implement default timeouts for AttainState and SyncWriter operations
-
-Bug QPID-546 .Net does not handle reply to fields correctly.
-Bug QPID-237 Build broken because of missing IBytesMessage.Reset() impl in Qpid.Client.Message.QpidBytesMessage
-Bug QPID-238 Wrong call to string.Split() in AbstractQmsMessage.GetExchangeName()
-Bug QPID-239 Use of assembly name vs. assembly path in AMQConnection.LoadTransportFromAssembly()
-Bug QPID-250 .Net client does not use specs from the specs directory.
-Bug QPID-257 Test HeadersMatchingConsumer#Test fails.
-Bug QPID-258 Test ServiceProvidingClient#Test fails.
-Bug QPID-259 Test ServiceRequestingClient#SendMessages fails.
-Bug QPID-267 AMQConnection#Stop throws NotImplementedException
-Bug QPID-284 .Net build broekn due to missing HeadersMatchingProducers
-Bug QPID-335 .NET Client messages not interoperable with Java client
-Bug QPID-384 Update AMQConstant.cs to match response codes in AMQP 0.9
-Bug QPID-385 Failover support sometimes masks authentication errors
-Bug QPID-441 .NET Client does not properly handle bounced (undeliverable) messages
-Bug QPID-456 .NET Client doesn't enforce virtual host names start with '/'
-Bug QPID-467 Complete Interop Testing
-Bug QPID-485 AmqBrokerInfo.Equals method doesn't get the expected result
-Bug QPID-486 .NET Client SASL implementation chooses first matching mechanism instead of stronger
-Bug QPID-487 The QpidConnectionInfo.ToString() method returns a wrong value
-Bug QPID-492 Race condition causes received messages to read wrong headers and/or body
-
diff --git a/Final/dotnet/TODO.txt b/Final/dotnet/TODO.txt
deleted file mode 100644
index d79fb8f5f7..0000000000
--- a/Final/dotnet/TODO.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-
-* Implement durable subscriptions.
-* Implement prefetching
-* support multiple versions of AMQP from the same client.
-* Add new unit and integration tests
-* Implement Transactions
diff --git a/Final/dotnet/TestClient/Program.cs b/Final/dotnet/TestClient/Program.cs
deleted file mode 100644
index 4c39638eb3..0000000000
--- a/Final/dotnet/TestClient/Program.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace TopicListener
-{
- class Program
- {
- static void Main(string[] args)
- {
- Apache.Qpid.Client.Tests.interop.TestClient.Main(args);
- }
- }
-}
diff --git a/Final/dotnet/TestClient/Properties/AssemblyInfo.cs b/Final/dotnet/TestClient/Properties/AssemblyInfo.cs
deleted file mode 100644
index becfda4a69..0000000000
--- a/Final/dotnet/TestClient/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-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("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("J.P. Morgan Chase & Co.")]
-[assembly: AssemblyProduct("TestClient")]
-[assembly: AssemblyCopyright("Copyright © J.P. Morgan Chase & Co. 2007")]
-[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("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Final/dotnet/TestClient/TestClient.csproj b/Final/dotnet/TestClient/TestClient.csproj
deleted file mode 100644
index b00994b265..0000000000
--- a/Final/dotnet/TestClient/TestClient.csproj
+++ /dev/null
@@ -1,89 +0,0 @@
-<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>{9A112DF2-146F-4CF4-919B-9D3BE7D088E9}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>TestClient</RootNamespace>
- <AssemblyName>TestClient</AssemblyName>
- </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> \ No newline at end of file
diff --git a/Final/dotnet/TestClient/default.build b/Final/dotnet/TestClient/default.build
deleted file mode 100644
index dee644c71e..0000000000
--- a/Final/dotnet/TestClient/default.build
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<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.Client.Tests.dll"/>
- </references>
- </csc>
- </target>
-</project>
-
diff --git a/Final/dotnet/TopicListener/Program.cs b/Final/dotnet/TopicListener/Program.cs
deleted file mode 100644
index 0134dca1ba..0000000000
--- a/Final/dotnet/TopicListener/Program.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace TopicListener
-{
- class Program
- {
- static void Main(string[] args)
- {
- Apache.Qpid.Client.Tests.interop.TopicListener.Main(args);
- }
- }
-}
diff --git a/Final/dotnet/TopicListener/Properties/AssemblyInfo.cs b/Final/dotnet/TopicListener/Properties/AssemblyInfo.cs
deleted file mode 100644
index 8672df7059..0000000000
--- a/Final/dotnet/TopicListener/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-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("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("J.P. Morgan Chase & Co.")]
-[assembly: AssemblyProduct("TopicListener")]
-[assembly: AssemblyCopyright("Copyright © J.P. Morgan Chase & Co. 2007")]
-[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("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Final/dotnet/TopicListener/TopicListener.csproj b/Final/dotnet/TopicListener/TopicListener.csproj
deleted file mode 100644
index 5522ada191..0000000000
--- a/Final/dotnet/TopicListener/TopicListener.csproj
+++ /dev/null
@@ -1,89 +0,0 @@
-<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>{9A112DF2-146F-4CF4-919B-9D3BE7D088E9}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>TopicListener</RootNamespace>
- <AssemblyName>TopicListener</AssemblyName>
- </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> \ No newline at end of file
diff --git a/Final/dotnet/TopicListener/default.build b/Final/dotnet/TopicListener/default.build
deleted file mode 100644
index afde4d6937..0000000000
--- a/Final/dotnet/TopicListener/default.build
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<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/Final/dotnet/TopicPublisher/Program.cs b/Final/dotnet/TopicPublisher/Program.cs
deleted file mode 100644
index a68df14bb3..0000000000
--- a/Final/dotnet/TopicPublisher/Program.cs
+++ /dev/null
@@ -1,10 +0,0 @@
-namespace TopicPublisher
-{
- class Program
- {
- static void Main(string[] args)
- {
- Apache.Qpid.Client.Tests.interop.TopicPublisher.Main(args);
- }
- }
-}
diff --git a/Final/dotnet/TopicPublisher/Properties/AssemblyInfo.cs b/Final/dotnet/TopicPublisher/Properties/AssemblyInfo.cs
deleted file mode 100644
index 85442960ed..0000000000
--- a/Final/dotnet/TopicPublisher/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-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("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("J.P. Morgan Chase & Co.")]
-[assembly: AssemblyProduct("TopicPublisher")]
-[assembly: AssemblyCopyright("Copyright © J.P. Morgan Chase & Co. 2007")]
-[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("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Final/dotnet/TopicPublisher/TopicPublisher.csproj b/Final/dotnet/TopicPublisher/TopicPublisher.csproj
deleted file mode 100644
index 2e03ce858e..0000000000
--- a/Final/dotnet/TopicPublisher/TopicPublisher.csproj
+++ /dev/null
@@ -1,85 +0,0 @@
-<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>{A06C9FFD-22FF-4654-856D-897C230978AF}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>TopicPublisher</RootNamespace>
- <AssemblyName>TopicPublisher</AssemblyName>
- </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> \ No newline at end of file
diff --git a/Final/dotnet/TopicPublisher/default.build b/Final/dotnet/TopicPublisher/default.build
deleted file mode 100644
index 8991aae751..0000000000
--- a/Final/dotnet/TopicPublisher/default.build
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<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/Final/dotnet/build-dotnet11 b/Final/dotnet/build-dotnet11
deleted file mode 100644
index 918010bf1f..0000000000
--- a/Final/dotnet/build-dotnet11
+++ /dev/null
@@ -1 +0,0 @@
-nant -t:net-1.1
diff --git a/Final/dotnet/build-dotnet11.bat b/Final/dotnet/build-dotnet11.bat
deleted file mode 100644
index 4b58f13b2a..0000000000
--- a/Final/dotnet/build-dotnet11.bat
+++ /dev/null
@@ -1 +0,0 @@
-nant -t:net-1.1
diff --git a/Final/dotnet/build-dotnet20 b/Final/dotnet/build-dotnet20
deleted file mode 100644
index 713a7aa55a..0000000000
--- a/Final/dotnet/build-dotnet20
+++ /dev/null
@@ -1,3 +0,0 @@
-MSBuild.exe Qpid.NET.sln \
- /p:Configuration=Release \
- /t:rebuild
diff --git a/Final/dotnet/build-framing b/Final/dotnet/build-framing
deleted file mode 100644
index 315a1a1cb2..0000000000
--- a/Final/dotnet/build-framing
+++ /dev/null
@@ -1,2 +0,0 @@
-cd Qpid.Common
-ant
diff --git a/Final/dotnet/build-framing.bat b/Final/dotnet/build-framing.bat
deleted file mode 100644
index bc5aa23ab7..0000000000
--- a/Final/dotnet/build-framing.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-cd Qpid.Common
-ant
diff --git a/Final/dotnet/build-mono b/Final/dotnet/build-mono
deleted file mode 100755
index 6f5cad5744..0000000000
--- a/Final/dotnet/build-mono
+++ /dev/null
@@ -1 +0,0 @@
-nant -t:mono-2.0
diff --git a/Final/dotnet/default.build b/Final/dotnet/default.build
deleted file mode 100644
index c103804d62..0000000000
--- a/Final/dotnet/default.build
+++ /dev/null
@@ -1,135 +0,0 @@
-<?xml version="1.0"?>
-<project name="Qpid.NET" default="build">
- <property name="nant.formatter" value="Plain" />
- <!--
- Build debug or release build?
- -->
- <property name="build.config" value="debug" />
-
- <!--
- 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 test assemblies
- -->
- <fileset id="tests.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>
-
- <!--
- 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>
-
- <target name="clean" depends="init">
- <delete dir="${build.dir}" failonerror="false" />
- </target>
-
- <!--
- Do the build
- -->
- <target name="build" depends="init">
- <!-- 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.builds" />
- </nant>
- <!--
- Compile test assemblies
- -->
- <nant target="build">
- <buildfiles refid="other.builds" />
- </nant>
- </target>
-
- <!--
- Execute unit tests
- -->
- <target name="test" depends="build">
- <echo message="Running unit tests for the project." />
- <nant target="test">
- <buildfiles refid="tests.builds" />
- </nant>
- </target>
-
- <!--
- Make a release package
- -->
- <target name="release-pkg">
- <echo message="building and packing 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}">
- <include name="**/*.*"/>
- <exclude name="**/*.Tests.*"/>
- <exclude name="**/nunit.framework.dll"/>
- <exclude name="**/*.exe"/>
- </fileset>
-
- <fileset basedir="${base.dir}">
- <include name="LICENSE.txt"/>
- <include name="NOTICE.txt"/>
- <include name="README.txt"/>
- <include name="RELEASE_NOTES.txt"/>
- </fileset>
- </zip>
- </target>
-
-</project>
-
-
diff --git a/Final/dotnet/release b/Final/dotnet/release
deleted file mode 100755
index 11291e87d6..0000000000
--- a/Final/dotnet/release
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-
-Usage()
-{
- echo "usage: $0 net-1.1|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/Final/etc/svn-auto-props b/Final/etc/svn-auto-props
deleted file mode 100644
index 35f1d10998..0000000000
--- a/Final/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/Final/gentools/README b/Final/gentools/README
deleted file mode 100644
index c4abecc199..0000000000
--- a/Final/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/Final/gentools/build b/Final/gentools/build
deleted file mode 100755
index ad9827b113..0000000000
--- a/Final/gentools/build
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-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 org/apache/qpid/gentools/*.java
-echo "Done. Try it out..."
-java org.apache.qpid.gentools.Main
-echo "--------- Building gentools completed ----------"
-cd ..
diff --git a/Final/gentools/build.xml b/Final/gentools/build.xml
deleted file mode 100644
index d35790f714..0000000000
--- a/Final/gentools/build.xml
+++ /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.
- -
- -->
-<project name="gentools" default="compile">
- <property name="src" location="src" />
-
- <target name="compile">
- <javac srcdir="${src}" source="1.5" fork="true" debug="on"/>
- </target>
-
- <target name="clean">
- <delete>
- <fileset dir="${src}/org/apache/qpid/gentools" includes="*.class" />
- </delete>
- </target>
-
-</project>
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpClass.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpClass.java
deleted file mode 100644
index 2e8bdaf971..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpClass.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.gentools;
-
-import java.io.PrintStream;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class AmqpClass implements Printable, NodeAware
-{
- public LanguageConverter converter;
- public AmqpVersionSet versionSet;
- public AmqpFieldMap fieldMap;
- public AmqpMethodMap methodMap;
- public String name;
- public AmqpOrdinalVersionMap indexMap;
-
- public AmqpClass(String name, LanguageConverter converter)
- {
- this.name = name;
- this.converter = converter;
- versionSet = new AmqpVersionSet();
- fieldMap = new AmqpFieldMap();
- methodMap = new AmqpMethodMap();
- indexMap = new AmqpOrdinalVersionMap();
- }
-
- public boolean addFromNode(Node classNode, int ordinal, AmqpVersion version)
- throws AmqpParseException, AmqpTypeMappingException
- {
- versionSet.add(version);
- int index = Utils.getNamedIntegerAttribute(classNode, "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 = classNode.getChildNodes();
- int fieldCntr = fieldMap.size();
- for (int i=0; i<nList.getLength(); i++)
- {
- Node child = nList.item(i);
- if (child.getNodeName().compareTo(Utils.ELEMENT_FIELD) == 0)
- {
- String fieldName = converter.prepareDomainName(Utils.getNamedAttribute(child,
- Utils.ATTRIBUTE_NAME));
- AmqpField thisField = fieldMap.get(fieldName);
- if (thisField == null)
- {
- thisField = new AmqpField(fieldName, converter);
- fieldMap.put(fieldName, thisField);
- }
- if (!thisField.addFromNode(child, fieldCntr++, version))
- {
- String className = converter.prepareClassName(Utils.getNamedAttribute(classNode,
- Utils.ATTRIBUTE_NAME));
- System.out.println("INFO: Generation supression tag found for field " +
- className + "." + fieldName + " - removing.");
- thisField.removeVersion(version);
- fieldMap.remove(fieldName);
- }
- }
- else if (child.getNodeName().compareTo(Utils.ELEMENT_METHOD) == 0)
- {
- String methodName = converter.prepareMethodName(Utils.getNamedAttribute(child,
- Utils.ATTRIBUTE_NAME));
- AmqpMethod thisMethod = methodMap.get(methodName);
- if (thisMethod == null)
- {
- thisMethod = new AmqpMethod(methodName, converter);
- methodMap.put(methodName, thisMethod);
- }
- if (!thisMethod.addFromNode(child, 0, version))
- {
- String className = converter.prepareClassName(Utils.getNamedAttribute(classNode,
- Utils.ATTRIBUTE_NAME));
- System.out.println("INFO: Generation supression tag found for method " +
- className + "." + methodName + " - removing.");
- thisMethod.removeVersion(version);
- methodMap.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)
- {
- indexMap.removeVersion(version);
- fieldMap.removeVersion(version);
- methodMap.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 + "[C] " + name + ": " + 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);
- }
-
- for (String thisMethodName : methodMap.keySet())
- {
- AmqpMethod thisMethod = methodMap.get(thisMethodName);
- thisMethod.print(out, marginSize + tabSize, tabSize);
- }
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpClassMap.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpClassMap.java
deleted file mode 100644
index 01d4df283b..0000000000
--- a/Final/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/Final/gentools/src/org/apache/qpid/gentools/AmqpConstant.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpConstant.java
deleted file mode 100644
index 6ccd2dbf99..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpConstant.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.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.
- *
- * The &lt;constant&gt; declaration in the specification contains only two attributes:
- * name and value.
- *
- * 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.
- */
- protected String name;
-
- /**
- * Set of versions for which this constant name is defined.
- */
- protected 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)
- {
- this.name = name;
- versionSet = new AmqpVersionSet(version);
- AmqpVersionSet valueVersionSet = new AmqpVersionSet(version);
- put(value, valueVersionSet);
- }
-
- /**
- * 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, int value, AmqpVersion version)
- {
- this.name = name;
- versionSet = new AmqpVersionSet(version);
- AmqpVersionSet valueVersionSet = new AmqpVersionSet(version);
- put(String.valueOf(value), valueVersionSet);
- }
-
- /**
- * 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, double value, AmqpVersion version)
- {
- this.name = name;
- versionSet = new AmqpVersionSet(version);
- AmqpVersionSet valueVersionSet = new AmqpVersionSet(version);
- put(String.valueOf(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 \"" + name +
- "\" 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 = name.compareTo(other.name);
- if (res != 0)
- return res;
- return versionSet.compareTo(other.versionSet);
- }
-
- /* (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] " + name + " = \"" + firstKey() + "\" " + versionSet);
- }
- else
- {
- out.println(margin + tab + "[C] " + name + ": " + versionSet);
- for (String thisValue : keySet())
- {
- out.println(margin + tab + tab + "= \"" + thisValue + "\" " + get(thisValue));
- }
- }
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.java
deleted file mode 100644
index 7b38f5cf3c..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpConstantSet.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.gentools;
-
-import java.io.PrintStream;
-import java.util.Iterator;
-import java.util.TreeSet;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * @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 extends TreeSet<AmqpConstant> implements Printable, NodeAware, Comparable<AmqpConstantSet>
-{
- public LanguageConverter converter;
-
- public AmqpConstantSet(LanguageConverter converter)
- {
- this.converter = converter;
- this.converter.setConstantSet(this);
- }
-
- /* (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
- {
- 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 = converter.prepareDomainName(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 = iterator();
- while (cItr.hasNext() && !foundName)
- {
- AmqpConstant thisConstant = cItr.next();
- if (name.compareTo(thisConstant.name) == 0)
- {
- foundName = true;
- thisConstant.versionSet.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)
- {
- 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 : this)
- {
- 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;
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpDomain.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpDomain.java
deleted file mode 100644
index 4796f31fb3..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpDomain.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.gentools;
-
-import java.io.PrintStream;
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpDomain extends TreeMap<String, AmqpVersionSet> implements Printable
-{
- public String domainName;
-
- public AmqpDomain(String domainName)
- {
- this.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 + domainName + ":");
-
- for (String thisDomainType : keySet())
- {
- AmqpVersionSet vs = get(thisDomainType);
- out.println(margin + tab + thisDomainType + " : " + vs.toString());
- }
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.java
deleted file mode 100644
index 7e2974a444..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpDomainMap.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.gentools;
-
-import java.io.PrintStream;
-import java.util.TreeMap;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-@SuppressWarnings("serial")
-public class AmqpDomainMap extends TreeMap<String, AmqpDomain> implements Printable, NodeAware
-{
- public LanguageConverter converter;
-
- public AmqpDomainMap(LanguageConverter converter)
- {
- this.converter = converter;
- this.converter.setDomainMap(this);
- }
-
- 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 = converter.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 = converter.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)
- throws AmqpTypeMappingException
- {
- 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);
- }
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.java
deleted file mode 100644
index f91d98bfe7..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpDomainVersionMap.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.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/Final/gentools/src/org/apache/qpid/gentools/AmqpField.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpField.java
deleted file mode 100644
index e1177e0154..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpField.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.ArrayList;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class AmqpField implements Printable, NodeAware, VersionConsistencyCheck
-{
- public LanguageConverter converter;
- public AmqpVersionSet versionSet;
- public AmqpDomainVersionMap domainMap;
- public AmqpOrdinalVersionMap ordinalMap;
- public String name;
-
- public AmqpField(String name, LanguageConverter converter)
- {
- this.name = name;
- this.converter = converter;
- versionSet = new AmqpVersionSet();
- domainMap = new AmqpDomainVersionMap();
- ordinalMap = new AmqpOrdinalVersionMap();
- }
-
- 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 = converter.prepareDomainName(Utils.getNamedAttribute(fieldNode, Utils.ATTRIBUTE_DOMAIN));
- }
- catch (AmqpParseException e)
- {
- domainType = converter.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);
- }
- 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.globalVersionSet.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;
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.java
deleted file mode 100644
index c91ec3d623..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpFieldMap.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.gentools;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpFieldMap extends TreeMap<String, AmqpField> implements VersionConsistencyCheck
-{
- public void removeVersion(AmqpVersion version)
- {
- String[] fieldNameArray = new String[size()];
- keySet().toArray(fieldNameArray);
- for (String fieldName : fieldNameArray)
- {
- get(fieldName).removeVersion(version);
- remove(fieldName);
- }
- }
-
- public AmqpFieldMap getFieldMapForOrdinal(int ordinal)
- {
- AmqpFieldMap newMap = new AmqpFieldMap();
- for (String thisFieldName: keySet())
- {
- AmqpField field = get(thisFieldName);
- TreeMap<Integer, AmqpVersionSet> ordinalMap = field.ordinalMap;
- AmqpVersionSet ordinalVersions = ordinalMap.get(ordinal);
- if (ordinalVersions != null)
- {
- newMap.put(field.name, field);
- }
- }
- return newMap;
- }
-
- public AmqpOrdinalFieldMap getMapForVersion(AmqpVersion version, boolean codeTypeFlag,
- LanguageConverter converter)
- throws AmqpTypeMappingException
- {
- // 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 (String thisFieldName: keySet())
- {
- AmqpField field = get(thisFieldName);
- if (version == null || field.versionSet.contains(version))
- {
- // 1. Search for domain name in field domain map with version that matches
- String domain = "";
- boolean dFound = false;
- for (String thisDomainName : field.domainMap.keySet())
- {
- domain = thisDomainName;
- AmqpVersionSet versionSet = field.domainMap.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.ordinalMap.keySet())
- {
- ordinal = thisOrdinal;
- AmqpVersionSet versionSet = field.ordinalMap.get(ordinal);
- if (version == null || versionSet.contains(version))
- oFound = true;
- }
-
- if (dFound && oFound)
- {
- String[] fieldDomainPair = {field.name, 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 get(firstKey()).isConsistent(generator);
- }
-
- public int getNumFields(AmqpVersion version)
- {
- int fCntr = 0;
- for (String thisFieldName : keySet())
- {
- AmqpField field = get(thisFieldName);
- if (field.versionSet.contains(version))
- fCntr++;
- }
- return fCntr;
- }
-
- public String parseFieldMap(Method commonGenerateMethod, Method mangledGenerateMethod,
- int indentSize, int tabSize, LanguageConverter converter)
- throws AmqpTypeMappingException, IllegalAccessException, InvocationTargetException
- {
- String indent = Utils.createSpaces(indentSize);
- String cr = Utils.lineSeparator;
- 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<String> itr = keySet().iterator();
- while (itr.hasNext())
- {
- String fieldName = itr.next();
- AmqpField field = get(fieldName);
- if (field.isCodeTypeConsistent(converter))
- {
- // All versions identical - Common declaration
- String domainName = field.domainMap.firstKey();
- AmqpVersionSet versionSet = field.domainMap.get(domainName);
- String codeType = converter.getGeneratedType(domainName, versionSet.first());
- if (commonGenerateMethod != null)
- sb.append(commonGenerateMethod.invoke(converter, codeType, field, versionSet,
- indentSize, tabSize, itr.hasNext()));
- }
- else if (mangledGenerateMethod != null) // Version-mangled
- {
- sb.append(mangledGenerateMethod.invoke(converter, field, indentSize, tabSize,
- itr.hasNext()));
- }
- }
- return sb.toString();
- }
-
- public String parseFieldMapOrdinally(Method generateMethod, Method bitGenerateMethod,
- int indentSize, int tabSize, Generator codeGenerator)
- throws AmqpTypeMappingException, IllegalAccessException, InvocationTargetException
- {
- String indent = Utils.createSpaces(indentSize);
- String cr = Utils.lineSeparator;
- 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, codeGenerator.globalVersionSet))
- {
- String fieldName = ordinalFieldMap.firstKey();
- String domain = ordinalFieldMap.get(fieldName).domainMap.firstKey();
- String domainType = codeGenerator.getDomainType(domain,
- codeGenerator.globalVersionSet.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.invoke(codeGenerator, 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.invoke(codeGenerator, 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[codeGenerator.globalVersionSet.size()];
- codeGenerator.globalVersionSet.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<String> i = ordinalFieldMap.keySet().iterator();
- while (i.hasNext())
- {
- String fieldName = i.next();
- AmqpField field = ordinalFieldMap.get(fieldName);
-
- // 4. Some fields may have more than one ordinal - match by both
- // ordinal and version.
- Iterator<Integer> j = field.ordinalMap.keySet().iterator();
- while (j.hasNext())
- {
- int thisOrdinal = j.next();
- AmqpVersionSet v1 = field.ordinalMap.get(thisOrdinal);
- if (thisOrdinal == o && v1.contains(versionArray[v]))
- {
- // 5. Now get the domain for this version
- int domainCntr = 0;
- Iterator<String> k = field.domainMap.keySet().iterator();
- while (k.hasNext())
- {
- // Mangle domain-divergent field names
- String mangledFieldName = fieldName;
- if (field.domainMap.size() > 1)
- mangledFieldName += "_" + (domainCntr++);
- String domainName = k.next();
- AmqpVersionSet v2 = field.domainMap.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.invoke(codeGenerator,
- 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.invoke(codeGenerator, domainType,
- mangledFieldName, o, indentSize + tabSize, tabSize));
- }
- }
- }
- }
- }
- }
- }
- // Check for remaining deferred bits
- if (bitFieldList2.size() > 0 && bitGenerateMethod != null)
- sb.append(bitGenerateMethod.invoke(codeGenerator, bitFieldList2, size(),
- indentSize + tabSize, tabSize));
- sb.append(indent + "}" + cr);
- }
- }
- // Check for remaining deferred bits
- else if (bitFieldList.size() > 0 && bitGenerateMethod != null)
- sb.append(bitGenerateMethod.invoke(codeGenerator, bitFieldList, size(),
- indentSize, tabSize));
- return sb.toString();
- }
-
- public boolean isVersionConsistent(AmqpVersionSet globalVersionSet)
- {
- for (String thisFieldName : keySet())
- {
- AmqpField field = get(thisFieldName);
- if (!field.isVersionConsistent(globalVersionSet))
- return false;
- }
- return true;
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.java
deleted file mode 100644
index 048221bda8..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpFlagMap.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.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/Final/gentools/src/org/apache/qpid/gentools/AmqpMethod.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpMethod.java
deleted file mode 100644
index ce963465de..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpMethod.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.gentools;
-
-import java.io.PrintStream;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class AmqpMethod implements Printable, NodeAware, VersionConsistencyCheck
-{
- public LanguageConverter converter;
- public AmqpVersionSet versionSet;
- public AmqpFieldMap fieldMap;
- public String name;
- public AmqpOrdinalVersionMap indexMap;
- public AmqpFlagMap clientMethodFlagMap; // Method called on client (<chassis name="server"> in XML)
- public AmqpFlagMap serverMethodFlagMap; // Method called on server (<chassis name="client"> in XML)
-
- public AmqpMethod(String name, LanguageConverter converter)
- {
- this.name = name;
- this.converter = converter;
- versionSet = new AmqpVersionSet();
- fieldMap = new AmqpFieldMap();
- indexMap = new AmqpOrdinalVersionMap();
- clientMethodFlagMap = new AmqpFlagMap();
- serverMethodFlagMap = new AmqpFlagMap();
- }
-
- 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();
- int fieldCntr = fieldMap.size();
- for (int i=0; i<nList.getLength(); i++)
- {
- Node child = nList.item(i);
- if (child.getNodeName().compareTo(Utils.ELEMENT_FIELD) == 0)
- {
- String fieldName = converter.prepareDomainName(Utils.getNamedAttribute(child,
- Utils.ATTRIBUTE_NAME));
- AmqpField thisField = fieldMap.get(fieldName);
- if (thisField == null)
- {
- thisField = new AmqpField(fieldName, converter);
- fieldMap.put(fieldName, thisField);
- }
- if (!thisField.addFromNode(child, fieldCntr++, version))
- {
- String className = converter.prepareClassName(Utils.getNamedAttribute(methodNode.getParentNode(),
- Utils.ATTRIBUTE_NAME));
- String methodName = converter.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 isVersionConsistent(AmqpVersionSet globalVersionSet)
- {
- if (!versionSet.equals(globalVersionSet))
- return false;
- if (!clientMethodFlagMap.isVersionConsistent(globalVersionSet))
- return false;
- if (!serverMethodFlagMap.isVersionConsistent(globalVersionSet))
- return false;
- if (!indexMap.isVersionConsistent(globalVersionSet))
- return false;
- if (!fieldMap.isVersionConsistent(globalVersionSet))
- return false;
- return true;
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpMethodMap.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpMethodMap.java
deleted file mode 100644
index 59eedd2a2b..0000000000
--- a/Final/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/Final/gentools/src/org/apache/qpid/gentools/AmqpModel.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpModel.java
deleted file mode 100644
index 721247a4b2..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpModel.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.gentools;
-
-import java.io.PrintStream;
-
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class AmqpModel implements Printable, NodeAware
-{
- public LanguageConverter converter;
- public AmqpClassMap classMap;
-
- public AmqpModel(LanguageConverter converter)
- {
- this.converter = converter;
- this.converter.setModel(this);
- classMap = new AmqpClassMap();
- }
-
- public boolean addFromNode(Node n, int o, AmqpVersion v)
- throws AmqpParseException, AmqpTypeMappingException
- {
- NodeList nList = n.getChildNodes();
- 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 = converter.prepareClassName(Utils.getNamedAttribute(c, Utils.ATTRIBUTE_NAME));
- AmqpClass thisClass = classMap.get(className);
- if (thisClass == null)
- {
- thisClass = new AmqpClass(className, converter);
- classMap.put(className, thisClass);
- }
- if (!thisClass.addFromNode(c, eCntr++, v))
- {
- System.out.println("INFO: Generation supression tag found for class " + className + " - removing.");
- thisClass.removeVersion(v);
- 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.lineSeparator);
- out.println(Utils.createSpaces(marginSize) + "Model:");
-
- for (String thisClassName : classMap.keySet())
- {
- AmqpClass thisClass = classMap.get(thisClassName);
- thisClass.print(out, marginSize + tabSize, tabSize);
- }
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpOrdinalFieldMap.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpOrdinalFieldMap.java
deleted file mode 100644
index 34d3b7ca5f..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpOrdinalFieldMap.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.util.Iterator;
-import java.util.Set;
-import java.util.TreeMap;
-
-@SuppressWarnings("serial")
-public class AmqpOrdinalFieldMap extends TreeMap<Integer, String[]> implements Comparable
-{
- protected static final int FIELD_DOMAIN = 1;
- protected boolean codeTypeFlag = false;
-
- 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.lineSeparator);
- }
- return sb.toString();
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.java
deleted file mode 100644
index 3706c9391d..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpOrdinalVersionMap.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;
-
-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/Final/gentools/src/org/apache/qpid/gentools/AmqpOverloadedParameterMap.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpOverloadedParameterMap.java
deleted file mode 100644
index 10978d0e4a..0000000000
--- a/Final/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/Final/gentools/src/org/apache/qpid/gentools/AmqpParseException.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpParseException.java
deleted file mode 100644
index 4d9f495390..0000000000
--- a/Final/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 Exception
-{
- public AmqpParseException(String msg)
- {
- super(msg);
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpTemplateException.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpTemplateException.java
deleted file mode 100644
index b1e6f3d712..0000000000
--- a/Final/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 Exception
-{
- public AmqpTemplateException(String msg)
- {
- super(msg);
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpTypeMappingException.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpTypeMappingException.java
deleted file mode 100644
index 1053543fdd..0000000000
--- a/Final/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 Exception
-{
- public AmqpTypeMappingException(String msg)
- {
- super(msg);
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpVersion.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpVersion.java
deleted file mode 100644
index 579d8e28b2..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpVersion.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 AmqpVersion implements Comparable<AmqpVersion>
-{
- private int major;
- private int minor;
-
- public AmqpVersion(int major, int minor)
- {
- this.major = major;
- this.minor = minor;
- }
-
- public AmqpVersion(AmqpVersion version)
- {
- this.major = version.major;
- this.minor = version.minor;
- }
-
- public int getMajor()
- {
- return major;
- }
-
- public int getMinor()
- {
- return minor;
- }
-
- public int compareTo(AmqpVersion v)
- {
- if (major != v.major)
- return major - v.major;
- if (minor != v.minor)
- return minor - v.minor;
- return 0;
- }
-
- public String namespace()
- {
- return "ver_" + major + "_" + minor;
- }
-
- public String toString()
- {
- return major + "-" + minor;
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.java b/Final/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.java
deleted file mode 100644
index 4406893cbb..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/AmqpVersionSet.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.gentools;
-
-import java.io.PrintStream;
-//import java.util.ArrayList;
-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.lineSeparator);
- }
-
- 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/Final/gentools/src/org/apache/qpid/gentools/CppGenerator.java b/Final/gentools/src/org/apache/qpid/gentools/CppGenerator.java
deleted file mode 100644
index 06454ddeb9..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/CppGenerator.java
+++ /dev/null
@@ -1,1628 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-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(AmqpVersionSet versionList)
- {
- super(versionList);
- 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 getDomainType(String domainName, AmqpVersion version)
- throws AmqpTypeMappingException
- {
- if (version == null)
- version = globalVersionSet.first();
- return globalDomainMap.getDomainType(domainName, version);
- }
-
- 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)
- {
- StringBuffer sb = new StringBuffer(filenameTemplate);
- if (thisClass != null)
- replaceToken(sb, "${CLASS}", thisClass.name);
- if (method != null)
- replaceToken(sb, "${METHOD}", method.name);
- if (field != null)
- replaceToken(sb, "${FIELD}", field.name);
- return sb.toString();
- }
-
- @Override
- protected void processTemplateA(String[] template)
- throws IOException, AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException
- {
- processTemplateD(template, null, null, null);
- }
-
- @Override
- protected void processTemplateB(String[] template, AmqpClass thisClass)
- throws IOException, AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException
- {
- processTemplateD(template, thisClass, null, null);
- }
-
- @Override
- protected void processTemplateC(String[] template, AmqpClass thisClass,
- AmqpMethod method)
- throws IOException, AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException
- {
- StringBuffer sb = new StringBuffer(template[templateStringIndex]);
- String filename = prepareFilename(getTemplateFileName(sb), thisClass, method, 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(globalVersionSet))
- {
- 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.versionSet)
- {
- StringBuffer nssb = new StringBuffer(namespaceSpan);
- processTemplate(nssb, thisClass, method, null, template[templateFileNameIndex], v);
- sb.insert(namespaceStartIndex, nssb);
- }
- // Process all tokens *not* within the namespace span prior to inserting namespaces
- processTemplate(sb, thisClass, method, null, template[templateFileNameIndex], 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[templateFileNameIndex], null);
- }
- writeTargetFile(sb, new File(genDir + Utils.fileSeparator + filename));
- generatedFileCounter ++;
- }
-
- @Override
- protected void processTemplateD(String[] template, AmqpClass thisClass, AmqpMethod method,
- AmqpField field)
- throws IOException, AmqpTemplateException, AmqpTypeMappingException, IllegalAccessException,
- InvocationTargetException
- {
- StringBuffer sb = new StringBuffer(template[templateStringIndex]);
- String filename = prepareFilename(getTemplateFileName(sb), thisClass, method, field);
- processTemplate(sb, thisClass, method, field, template[templateFileNameIndex], null);
- writeTargetFile(sb, new File(genDir + Utils.fileSeparator + filename));
- generatedFileCounter ++;
- }
-
- protected void processTemplate(StringBuffer sb, AmqpClass thisClass, AmqpMethod method,
- AmqpField field, String templateFileName, AmqpVersion version)
- throws InvocationTargetException, IllegalAccessException, AmqpTypeMappingException
- {
- 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)
- throws AmqpTemplateException, AmqpTypeMappingException
- {
- if (token.compareTo("${GENERATOR}") == 0)
- return generatorInfo;
- if (token.compareTo("${CLASS}") == 0 && thisClass != null)
- return thisClass.name;
- if (token.compareTo("${CLASS_ID_INIT}") == 0 && thisClass != null)
- {
- if (version == null)
- return String.valueOf(thisClass.indexMap.firstKey());
- return getIndex(thisClass.indexMap, version);
- }
- if (token.compareTo("${METHOD}") == 0 && method != null)
- return method.name;
- if (token.compareTo("${METHOD_ID_INIT}") == 0 && method != null)
- {
- if (version == null)
- return String.valueOf(method.indexMap.firstKey());
- return getIndex(method.indexMap, version);
- }
- if (token.compareTo("${FIELD}") == 0 && field != null)
- return field.name;
- 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.fieldMap.size() > 0 ? " buffer" : "";
- if (token.compareTo("${hv_latest_major}") == 0)
- return String.valueOf(globalVersionSet.last().getMajor());
- if (token.compareTo("${hv_latest_minor}") == 0)
- return String.valueOf(globalVersionSet.last().getMinor());
-
- throw new AmqpTemplateException("Template token " + token + " unknown.");
- }
-
- @Override
- protected void processClassList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpModel model)
- 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 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)
- 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 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)
- throws AmqpTypeMappingException, AmqpTemplateException, IllegalAccessException,
- InvocationTargetException
- {
- 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)
- 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 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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- for (AmqpConstant thisConstant : constantSet)
- {
- if (thisConstant.isVersionConsistent(globalVersionSet))
- {
- // return a constant
- String value = thisConstant.firstKey();
- sb.append(indent + "static const char* " + thisConstant.name + "() { return \"" +
- thisConstant.firstKey() + "\"; }" + cr);
- if (Utils.containsOnlyDigits(value))
- {
- sb.append(indent + "static int " + thisConstant.name + "AsInt() { return " +
- thisConstant.firstKey() + "; }" + cr);
- }
- if (Utils.containsOnlyDigitsAndDecimal(value))
- {
- sb.append(indent + "static double " + thisConstant.name + "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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- sb.append(indent + methodReturnType + " " + constant.name + 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.name, methodReturnType,
- indentSize + (2*tabSize), tabSize));
- }
- else if (methodReturnType.compareTo("double") == 0 && !Utils.containsOnlyDigitsAndDecimal(thisValue))
- {
- sb.append(generateConstantDeclarationException(constant.name, 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.name +
- "\\\" 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.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.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.methodMap.keySet())
- {
- AmqpMethod method = thisClass.methodMap.get(thisMethodName);
- boolean clientChassisFlag = method.clientMethodFlagMap.isSet();
- boolean serverChassisFlag = method.serverMethodFlagMap.isSet();
- if ((serverFlag && serverChassisFlag) || (!serverFlag && clientChassisFlag))
- chassisFoundFlag = true;
- }
- if (chassisFoundFlag)
- {
- sb.append(indent + "virtual AMQP_" + (serverFlag ? "Server" : "Client") + "Operations::" +
- thisClass.name + "Handler* get" + thisClass.name + "Handler() = 0;" + cr);
- }
- }
- return sb.toString();
- }
-
- protected String generateOpsInnerClasses(AmqpModel model, boolean serverFlag, int indentSize, int tabSize)
- throws AmqpTypeMappingException
- {
-
- 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.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.get(thisClassName);
- String handlerClassName = thisClass.name + "Handler";
- if (!first)
- sb.append(cr);
- sb.append(indent + "// ==================== class " + handlerClassName +
- " ====================" + cr);
- sb.append(indent + "class " + handlerClassName);
- if (thisClass.versionSet.size() != globalVersionSet.size())
- sb.append(" // AMQP Version(s) " + thisClass.versionSet + 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)
- throws AmqpTypeMappingException
- {
- 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.methodMap.keySet())
- {
- AmqpMethod method = thisClass.methodMap.get(thisMethodName);
- boolean clientChassisFlag = method.clientMethodFlagMap.isSet();
- boolean serverChassisFlag = method.serverMethodFlagMap.isSet();
- if ((serverFlag && serverChassisFlag) || (!serverFlag && clientChassisFlag))
- {
- String methodName = parseForReservedWords(method.name, outerClassName + "." + thisClass.name);
- AmqpOverloadedParameterMap overloadededParameterMap =
- method.getOverloadedParameterLists(thisClass.versionSet, 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() != globalVersionSet.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.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.get(thisClassName);
- sb.append(indent + outerClassName + "::" + thisClass.name + "Handler* " +
- thisClass.name + "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.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.get(thisClassName);
- sb.append(indent + "virtual inline " + outerClassName + "::" + thisClass.name + "Handler* get" +
- thisClass.name + "Handler() { return &" + Utils.firstLower(thisClass.name) + ";}" + 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.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.get(thisClassName);
- String instanceName = parseForReservedWords(Utils.firstLower(thisClass.name), outerClassName);
- String className = parseForReservedWords(thisClass.name, null);
- sb.append(indent + className + " " + instanceName + ";");
- if (thisClass.versionSet.size() != globalVersionSet.size())
- sb.append(" // AMQP Version(s) " + thisClass.versionSet + 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.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.get(thisClassName);
- String className = parseForReservedWords(thisClass.name, outerClassName);
- sb.append(indent + className + "& get" + className + "();");
- if (thisClass.versionSet.size() != globalVersionSet.size())
- sb.append(" // AMQP Version(s) " + thisClass.versionSet + cr);
- else
- sb.append(cr);
- }
- return sb.toString();
- }
-
- protected String generateProxyInnerClassDefinitions(AmqpModel model, boolean serverFlag,
- int indentSize, int tabSize)
- throws AmqpTypeMappingException
- {
- 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.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.get(thisClassName);
- String className = thisClass.name;
- String superclassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Operations::" +
- thisClass.name + "Handler";
- if (!first)
- sb.append(cr);
- sb.append(indent + "// ==================== class " + className +
- " ====================" + cr);
- sb.append(indent + "class " + className + " : virtual public " + superclassName);
- if (thisClass.versionSet.size() != globalVersionSet.size())
- sb.append(" // AMQP Version(s) " + thisClass.versionSet + 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.classMap.keySet().iterator();
- while (cItr.hasNext())
- {
- AmqpClass thisClass = model.classMap.get(cItr.next());
- String instanceName = parseForReservedWords(Utils.firstLower(thisClass.name), 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)
- throws AmqpTypeMappingException
- {
- 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.classMap.keySet().iterator();
- while (cItr.hasNext())
- {
- AmqpClass thisClass = model.classMap.get(cItr.next());
- String className = thisClass.name;
- String instanceName = parseForReservedWords(Utils.firstLower(thisClass.name), outerClassName);
- sb.append(indent + outerClassName + "::" + className + "& " +
- outerClassName + "::get" + className + "()" + cr);
- sb.append(indent + "{" + cr);
- if (thisClass.versionSet.size() != globalVersionSet.size())
- {
- sb.append(indent + tab + "if (!" + generateVersionCheck(thisClass.versionSet) + ")" + 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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- boolean firstClassFlag = true;
- for (String thisClassName : model.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.get(thisClassName);
- String className = thisClass.name;
- 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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- String outerclassName = "AMQP_" + (serverFlag ? "Server" : "Client") + "Proxy";
- boolean first = true;
- for (String thisMethodName : thisClass.methodMap.keySet())
- {
- AmqpMethod method = thisClass.methodMap.get(thisMethodName);
- String methodBodyClassName = thisClass.name + Utils.firstUpper(method.name) + "Body";
- boolean clientChassisFlag = method.clientMethodFlagMap.isSet();
- boolean serverChassisFlag = method.serverMethodFlagMap.isSet();
- boolean versionConsistentFlag = method.isVersionConsistent(globalVersionSet);
- if ((serverFlag && serverChassisFlag) || (!serverFlag && clientChassisFlag))
- {
- String methodName = parseForReservedWords(method.name, outerclassName + "." + thisClass.name);
- AmqpOverloadedParameterMap overloadededParameterMap =
- method.getOverloadedParameterLists(thisClass.versionSet, this);
- for (AmqpOrdinalFieldMap thisFieldMap : overloadededParameterMap.keySet())
- {
- AmqpVersionSet versionSet = overloadededParameterMap.get(thisFieldMap);
- if (!first)
- sb.append(cr);
- sb.append(indent + "void " + outerclassName + "::" + thisClass.name + "::" +
- methodName + "( u_int16_t channel");
- sb.append(generateMethodParameterList(thisFieldMap, indentSize + (5*tabSize), true, true, true));
- sb.append(" )");
- if (versionSet.size() != globalVersionSet.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)
- throws AmqpTypeMappingException
- {
- 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)
- throws AmqpTypeMappingException
- {
- 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 : model.classMap.keySet())
- {
- thisClass = model.classMap.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.methodMap.keySet())
- {
- AmqpMethod method = thisClass.methodMap.get(thisMethodName);
- sb.append(indent + "#include <" + thisClass.name +
- Utils.firstUpper(method.name) + "Body.h>" + cr);
- }
- return sb.toString();
- }
-
- // Methods used for generation of code snippets for MethodBody class generation
-
- protected String getIndex(AmqpOrdinalVersionMap indexMap, AmqpVersion version)
- throws AmqpTemplateException
- {
- 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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
-
- if (version == null)
- version = globalVersionSet.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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
-
- if (version == null)
- version = globalVersionSet.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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
-
- if (version == null)
- version = globalVersionSet.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)
- throws AmqpTypeMappingException
- {
- 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 ? globalVersionSet.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)
- throws AmqpTypeMappingException
- {
- 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 ? globalVersionSet.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)
- throws AmqpTypeMappingException
- {
- 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 ? globalVersionSet.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)
- throws AmqpTypeMappingException
- {
- 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)
- throws AmqpTypeMappingException
- {
- 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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- if (method.fieldMap.size() > 0)
- {
- sb.append(indent + thisClass.name + Utils.firstUpper(method.name) + "Body(ProtocolVersion& version," + cr);
- sb.append(generateFieldList(method.fieldMap, version, true, false, 8));
- sb.append(indent + tab + ") :" + cr);
- sb.append(indent + tab + "AMQMethodBody(version)," + cr);
- sb.append(generateFieldList(method.fieldMap, version, false, true, 8));
- sb.append(indent + "{ }" + cr);
- }
- return sb.toString();
- }
-
- protected String generateServerOperationsInvoke(AmqpClass thisClass, AmqpMethod method,
- AmqpVersion version, int indentSize, int tabSize)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
-
- if (method.serverMethodFlagMap.size() > 0) // At least one AMQP version defines this method as a server method
- {
- Iterator<Boolean> bItr = method.serverMethodFlagMap.keySet().iterator();
- while (bItr.hasNext())
- {
- if (bItr.next()) // This is a server operation
- {
- boolean fieldMapNotEmptyFlag = method.fieldMap.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.name + "Handler()->" +
- parseForReservedWords(Utils.firstLower(method.name),
- thisClass.name + Utils.firstUpper(method.name) + "Body.invoke()") + "(channel");
- if (fieldMapNotEmptyFlag)
- {
- sb.append("," + cr);
- sb.append(generateFieldList(method.fieldMap, 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.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.get(thisClassName);
- for (String thisMethodName : thisClass.methodMap.keySet())
- {
- AmqpMethod method = thisClass.methodMap.get(thisMethodName);
- sb.append(indent + "#include \"" + thisClass.name + Utils.firstUpper(method.name) + "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.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.get(thisClassName);
- for (String thisMethodName : thisClass.methodMap.keySet())
- {
- AmqpMethod method = thisClass.methodMap.get(thisMethodName);
- sb.append(indent + "const " + thisClass.name + Utils.firstUpper(method.name) + "Body " +
- Utils.firstLower(thisClass.name) + "_" + method.name + ";" + cr);
- }
- }
-
- return sb.toString();
- }
-
- protected String generateMethodBodyMapEntry(AmqpModel model, int indentSize)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
-
- for (AmqpVersion version : globalVersionSet)
- {
- for (String thisClassName : model.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.get(thisClassName);
- for (String thisMethodName : thisClass.methodMap.keySet())
- {
- AmqpMethod method = thisClass.methodMap.get(thisMethodName);
- String namespace = method.isVersionConsistent(globalVersionSet) ? "" : version.namespace() + "::";
- try
- {
- int classOrdinal = thisClass.indexMap.getOrdinal(version);
- int methodOrdinal = method.indexMap.getOrdinal(version);
- String methodModyClassName = namespace + thisClass.name + Utils.firstUpper(method.name) + "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)
- throws AmqpTypeMappingException
- {
- 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();
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/DotnetGenerator.java b/Final/gentools/src/org/apache/qpid/gentools/DotnetGenerator.java
deleted file mode 100644
index bd49315241..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/DotnetGenerator.java
+++ /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.
- *
- */
-
-package org.apache.qpid.gentools;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-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 DotnetGenerator(AmqpVersionSet versionList)
- {
- super(versionList);
- // 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
- }
-
- @Override
- protected String prepareFilename(String filenameTemplate,
- AmqpClass thisClass, AmqpMethod method, AmqpField field)
- {
- StringBuffer sb = new StringBuffer(filenameTemplate);
- if (thisClass != null)
- replaceToken(sb, "${CLASS}", thisClass.name);
- if (method != null)
- replaceToken(sb, "${METHOD}", method.name);
- if (field != null)
- replaceToken(sb, "${FIELD}", field.name);
- return sb.toString();
- }
-
- @Override
- protected void processClassList(StringBuffer sb, int listMarkerStartIndex,
- int listMarkerEndIndex, AmqpModel model)
- 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)
- throws AmqpTypeMappingException, AmqpTemplateException,
- IllegalAccessException, InvocationTargetException
- {
- 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 processTemplateA(String[] template) throws IOException,
- AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException
- {
- // I've put in the Java model here - this can be changed if a different pattern is required.
- processTemplateD(template, null, null, null);
- }
-
- @Override
- protected void processTemplateB(String[] template, AmqpClass thisClass)
- throws IOException, AmqpTemplateException,
- AmqpTypeMappingException, IllegalAccessException,
- InvocationTargetException
- {
- // I've put in the Java model here - this can be changed if a different pattern is required.
- processTemplateD(template, thisClass, null, null);
- }
-
- @Override
- protected void processTemplateC(String[] template, AmqpClass thisClass,
- AmqpMethod method) throws IOException, AmqpTemplateException,
- AmqpTypeMappingException, IllegalAccessException,
- InvocationTargetException
- {
- // I've put in the Java model here - this can be changed if a different pattern is required.
- processTemplateD(template, thisClass, method, null);
- }
-
- @Override
- protected void processTemplateD(String[] template, AmqpClass thisClass,
- AmqpMethod method, AmqpField field) throws IOException,
- AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException
- {
- // I've put in the Java model here - this can be changed if a different pattern is required.
- StringBuffer sb = new StringBuffer(template[1]);
- String filename = prepareFilename(getTemplateFileName(sb), thisClass, method, field);
- try { processAllLists(sb, thisClass, method, null); }
- catch (AmqpTemplateException e)
- {
- System.out.println("WARNING: " + template[templateFileNameIndex] + ": " + e.getMessage());
- }
- try { processAllTokens(sb, thisClass, method, field, null); }
- catch (AmqpTemplateException e)
- {
- System.out.println("WARNING: " + template[templateFileNameIndex] + ": " + e.getMessage());
- }
- writeTargetFile(sb, new File(genDir + Utils.fileSeparator + 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 getDomainType(String domainName, AmqpVersion version)
- throws AmqpTypeMappingException
- {
- return globalDomainMap.getDomainType(domainName, version);
- }
-
- public String getGeneratedType(String domainName, AmqpVersion version)
- throws AmqpTypeMappingException
- {
- String domainType = globalDomainMap.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();
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/Generator.java b/Final/gentools/src/org/apache/qpid/gentools/Generator.java
deleted file mode 100644
index e7ccd64fbe..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/Generator.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.LineNumberReader;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-
-public abstract class Generator implements LanguageConverter
-{
- protected static String cr = Utils.lineSeparator;
- protected static enum EnumConstOutputTypes { OUTPUT_STRING, OUTPUT_INTEGER, OUTPUT_DOUBLE; };
-
- // This string is reproduced in every generated file as a comment
- // TODO: Tie the version info into the build system.
- protected static final String generatorInfo = "Qpid Gentools v.0.1";
- protected static final int templateFileNameIndex = 0;
- protected static final int templateStringIndex = 1;
-
- protected ArrayList<String[]> modelTemplateList;
- protected ArrayList<String[]> classTemplateList;
- protected ArrayList<String[]> methodTemplateList;
- protected ArrayList<String[]> fieldTemplateList;
- protected String genDir;
-
- protected AmqpVersionSet globalVersionSet;
- protected AmqpDomainMap globalDomainMap;
- protected AmqpConstantSet globalConstantSet;
- protected AmqpModel model;
-
- protected int generatedFileCounter;
-
- public Generator(AmqpVersionSet versionList)
- {
- this.globalVersionSet = versionList;
- modelTemplateList = new ArrayList<String[]>();
- classTemplateList = new ArrayList<String[]>();
- methodTemplateList = new ArrayList<String[]>();
- fieldTemplateList = new ArrayList<String[]>();
- generatedFileCounter = 0;
- }
-
- public int getNumberGeneratedFiles()
- {
- return generatedFileCounter;
- }
-
- public void setDomainMap(AmqpDomainMap domainMap)
- {
- this.globalDomainMap = domainMap;
- }
-
- public AmqpDomainMap getDomainMap()
- {
- return globalDomainMap;
- }
-
- public void setConstantSet(AmqpConstantSet constantSet)
- {
- this.globalConstantSet = constantSet;
- }
-
- public AmqpConstantSet getConstantSet()
- {
- return globalConstantSet;
- }
-
- public void setModel(AmqpModel model)
- {
- this.model = model;
- }
-
- public AmqpModel getModel()
- {
- return model;
- }
-
- public void initializeTemplates(File[] modelTemplateFiles, File[] classTemplatesFiles,
- File[] methodTemplatesFiles, File[] fieldTemplatesFiles)
- throws FileNotFoundException, IOException
- {
- if (modelTemplateFiles.length > 0)
- {
- System.out.println("Model template file(s):");
- for (File mtf : modelTemplateFiles)
- {
- System.out.println(" " + mtf.getAbsolutePath());
- String template[] = {mtf.getName(), loadTemplate(mtf)};
- modelTemplateList.add(template);
- }
- }
- if (classTemplatesFiles.length > 0)
- {
- System.out.println("Class template file(s):");
- //for (int c=0; c<classTemplatesFiles.length; c++)
- for (File ctf : classTemplatesFiles)
- {
- System.out.println(" " + ctf.getAbsolutePath());
- String template[] = {ctf.getName(), loadTemplate(ctf)};
- classTemplateList.add(template);
- }
- }
- if (methodTemplatesFiles.length > 0)
- {
- System.out.println("Method template file(s):");
- for (File mtf : methodTemplatesFiles)
- {
- System.out.println(" " + mtf.getAbsolutePath());
- String template[] = {mtf.getName(), loadTemplate(mtf)};
- methodTemplateList.add(template);
- }
- }
- if (fieldTemplatesFiles.length > 0)
- {
- System.out.println("Field template file(s):");
- for (File ftf : fieldTemplatesFiles)
- {
- System.out.println(" " + ftf.getAbsolutePath());
- String template[] = {ftf.getName(), loadTemplate(ftf)};
- fieldTemplateList.add(template);
- }
- }
- }
-
- abstract protected String prepareFilename(String filenameTemplate, AmqpClass thisClass, AmqpMethod method,
- AmqpField field);
-
- abstract protected String processToken(String token, AmqpClass thisClass, AmqpMethod method,
- AmqpField field, AmqpVersion version)
- throws AmqpTemplateException, AmqpTypeMappingException;
-
- abstract protected void processClassList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpModel model)
- throws AmqpTemplateException, AmqpTypeMappingException;
-
- abstract protected void processMethodList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpClass thisClass)
- throws AmqpTemplateException, AmqpTypeMappingException;
-
- abstract protected void processFieldList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpFieldMap fieldMap, AmqpVersion version)
- throws AmqpTypeMappingException, AmqpTemplateException, IllegalAccessException,
- InvocationTargetException;
-
- abstract protected void processConstantList(StringBuffer sb, int listMarkerStartIndex, int listMarkerEndIndex,
- AmqpConstantSet constantSet)
- throws AmqpTemplateException, AmqpTypeMappingException;
-
- public void generate(File genDir)
- throws TargetDirectoryException, IOException, AmqpTypeMappingException,
- AmqpTemplateException, IllegalAccessException, InvocationTargetException
- {
- prepareTargetDirectory(genDir, true);
- System.out.println("Generation directory: " + genDir.getAbsolutePath());
- this.genDir = genDir.getAbsolutePath();
-
- // Use all model-level templates
- for (String[] mt : modelTemplateList)
- {
- processTemplateA(mt);
- }
-
- // Cycle through classes
- for (String className : model.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.get(className);
- // Use all class-level templates
- for (String[] ct : classTemplateList)
- {
- processTemplateB(ct, thisClass);
- }
-
- // Cycle through all methods
- for (String methodName : thisClass.methodMap.keySet())
- {
- AmqpMethod method = thisClass.methodMap.get(methodName);
- // Use all method-level templates
- for (String[] mt : methodTemplateList)
- {
- processTemplateC(mt, thisClass, method);
- }
-
- // Cycle through all fields
- for (String fieldName : method.fieldMap.keySet())
- {
- AmqpField field = method.fieldMap.get(fieldName);
- // Use all field-level templates
- for (String[] ft : fieldTemplateList)
- {
- processTemplateD(ft, thisClass, method, field);
- }
- }
- }
- }
- }
-
- protected void processVersionList(StringBuffer sb, int tokStart, int tokEnd)
- throws AmqpTypeMappingException
- {
- int lend = sb.indexOf(Utils.lineSeparator, 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 : globalVersionSet)
- {
- // Insert copy of target line
- StringBuffer isb = new StringBuffer(tline);
- if (isb.indexOf("${protocol-version-list-entry}") >= 0)
- {
- String versionListEntry = " { ${major}, ${minor} }" +
- (v.equals(globalVersionSet.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();
- }
- }
-
- // Model-level template processing
- abstract protected void processTemplateA(String[] template)
- throws IOException, AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException;
-
- // Class-level template processing
- abstract protected void processTemplateB(String[] template, AmqpClass thisClass)
- throws IOException, AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException;
-
- // Method-level template processing
- abstract protected void processTemplateC(String[] template, AmqpClass thisClass,
- AmqpMethod method)
- throws IOException, AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException;
-
- // Field-level template processing
- abstract protected void processTemplateD(String[] template, AmqpClass thisClass,
- AmqpMethod method, AmqpField field)
- throws IOException, AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException;
-
- // Helper functions common to all generators
-
- protected static void prepareTargetDirectory(File dir, boolean createFlag)
- throws TargetDirectoryException
- {
- 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)
- throws AmqpTemplateException, AmqpTypeMappingException, IllegalAccessException,
- InvocationTargetException
- {
- 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);
- }
- 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.fieldMap : method.fieldMap),
- version);
- }
- else if (listToken.compareTo("TLIST") == 0)
- {
- processConstantList(sb, lstart, lend + 1, globalConstantSet);
- }
- 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)
- throws AmqpTemplateException, AmqpTypeMappingException
- {
- 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)
- throws IOException
- {
- FileWriter fw = new FileWriter(f);
- fw.write(sb.toString().toCharArray());
- fw.flush();
- fw.close();
- }
-
- protected static String getTemplateFileName(StringBuffer sb)
- throws AmqpTemplateException
- {
- if (sb.charAt(0) != '&')
- throw new AmqpTemplateException("No filename marker &{filename} found at start of template.");
- int cr = sb.indexOf(Utils.lineSeparator);
- 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);
- 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)
- throws FileNotFoundException, IOException
- {
- StringBuffer sb = new StringBuffer();
- FileReader fr = new FileReader(f);
- LineNumberReader lnr = new LineNumberReader(fr);
- String line = lnr.readLine();
- while (line != null)
- {
- // Strip lines starting with '#' in template - treat these lines as template comments
-// if (line.length() > 0 && line.charAt(0) != '#') // Bad idea - '#' used in C/C++ files (#include)!
- if (line.length() > 0)
- sb.append(line + Utils.lineSeparator);
- else
- sb.append(Utils.lineSeparator);
- line = lnr.readLine();
- }
- lnr.close();
- fr.close();
- return sb.toString();
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/JavaGenerator.java b/Final/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
deleted file mode 100644
index 84d06cf204..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/JavaGenerator.java
+++ /dev/null
@@ -1,1694 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Iterator;
-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
- {
- 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>();
-
- // Methods used for generation of code snippets called from the field map parsers
-
- // Common methods
- static private Method declarationGenerateMethod;
- static private Method mangledDeclarationGenerateMethod;
-
- // Methods for MessageBody classes
- static private Method mbGetGenerateMethod;
- static private Method mbMangledGetGenerateMethod;
- static private Method mbParamListGenerateMethod;
- static private Method mbPassedParamListGenerateMethod;
- static private Method mbMangledParamListGenerateMethod;
- static private Method mbMangledPassedParamListGenerateMethod;
- static private Method mbBodyInitGenerateMethod;
- static private Method mbMangledBodyInitGenerateMethod;
- static private Method mbSizeGenerateMethod;
- static private Method mbBitSizeGenerateMethod;
- static private Method mbEncodeGenerateMethod;
- static private Method mbBitEncodeGenerateMethod;
- static private Method mbDecodeGenerateMethod;
- static private Method mbBitDecodeGenerateMethod;
- static private Method mbToStringGenerateMethod;
- static private Method mbBitToStringGenerateMethod;
-
- // Methods for PropertyContentHeader classes
- static private Method pchClearGenerateMethod;
- static private Method pchMangledClearGenerateMethod;
- static private Method pchGetGenerateMethod;
- static private Method pchMangledGetGenerateMethod;
- static private Method pchSetGenerateMethod;
- static private Method pchMangledSetGenerateMethod;
- static private Method pchSizeGenerateMethod;
- static private Method pchBitSizeGenerateMethod;
- static private Method pchEncodeGenerateMethod;
- static private Method pchBitEncodeGenerateMethod;
- static private Method pchDecodeGenerateMethod;
- static private Method pchBitDecodeGenerateMethod;
- static private Method pchGetPropertyFlagsGenerateMethod;
- static private Method pchBitGetPropertyFlagsGenerateMethod;
- static private Method pchSetPropertyFlagsGenerateMethod;
- static private Method pchBitSetPropertyFlagsGenerateMethod;
-
- static
- {
- // **************
- // Common methods
- // **************
-
- // Methods for AmqpFieldMap.parseFieldMap()
-
- try { declarationGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateFieldDeclaration", String.class, AmqpField.class,
- AmqpVersionSet.class, int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mangledDeclarationGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMangledFieldDeclaration", AmqpField.class,
- int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
-
- // *******************************
- // Methods for MessageBody classes
- // *******************************
-
- // Methods for AmqpFieldMap.parseFieldMap()
-
- try { mbGetGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbGetMethod", String.class, AmqpField.class,
- AmqpVersionSet.class, int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbMangledGetGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbMangledGetMethod", AmqpField.class,
- int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbParamListGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbParamList", String.class, AmqpField.class,
- AmqpVersionSet.class, int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
-
- try { mbPassedParamListGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbPassedParamList", String.class, AmqpField.class,
- AmqpVersionSet.class, int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbMangledParamListGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbMangledParamList", AmqpField.class,
- int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbMangledPassedParamListGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbMangledPassedParamList", AmqpField.class,
- int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbBodyInitGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbBodyInit", String.class, AmqpField.class,
- AmqpVersionSet.class, int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbMangledBodyInitGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbMangledBodyInit", AmqpField.class,
- int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- // Methods for AmqpFieldMap.parseFieldMapOrdinally()
-
- try { mbSizeGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbFieldSize", String.class, String.class,
- int.class, int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbBitSizeGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbBitArrayFieldSize", ArrayList.class, int.class,
- int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbEncodeGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbFieldEncode", String.class, String.class,
- int.class, int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbBitEncodeGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbBitFieldEncode", ArrayList.class, int.class,
- int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbDecodeGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbFieldDecode", String.class, String.class,
- int.class, int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbBitDecodeGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbBitFieldDecode", ArrayList.class, int.class,
- int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbToStringGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbFieldToString", String.class, String.class,
- int.class, int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { mbBitToStringGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generateMbBitFieldToString", ArrayList.class, int.class,
- int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- // *****************************************
- // Methods for PropertyContentHeader classes
- // *****************************************
-
- // Methods for AmqpFieldMap.parseFieldMap()
-
- try { pchClearGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchClearMethod", String.class, AmqpField.class,
- AmqpVersionSet.class, int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchMangledClearGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchMangledClearMethod", AmqpField.class,
- int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchSetGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchSetMethod", String.class, AmqpField.class,
- AmqpVersionSet.class, int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchMangledSetGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchMangledSetMethod", AmqpField.class,
- int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchGetGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchGetMethod", String.class, AmqpField.class,
- AmqpVersionSet.class, int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchMangledGetGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchMangledGetMethod", AmqpField.class,
- int.class, int.class, boolean.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- // Methods for AmqpFieldMap.parseFieldMapOrdinally()
-
- try { pchSizeGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchFieldSize", String.class, String.class,
- int.class, int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchBitSizeGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchBitArrayFieldSize", ArrayList.class, int.class,
- int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchEncodeGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchFieldEncode", String.class, String.class,
- int.class, int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchBitEncodeGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchBitFieldEncode", ArrayList.class, int.class,
- int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchDecodeGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchFieldDecode", String.class, String.class,
- int.class, int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchBitDecodeGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchBitFieldDecode", ArrayList.class, int.class,
- int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchGetPropertyFlagsGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchGetPropertyFlags", String.class, String.class,
- int.class, int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchBitGetPropertyFlagsGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchBitGetPropertyFlags", ArrayList.class, int.class,
- int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchSetPropertyFlagsGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchSetPropertyFlags", String.class, String.class,
- int.class, int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
-
- try { pchBitSetPropertyFlagsGenerateMethod = JavaGenerator.class.getDeclaredMethod(
- "generatePchBitSetPropertyFlags", ArrayList.class, int.class,
- int.class, int.class); }
- catch (NoSuchMethodException e) { e.printStackTrace(); }
- }
-
- public JavaGenerator(AmqpVersionSet versionList)
- {
- super(versionList);
- // 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
- "EncodingUtils.writeBooleans(buffer, #)", // encode expression
- "# = EncodingUtils.readBooleans(buffer)")); // decode expression
- typeMap.put("content", new DomainInfo(
- "Content", // Java code type
- "EncodingUtils.encodedContentLength(#)", // size
- "EncodingUtils.writeContentBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readContent(buffer)")); // decode expression
- typeMap.put("long", new DomainInfo(
- "long", // Java code type
- "4", // size
- "EncodingUtils.writeUnsignedInteger(buffer, #)", // encode expression
- "# = buffer.getUnsignedInt()")); // decode expression
- typeMap.put("longlong", new DomainInfo(
- "long", // Java code type
- "8", // size
- "buffer.putLong(#)", // encode expression
- "# = buffer.getLong()")); // decode expression
- typeMap.put("longstr", new DomainInfo(
- "byte[]", // Java code type
- "EncodingUtils.encodedLongstrLength(#)", // size
- "EncodingUtils.writeLongStringBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readLongstr(buffer)")); // decode expression
- typeMap.put("octet", new DomainInfo(
- "short", // Java code type
- "1", // size
- "EncodingUtils.writeUnsignedByte(buffer, #)", // encode expression
- "# = buffer.getUnsigned()")); // decode expression
- typeMap.put("short", new DomainInfo(
- "int", // Java code type
- "2", // size
- "EncodingUtils.writeUnsignedShort(buffer, #)", // encode expression
- "# = buffer.getUnsignedShort()")); // decode expression
- typeMap.put("shortstr", new DomainInfo(
- "AMQShortString", // Java code type
- "EncodingUtils.encodedShortStringLength(#)", // size
- "EncodingUtils.writeShortStringBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readAMQShortString(buffer)")); // decode expression
- typeMap.put("table", new DomainInfo(
- "FieldTable", // Java code type
- "EncodingUtils.encodedFieldTableLength(#)", // size
- "EncodingUtils.writeFieldTableBytes(buffer, #)", // encode expression
- "# = EncodingUtils.readFieldTable(buffer)")); // decode expression
- typeMap.put("timestamp", new DomainInfo(
- "long", // Java code type
- "8", // size
- "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 getDomainType(String domainName, AmqpVersion version)
- throws AmqpTypeMappingException
- {
- return globalDomainMap.getDomainType(domainName, version);
- }
-
- public String getGeneratedType(String domainName, AmqpVersion version)
- throws AmqpTypeMappingException
- {
- String domainType = globalDomainMap.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)
- {
- StringBuffer sb = new StringBuffer(filenameTemplate);
- if (thisClass != null)
- replaceToken(sb, "${CLASS}", thisClass.name);
- if (method != null)
- replaceToken(sb, "${METHOD}", method.name);
- if (field != null)
- replaceToken(sb, "${FIELD}", field.name);
- return sb.toString();
- }
-
- @Override
- protected void processTemplateA(String[] template)
- throws IOException, AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException
- {
- processTemplateD(template, null, null, null);
- }
-
- @Override
- protected void processTemplateB(String[] template, AmqpClass thisClass)
- throws IOException, AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException
- {
- processTemplateD(template, thisClass, null, null);
- }
-
- @Override
- protected void processTemplateC(String[] template, AmqpClass thisClass,
- AmqpMethod method)
- throws IOException, AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException
- {
- processTemplateD(template, thisClass, method, null);
- }
-
- @Override
- protected void processTemplateD(String[] template, AmqpClass thisClass,
- AmqpMethod method, AmqpField field)
- throws IOException, AmqpTemplateException, AmqpTypeMappingException,
- IllegalAccessException, InvocationTargetException
- {
- StringBuffer sb = new StringBuffer(template[1]);
- String filename = prepareFilename(getTemplateFileName(sb), thisClass, method, field);
- processTemplate(sb, thisClass, method, field, template[templateFileNameIndex], null);
- writeTargetFile(sb, new File(genDir + Utils.fileSeparator + filename));
- generatedFileCounter ++;
- }
-
- protected void processTemplate(StringBuffer sb, AmqpClass thisClass, AmqpMethod method,
- AmqpField field, String templateFileName, AmqpVersion version)
- throws InvocationTargetException, IllegalAccessException, AmqpTypeMappingException
- {
- 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)
- throws AmqpTemplateException, AmqpTypeMappingException
- {
- if (token.compareTo("${GENERATOR}") == 0)
- return generatorInfo;
- if (token.compareTo("${CLASS}") == 0 && thisClass != null)
- return thisClass.name;
- if (token.compareTo("${CLASS_ID_INIT}") == 0 && thisClass != null)
- return generateIndexInitializer("registerClassId", thisClass.indexMap, 8);
- if (token.compareTo("${METHOD}") == 0 && method != null)
- return method.name;
- if (token.compareTo("${METHOD_ID_INIT}") == 0 && method != null)
- return generateIndexInitializer("registerMethodId", method.indexMap, 8);
- if (token.compareTo("${FIELD}") == 0 && field != null)
- return field.name;
-
- // 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.fieldMap.size() : method.fieldMap.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)
- 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);
-
- 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)
- 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 - 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)
- throws AmqpTypeMappingException, AmqpTemplateException, IllegalAccessException,
- InvocationTargetException
- {
- 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)
- 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);
-
- 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.name +
- "; // AMQP version(s): " + versionSet + cr;
- }
-
- protected String generateMangledFieldDeclaration(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- throws AmqpTypeMappingException
- {
- StringBuffer sb = new StringBuffer();
- Iterator<String> dItr = field.domainMap.keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- String domainName = dItr.next();
- AmqpVersionSet versionSet = field.domainMap.get(domainName);
- String codeType = getGeneratedType(domainName, versionSet.first());
- sb.append(Utils.createSpaces(indentSize) + "public " + codeType + " " +
- field.name + "_" + (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.classMap.keySet())
- {
- AmqpClass thisClass = model.classMap.get(className);
- for (String methodName : thisClass.methodMap.keySet())
- {
- AmqpMethod method = thisClass.methodMap.get(methodName);
- for (AmqpVersion version : globalVersionSet)
- {
- // Find class and method index for this version (if it exists)
- try
- {
- int classIndex = findIndex(thisClass.indexMap, version);
- int methodIndex = findIndex(method.indexMap, 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.name) +
- Utils.firstUpper(method.name) + "Body.getFactory());" + cr);
- }
- catch (Exception e) {} // Ignore
- }
- }
- }
- return sb.toString();
- }
-
- protected int findIndex(TreeMap<Integer, AmqpVersionSet> map, AmqpVersion version)
- throws Exception
- {
- 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 Exception("Index not found");
- }
-
- // Methods for AmqpConstants class
-
- protected String generateConstantGetMethods(AmqpConstantSet constantSet,
- int indentSize, int tabSize)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- StringBuffer sb = new StringBuffer();
- Iterator<AmqpConstant> cItr = constantSet.iterator();
- while (cItr.hasNext())
- {
- AmqpConstant constant = cItr.next();
- if (constant.isVersionConsistent(globalVersionSet))
- {
- // return a constant
- String value = constant.firstKey();
- sb.append(indent + "public static String " + constant.name + "() { return \"" +
- constant.firstKey() + "\"; }" + cr);
- if (Utils.containsOnlyDigits(value))
- {
- sb.append(indent + "public static int " + constant.name + "AsInt() { return " +
- constant.firstKey() + "; }" + cr);
- }
- if (Utils.containsOnlyDigitsAndDecimal(value))
- {
- sb.append(indent + "public static double " + constant.name + "AsDouble() { return (double)" +
- 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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- sb.append(indent + "public static " + methodReturnType + " " + constant.name +
- 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.name, methodReturnType,
- indentSize + (2*tabSize), tabSize));
- }
- else if (methodReturnType.compareTo("double") == 0 && !Utils.containsOnlyDigitsAndDecimal(value))
- {
- sb.append(generateConstantDeclarationException(constant.name, 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.name + "\\\" \" +" + 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.name) + "() { return " + field.name + "; }" +
- cr;
- }
-
- protected String generateMbMangledGetMethod(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- throws AmqpTypeMappingException
- {
- 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.name) +
- "(Class<T> classObj) throws AMQProtocolVersionException" + cr);
- sb.append(indent + "{" + cr);
- Iterator<String> dItr = field.domainMap.keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- String domainName = dItr.next();
- AmqpVersionSet versionSet = field.domainMap.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.name + "_" +
- (domainCntr++) + ";" + cr);
- }
- sb.append(indent + tab +
- "throw new AMQProtocolVersionException(\"None of the AMQP versions defines \" +" +
- cr + " \"field \\\"" + field.name +
- "\\\" 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.name +
- (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.name +
- (nextFlag ? "," : "") + " // AMQP version(s): " + versionSet + cr;
- }
-
-
- protected String generateMbMangledParamList(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- throws AmqpTypeMappingException
- {
- StringBuffer sb = new StringBuffer();
- Iterator<String> dItr = field.domainMap.keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- String domainName = dItr.next();
- AmqpVersionSet versionSet = field.domainMap.get(domainName);
- String codeType = getGeneratedType(domainName, versionSet.first());
- sb.append(Utils.createSpaces(indentSize) + codeType + " " + field.name + "_" +
- (domainCntr++) + (nextFlag ? "," : "") + " // AMQP version(s): " +
- versionSet + cr);
- }
- return sb.toString();
- }
-
- protected String generateMbMangledPassedParamList(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- throws AmqpTypeMappingException
- {
- StringBuffer sb = new StringBuffer();
- Iterator<String> dItr = field.domainMap.keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- String domainName = dItr.next();
- AmqpVersionSet versionSet = field.domainMap.get(domainName);
- sb.append(Utils.createSpaces(indentSize) + field.name + "_" +
- (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.name + " = " + field.name +
- ";" + cr;
- }
-
- protected String generateMbMangledBodyInit(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- throws AmqpTypeMappingException
- {
- StringBuffer sb = new StringBuffer();
- Iterator<String> dItr = field.domainMap.keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- dItr.next();
- sb.append(Utils.createSpaces(indentSize) + "this." + field.name + "_" + domainCntr +
- " = " + field.name + "_" + (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(ArrayList<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(ArrayList<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(ArrayList<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(ArrayList<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)
- throws AmqpTypeMappingException
- {
- // 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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- sb.append(indent + "public void clear" + Utils.firstUpper(field.name) +
- "()" + 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.ordinalMap.size() == 1 &&
- field.ordinalMap.get(field.ordinalMap.firstKey()).size() == globalVersionSet.size())
- {
- int ordinal = field.ordinalMap.firstKey();
- sb.append(indent + tab + "clearEncodedForm();" + cr);
- sb.append(indent + tab + "propertyFlags[" + ordinal + "] = false;" + cr);
- }
- else
- {
- Iterator<Integer> oItr = field.ordinalMap.keySet().iterator();
- while (oItr.hasNext())
- {
- int ordinal = oItr.next();
- AmqpVersionSet versionSet = field.ordinalMap.get(ordinal);
- sb.append(indent + tab);
- if (ordinal != field.ordinalMap.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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer(indent + "public " + codeType + " get" +
- Utils.firstUpper(field.name) + "()" + cr);
- sb.append(indent + "{" + cr);
- sb.append(indent + tab + "decodeIfNecessary();" + cr);
- sb.append(indent + tab + "return " + field.name + ";" + cr);
- sb.append(indent + "}" + cr);
- sb.append(cr);
- return sb.toString();
- }
-
- protected String generatePchMangledGetMethod(AmqpField field, int indentSize,
- int tabSize, boolean nextFlag)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer(indent + "public <T> T get" +
- Utils.firstUpper(field.name) +
- "(Class<T> classObj) throws AMQProtocolVersionException" + cr);
- sb.append(indent + "{" + cr);
- Iterator<String> dItr = field.domainMap.keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- String domainName = dItr.next();
- AmqpVersionSet versionSet = field.domainMap.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.name + "_" +
- (domainCntr++) + ";" + cr);
- sb.append(indent + tab + "}" + cr);
- }
- sb.append(indent + tab +
- "throw new AMQProtocolVersionException(\"None of the AMQP versions defines \" +" +
- cr + " \"field \\\"" + field.name +
- "\\\" 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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
- sb.append(indent + "public void set" + Utils.firstUpper(field.name) +
- "(" + codeType + " " + field.name + ")" + 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.ordinalMap.size() == 1 &&
- field.ordinalMap.get(field.ordinalMap.firstKey()).size() == globalVersionSet.size())
- {
- int ordinal = field.ordinalMap.firstKey();
- sb.append(indent + tab + "clearEncodedForm();" + cr);
- sb.append(indent + tab + "propertyFlags[" + ordinal + "] = true;" + cr);
- sb.append(indent + tab + "this." + field.name + " = " + field.name + ";" + cr);
- }
- else
- {
- Iterator<Integer> oItr = field.ordinalMap.keySet().iterator();
- while (oItr.hasNext())
- {
- int ordinal = oItr.next();
- AmqpVersionSet oVersionSet = field.ordinalMap.get(ordinal);
- sb.append(indent + tab);
- if (ordinal != field.ordinalMap.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.name + " = " + field.name + ";" + 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)
- throws AmqpTypeMappingException
- {
- String indent = Utils.createSpaces(indentSize);
- String tab = Utils.createSpaces(tabSize);
- StringBuffer sb = new StringBuffer();
-
- Iterator<String> dItr = field.domainMap.keySet().iterator();
- int domainCntr = 0;
- while (dItr.hasNext())
- {
- String domainName = dItr.next();
- AmqpVersionSet versionSet = field.domainMap.get(domainName);
- String codeType = getGeneratedType(domainName, versionSet.first());
-
- // Find ordinal with matching version
- AmqpVersionSet commonVersionSet = new AmqpVersionSet();
- Iterator<Integer> oItr = field.ordinalMap.keySet().iterator();
- while (oItr.hasNext())
- {
- int ordinal = oItr.next();
- AmqpVersionSet oVersionSet = field.ordinalMap.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.name) +
- "(" + codeType + " " + field.name + ")" + 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.name + "_" + (domainCntr++) +
- " = " + field.name + ";" + 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(ArrayList<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(ArrayList<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(ArrayList<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(ArrayList<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(ArrayList<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 = globalVersionSet.iterator();
- while (vItr.hasNext())
- {
- AmqpVersion version = vItr.next();
- int numBytes = ((thisClass.fieldMap.getNumFields(version) - 1) / 15) + 1;
-
- sb.append(indent);
- if (!version.equals(globalVersionSet.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 = globalVersionSet.iterator();
- while (vItr.hasNext())
- {
- AmqpVersion version = vItr.next();
- int numFields = thisClass.fieldMap.getNumFields(version);
- int numBytes = ((numFields - 1) / 15) + 1;
-
- sb.append(indent);
- if (!version.equals(globalVersionSet.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)
- throws AmqpTypeMappingException
- {
- 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();
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/LanguageConverter.java b/Final/gentools/src/org/apache/qpid/gentools/LanguageConverter.java
deleted file mode 100644
index cb0a14e3bc..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/LanguageConverter.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.gentools;
-
-public interface LanguageConverter
-{
- public void setDomainMap(AmqpDomainMap domainMap);
- public AmqpDomainMap getDomainMap();
-
- public void setConstantSet(AmqpConstantSet constantSet);
- public AmqpConstantSet getConstantSet();
-
- public void setModel(AmqpModel model);
- 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) throws AmqpTypeMappingException;
- public String getGeneratedType(String domainName, AmqpVersion version) throws AmqpTypeMappingException;
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/Main.java b/Final/gentools/src/org/apache/qpid/gentools/Main.java
deleted file mode 100644
index e8c8a80a26..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/Main.java
+++ /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.
- *
- */
-package org.apache.qpid.gentools;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-public class Main
-{
- private static final String defaultOutDir = ".." + Utils.fileSeparator + "gen";
- private static final String defaultCppTemplateDir = ".." + Utils.fileSeparator + "templ.cpp";
- private static final String defaultDotnetTemplateDir = ".." + Utils.fileSeparator + "templ.net";
- private static final String defaultJavaTemplateDir = ".." + Utils.fileSeparator + "templ.java";
-
- private enum GeneratorLangEnum { CPP, DOTNET, JAVA }
-
- private DocumentBuilder docBuilder;
- private AmqpVersionSet versionSet;
- private Generator generator;
- private AmqpConstantSet constants;
- private AmqpDomainMap domainMap;
- private AmqpModel model;
-
- private String outDir;
- private String tmplDir;
- private GeneratorLangEnum generatorLang;
- private ArrayList<String> xmlFiles;
- private File[] modelTemplateFiles;
- private File[] classTemplateFiles;
- private File[] methodTemplateFiles;
- private File[] fieldTemplateFiles;
-
- public Main() throws ParserConfigurationException
- {
- docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
- versionSet = new AmqpVersionSet();
- xmlFiles = new ArrayList<String>();
- }
-
- public void run(String[] args)
- throws IOException,
- SAXException,
- AmqpParseException,
- AmqpTypeMappingException,
- AmqpTemplateException,
- TargetDirectoryException,
- IllegalAccessException,
- InvocationTargetException
- {
- modelTemplateFiles = new File[]{};
- classTemplateFiles = new File[]{};
- methodTemplateFiles = new File[]{};
- fieldTemplateFiles = new File[]{};
-
- // 0. Initialize
- outDir = defaultOutDir;
- tmplDir = null;
- generatorLang = GeneratorLangEnum.CPP; // Default generation language
- xmlFiles.clear();
- processArgs(args);
- switch (generatorLang)
- {
- case JAVA:
- prepareJava();
- break;
- case DOTNET:
- prepareDotnet();
- break;
- default:
- prepareCpp();
- }
-
- if (modelTemplateFiles.length == 0 && classTemplateFiles.length == 0 &&
- methodTemplateFiles.length == 0 && fieldTemplateFiles.length == 0)
- System.err.println(" WARNING: No template files.");
-
- // 1. Suck in all the XML spec files provided on the command line
- analyzeXML();
-
- // 2. Load up all templates
- try
- {
- generator.initializeTemplates(modelTemplateFiles, classTemplateFiles,
- methodTemplateFiles, fieldTemplateFiles);
- }
- catch (FileNotFoundException e)
- {
- System.err.println("Error: Unable to load template file (check -t option on command-line):");
- System.err.println(e.getMessage());
- return;
- }
-
- // 3. Generate output
- generator.generate(new File(outDir));
-
- 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 = GeneratorLangEnum.CPP;
- break;
- case 'j':
- case 'J':
- generatorLang = GeneratorLangEnum.JAVA;
- break;
- case 'n':
- case 'N':
- generatorLang = GeneratorLangEnum.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 prepareJava()
- {
- if (tmplDir == null)
- tmplDir = defaultJavaTemplateDir;
- System.out.println("Java generation mode.");
- generator = new JavaGenerator(versionSet);
- constants = new AmqpConstantSet(generator);
- domainMap = new AmqpDomainMap(generator);
- model = new AmqpModel(generator);
- modelTemplateFiles = new File[]
- {
- new File(tmplDir + Utils.fileSeparator + "MethodRegistryClass.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AmqpConstantsClass.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "ProtocolVersionListClass.tmpl")
- };
- classTemplateFiles = new File[]
- {
-// new File(tmplDir + Utils.fileSeparator + "PropertyContentHeaderClass.tmpl")
- };
- methodTemplateFiles = new File[]
- {
- new File(tmplDir + Utils.fileSeparator + "MethodBodyClass.tmpl")
- };
- }
-
- private void prepareDotnet()
- {
- if (tmplDir == null)
- tmplDir = defaultDotnetTemplateDir;
- System.out.println(".NET generation mode.");
- generator = new DotnetGenerator(versionSet);
- constants = new AmqpConstantSet(generator);
- domainMap = new AmqpDomainMap(generator);
- model = new AmqpModel(generator);
- // TODO: Add templated that should be handled in here...
- modelTemplateFiles = new File[]
- {
-// new File(tmplDir + Utils.fileSeparator + "XXXClass.tmpl"),
- };
- classTemplateFiles = new File[]
- {
-// new File(tmplDir + Utils.fileSeparator + "XXXClass.tmpl"),
- };
- methodTemplateFiles = new File[]
- {
-// new File(tmplDir + Utils.fileSeparator + "XXXClass.tmpl"),
- };
- }
-
- private void prepareCpp()
- {
- if (tmplDir == null)
- tmplDir = defaultCppTemplateDir;
- System.out.println("C++ generation mode.");
- generator = new CppGenerator(versionSet);
- constants = new AmqpConstantSet(generator);
- domainMap = new AmqpDomainMap(generator);
- model = new AmqpModel(generator);
- modelTemplateFiles = new File[]
- {
- new File(tmplDir + Utils.fileSeparator + "AMQP_ServerOperations.h.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AMQP_ClientOperations.h.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AMQP_ServerProxy.h.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AMQP_ClientProxy.h.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AMQP_ServerProxy.cpp.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AMQP_ClientProxy.cpp.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AMQP_Constants.h.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AMQP_MethodVersionMap.h.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AMQP_MethodVersionMap.cpp.tmpl"),
- new File(tmplDir + Utils.fileSeparator + "AMQP_HighestVersion.h.tmpl")
- };
- methodTemplateFiles = new File[]
- {
- new File(tmplDir + Utils.fileSeparator + "MethodBodyClass.h.tmpl")
- };
- }
-
- private void analyzeXML()
- throws IOException, SAXException, AmqpParseException, AmqpTypeMappingException
- {
- 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() + ".");
- versionSet.add(version);
-
- // 1c. Extract domains
- constants.addFromNode(amqpNode, 0, version);
-
- // 1d. Extract domains
- domainMap.addFromNode(amqpNode, 0, version);
-
- // 1e. Extract class/method/field heirarchy
- model.addFromNode(amqpNode, 0, 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(); }
- }
- 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=\"" + defaultOutDir + "\").");
- System.out.println(" -t tmplDir: Find templates in tmplDir.");
- System.out.println(" Defaults: \"" + defaultCppTemplateDir + "\" for C++;");
- System.out.println(" \"" + defaultJavaTemplateDir + "\" for java.");
- System.out.println(" XMLfile is a space-separated list of AMQP XML files to be parsed.");
- }
-
- public static String ListTemplateList(File[] list)
- {
- StringBuffer sb = new StringBuffer();
- for (int i=0; i<list.length; i++)
- {
- if (i != 0)
- sb.append(", ");
- sb.append(list[i].getName());
- }
- return sb.toString();
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/NodeAware.java b/Final/gentools/src/org/apache/qpid/gentools/NodeAware.java
deleted file mode 100644
index df4e0ecb02..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/NodeAware.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.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/Final/gentools/src/org/apache/qpid/gentools/Printable.java b/Final/gentools/src/org/apache/qpid/gentools/Printable.java
deleted file mode 100644
index a73878c506..0000000000
--- a/Final/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/Final/gentools/src/org/apache/qpid/gentools/TargetDirectoryException.java b/Final/gentools/src/org/apache/qpid/gentools/TargetDirectoryException.java
deleted file mode 100644
index cdaf381f0a..0000000000
--- a/Final/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 Exception
-{
- public TargetDirectoryException(String msg)
- {
- super(msg);
- }
-}
diff --git a/Final/gentools/src/org/apache/qpid/gentools/Utils.java b/Final/gentools/src/org/apache/qpid/gentools/Utils.java
deleted file mode 100644
index ade00cd8c7..0000000000
--- a/Final/gentools/src/org/apache/qpid/gentools/Utils.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.gentools;
-
-import org.w3c.dom.Attr;
-//import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class Utils
-{
- public final static String fileSeparator = System.getProperty("file.separator");
- public final static String lineSeparator = 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.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/Final/gentools/src/org/apache/qpid/gentools/VersionConsistencyCheck.java b/Final/gentools/src/org/apache/qpid/gentools/VersionConsistencyCheck.java
deleted file mode 100644
index 1f6b9f1a6d..0000000000
--- a/Final/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/Final/gentools/templ.cpp/AMQP_ClientOperations.h.tmpl b/Final/gentools/templ.cpp/AMQP_ClientOperations.h.tmpl
deleted file mode 100644
index a9fb0e0f69..0000000000
--- a/Final/gentools/templ.cpp/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/Final/gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl b/Final/gentools/templ.cpp/AMQP_ClientProxy.cpp.tmpl
deleted file mode 100644
index 8cca6e5cec..0000000000
--- a/Final/gentools/templ.cpp/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/Final/gentools/templ.cpp/AMQP_ClientProxy.h.tmpl b/Final/gentools/templ.cpp/AMQP_ClientProxy.h.tmpl
deleted file mode 100644
index 0653ed7186..0000000000
--- a/Final/gentools/templ.cpp/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/Final/gentools/templ.cpp/AMQP_Constants.h.tmpl b/Final/gentools/templ.cpp/AMQP_Constants.h.tmpl
deleted file mode 100644
index 4631bc8de6..0000000000
--- a/Final/gentools/templ.cpp/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/Final/gentools/templ.cpp/AMQP_HighestVersion.h.tmpl b/Final/gentools/templ.cpp/AMQP_HighestVersion.h.tmpl
deleted file mode 100644
index 9753b454ba..0000000000
--- a/Final/gentools/templ.cpp/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/Final/gentools/templ.cpp/AMQP_MethodVersionMap.cpp.tmpl b/Final/gentools/templ.cpp/AMQP_MethodVersionMap.cpp.tmpl
deleted file mode 100644
index dc2a890c88..0000000000
--- a/Final/gentools/templ.cpp/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/Final/gentools/templ.cpp/AMQP_MethodVersionMap.h.tmpl b/Final/gentools/templ.cpp/AMQP_MethodVersionMap.h.tmpl
deleted file mode 100644
index c197871d4b..0000000000
--- a/Final/gentools/templ.cpp/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/Final/gentools/templ.cpp/AMQP_ServerOperations.h.tmpl b/Final/gentools/templ.cpp/AMQP_ServerOperations.h.tmpl
deleted file mode 100644
index e87723667b..0000000000
--- a/Final/gentools/templ.cpp/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/Final/gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl b/Final/gentools/templ.cpp/AMQP_ServerProxy.cpp.tmpl
deleted file mode 100644
index cce369f98b..0000000000
--- a/Final/gentools/templ.cpp/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/Final/gentools/templ.cpp/AMQP_ServerProxy.h.tmpl b/Final/gentools/templ.cpp/AMQP_ServerProxy.h.tmpl
deleted file mode 100644
index fab29f2c60..0000000000
--- a/Final/gentools/templ.cpp/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/Final/gentools/templ.cpp/MethodBodyClass.h.tmpl b/Final/gentools/templ.cpp/MethodBodyClass.h.tmpl
deleted file mode 100644
index 5819a9cf9c..0000000000
--- a/Final/gentools/templ.cpp/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/Final/gentools/templ.java/AmqpConstantsClass.tmpl b/Final/gentools/templ.java/AmqpConstantsClass.tmpl
deleted file mode 100644
index 8d459f2977..0000000000
--- a/Final/gentools/templ.java/AmqpConstantsClass.tmpl
+++ /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/Final/gentools/templ.java/MethodBodyClass.tmpl b/Final/gentools/templ.java/MethodBodyClass.tmpl
deleted file mode 100644
index eb730fd891..0000000000
--- a/Final/gentools/templ.java/MethodBodyClass.tmpl
+++ /dev/null
@@ -1,183 +0,0 @@
-&{${CLASS}${METHOD}Body.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 java.util.HashMap;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class ${CLASS}${METHOD}Body extends AMQMethodBody implements EncodableAMQDataBlock
-{
- private static final AMQMethodBodyInstanceFactory factory = new AMQMethodBodyInstanceFactory()
- {
- public AMQMethodBody newInstance(byte major, byte minor, ByteBuffer in, long size) throws AMQFrameDecodingException
- {
- return new ${CLASS}${METHOD}Body(major, minor, in);
- }
-
- public AMQMethodBody newInstance(byte major, byte minor, int clazzID, int methodID, ByteBuffer in, long size) throws AMQFrameDecodingException
- {
- return new ${CLASS}${METHOD}Body(major, minor, clazzID, methodID, in);
- }
-
- };
-
- public static AMQMethodBodyInstanceFactory getFactory()
- {
- return factory;
- }
-
- public static HashMap<Integer, Integer> classIdMap = new HashMap<Integer, Integer>();
- public static HashMap<Integer, Integer> methodIdMap = new HashMap<Integer, Integer>();
-
- private static void registerMethodId(byte major, byte minor, int methodId)
- {
- methodIdMap.put((0xff & (int) major) | ((0xff & (int) minor)<<8), methodId);
- }
-
- private static void registerClassId(byte major, byte minor, int classId)
- {
- classIdMap.put((0xff & (int) major) | ((0xff & (int) minor)<<8), classId);
- }
-
-
- static
- {
-
- ${CLASS_ID_INIT}
- ${METHOD_ID_INIT}
-
- }
-
- // Fields declared in specification
-%{FLIST} ${field_declaration}
-
- private final int _clazz;
- private final int _method;
-
-
- // Constructor
-
- public ${CLASS}${METHOD}Body(byte major, byte minor, ByteBuffer buffer) throws AMQFrameDecodingException
- {
- this(major, minor, getClazz(major,minor), getMethod(major,minor), buffer);
- }
-
- public ${CLASS}${METHOD}Body(byte major, byte minor, int clazzID, int methodID, ByteBuffer buffer) throws AMQFrameDecodingException
- {
-
- super(major, minor);
- _clazz = clazzID;
- _method = methodID;
- %{FLIST} ${mb_field_decode}
- }
- public ${CLASS}${METHOD}Body(byte major, byte minor, int clazzID, int methodID
- %{FLIST} ${mb_field_parameter_list}
- )
- {
- super(major, minor);
- _clazz = getClazz(major,minor);
- _method = getMethod(major,minor);
- %{FLIST} ${mb_field_body_initialize}
- }
-
- public int getClazz()
- {
- return _clazz;
- }
-
- public int getMethod()
- {
- return _method;
- }
-
- public static int getClazz(byte major, byte minor)
- {
- return classIdMap.get((0xff & (int) major) | ((0xff & (int) minor)<<8));
- }
-
- public static int getMethod(byte major, byte minor)
- {
- return methodIdMap.get((0xff & (int) major) | ((0xff & (int) minor)<<8));
- }
-
-
- // Field methods
-%{FLIST} ${mb_field_get_method}
-
- protected int getBodySize()
- {
- int size = 0;
-%{FLIST} ${mb_field_size}
- return size;
- }
-
- protected void writeMethodPayload(ByteBuffer buffer)
- {
-%{FLIST} ${mb_field_encode}
- }
-
- public void populateMethodBodyFromBuffer(ByteBuffer buffer) throws AMQFrameDecodingException
- {
-%{FLIST} ${mb_field_decode}
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(super.toString());
-%{FLIST} ${mb_field_to_string}
- return buf.toString();
- }
-
- public static AMQFrame createAMQFrame(int channelId, byte major, byte minor
-%{FLIST} ${mb_field_parameter_list}
- )
- {
- return createAMQFrame(channelId, major, minor, getClazz(major,minor), getMethod(major,minor)
-%{FLIST} ${mb_field_passed_parameter_list}
- );
-
-
-
- }
-
- public static AMQFrame createAMQFrame(int channelId, byte major, byte minor, int clazzID, int methodID
-%{FLIST} ${mb_field_parameter_list}
- )
- {
- ${CLASS}${METHOD}Body body = new ${CLASS}${METHOD}Body(major, minor, clazzID, methodID
-%{FLIST} ${mb_field_passed_parameter_list}
- );
-
-
- AMQFrame frame = new AMQFrame(channelId, body);
- return frame;
- }
-
-}
diff --git a/Final/gentools/templ.java/MethodRegistryClass.tmpl b/Final/gentools/templ.java/MethodRegistryClass.tmpl
deleted file mode 100644
index 01e440e209..0000000000
--- a/Final/gentools/templ.java/MethodRegistryClass.tmpl
+++ /dev/null
@@ -1,159 +0,0 @@
-&{MainRegistry.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 java.util.HashMap;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.apache.mina.common.ByteBuffer;
-
-public class MainRegistry
-{
- private static final HashMap<Long, AMQMethodBodyInstanceFactory> classIDMethodIDVersionBodyMap = new HashMap<Long, AMQMethodBodyInstanceFactory>();
-
-
- private static final Logger _log = LoggerFactory.getLogger(MainRegistry.class);
-
-
- private static final int DEFAULT_MINOR_VERSION_COUNT = 10;
- private static final int DEFAULT_MAJOR_VERSION_COUNT = 10;
-
- private static VersionSpecificRegistry[][] _specificRegistries = new VersionSpecificRegistry[DEFAULT_MAJOR_VERSION_COUNT][];
-
- static
- {
-%{CLIST} ${reg_map_put_method}
-
- configure();
- }
-
- public static AMQMethodBody get(short classID, short methodID, byte major, byte minor, ByteBuffer in, long size)
- throws AMQFrameDecodingException
- {
- VersionSpecificRegistry registry = getVersionSpecificRegistry(major, minor);
- AMQMethodBodyInstanceFactory bodyFactory = registry.getMethodBody(classID,methodID);
-
- if (bodyFactory == null)
- {
- throw new AMQFrameDecodingException(null,
- "Unable to find a suitable decoder for class " + classID + " and method " +
- methodID + " in AMQP version " + major + "-" + minor + ".", null);
- }
- return bodyFactory.newInstance(major, minor, in, size);
-
-
- }
-
-
- public static VersionSpecificRegistry getVersionSpecificRegistry(ProtocolVersion pv)
- {
- return getVersionSpecificRegistry(pv.getMajorVersion(), pv.getMinorVersion());
- }
- public static VersionSpecificRegistry getVersionSpecificRegistry(byte major, byte minor)
- {
- try
- {
- return _specificRegistries[(int)major][(int)minor];
- }
- catch (IndexOutOfBoundsException e)
- {
- return null;
- }
- catch (NullPointerException e)
- {
- return null;
- }
-
-
- }
-
- private static VersionSpecificRegistry addVersionSpecificRegistry(byte major, byte minor)
- {
- VersionSpecificRegistry[][] registries = _specificRegistries;
- if(major >= registries.length)
- {
- _specificRegistries = new VersionSpecificRegistry[(int)major + 1][];
- System.arraycopy(registries, 0, _specificRegistries, 0, registries.length);
- registries = _specificRegistries;
- }
- if(registries[major] == null)
- {
- registries[major] = new VersionSpecificRegistry[ minor >= DEFAULT_MINOR_VERSION_COUNT ? minor + 1 : DEFAULT_MINOR_VERSION_COUNT ];
- }
- else if(registries[major].length <= minor)
- {
- VersionSpecificRegistry[] minorArray = registries[major];
- registries[major] = new VersionSpecificRegistry[ minor + 1 ];
- System.arraycopy(minorArray, 0, registries[major], 0, minorArray.length);
-
- }
-
- VersionSpecificRegistry newRegistry = new VersionSpecificRegistry(major,minor);
-
- registries[major][minor] = newRegistry;
-
- return newRegistry;
- }
-
- private static void registerMethod(short classID, short methodID, byte major, byte minor, AMQMethodBodyInstanceFactory instanceFactory )
- {
- VersionSpecificRegistry registry = getVersionSpecificRegistry(major,minor);
- if(registry == null)
- {
- registry = addVersionSpecificRegistry(major,minor);
-
- }
-
- registry.registerMethod(classID, methodID, instanceFactory);
-
- }
-
-
- private static void configure()
- {
- for(int i = 0 ; i < _specificRegistries.length; i++)
- {
- VersionSpecificRegistry[] registries = _specificRegistries[i];
- if(registries != null)
- {
- for(int j = 0 ; j < registries.length; j++)
- {
- VersionSpecificRegistry registry = registries[j];
-
- if(registry != null)
- {
- registry.configure();
- }
- }
- }
- }
-
- }
-
-}
diff --git a/Final/gentools/templ.java/PropertyContentHeaderClass.tmpl b/Final/gentools/templ.java/PropertyContentHeaderClass.tmpl
deleted file mode 100644
index ab6406b1fe..0000000000
--- a/Final/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/Final/gentools/templ.java/ProtocolVersionListClass.tmpl b/Final/gentools/templ.java/ProtocolVersionListClass.tmpl
deleted file mode 100644
index 4a2592d11b..0000000000
--- a/Final/gentools/templ.java/ProtocolVersionListClass.tmpl
+++ /dev/null
@@ -1,127 +0,0 @@
-&{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:
-%{VLIST} * ${major}-${minor}
-*/
-
-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;
- if(getMajorVersion() > pv.getMajorVersion())
- {
- return 1;
- }
- else if(getMajorVersion() < pv.getMajorVersion())
- {
- return -1;
- }
- else if(getMajorVersion() > pv.getMajorVersion())
- {
- 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>();
-
-%{VLIST} versions.add(new ProtocolVersion((byte)${major},(byte)${minor}));
-
- _supportedVersions = Collections.unmodifiableSortedSet(versions);
- }
-
-
- public static SortedSet<ProtocolVersion> getSupportedProtocolVersions()
- {
- return _supportedVersions;
- }
-
-
-
-
-
-}
diff --git a/Final/gentools/xml-src/amqp-0.10.test.xml b/Final/gentools/xml-src/amqp-0.10.test.xml
deleted file mode 100644
index 5d3d80648b..0000000000
--- a/Final/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/Final/gentools/xml-src/amqp-0.8.test.xml b/Final/gentools/xml-src/amqp-0.8.test.xml
deleted file mode 100644
index b0adf31828..0000000000
--- a/Final/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/Final/gentools/xml-src/amqp-0.9.test.xml b/Final/gentools/xml-src/amqp-0.9.test.xml
deleted file mode 100644
index e12e9c787a..0000000000
--- a/Final/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/Final/gentools/xml-src/cluster-0.9.test.xml b/Final/gentools/xml-src/cluster-0.9.test.xml
deleted file mode 100644
index 142e6c9380..0000000000
--- a/Final/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/Final/java/broker/bin/msTool.sh b/Final/java/broker/bin/msTool.sh
deleted file mode 100755
index 73b1eb2ec7..0000000000
--- a/Final/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-incubating.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/Final/java/broker/bin/qpid-passwd b/Final/java/broker/bin/qpid-passwd
deleted file mode 100644
index f046252522..0000000000
--- a/Final/java/broker/bin/qpid-passwd
+++ /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.
-#
-
-# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_HOME/lib/qpid-incubating.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/Final/java/broker/bin/qpid-server b/Final/java/broker/bin/qpid-server
deleted file mode 100644
index f1f4d72e64..0000000000
--- a/Final/java/broker/bin/qpid-server
+++ /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.
-#
-
-# Set classpath to include Qpid jar with all required jars in manifest
-QPID_LIBS=$QPID_HOME/lib/qpid-incubating.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 org.apache.qpid.server.Main "$@"
diff --git a/Final/java/broker/bin/qpid-server-bdb.bat b/Final/java/broker/bin/qpid-server-bdb.bat
deleted file mode 100644
index 8964e577df..0000000000
--- a/Final/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/Final/java/broker/bin/qpid-server.bat b/Final/java/broker/bin/qpid-server.bat
deleted file mode 100644
index a99022cd2d..0000000000
--- a/Final/java/broker/bin/qpid-server.bat
+++ /dev/null
@@ -1,70 +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
-
-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).
-set QPID_ARGS=%1
-if ""%1""=="""" goto runCommand
-shift
-:loop
-if ""%1""=="""" goto runCommand
-set QPID_ARGS=%QPID_ARGS% %1
-shift
-goto loop
-
-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 LAUNCH_JAR=%QPID_HOME%\lib\qpid-incubating.jar
-set MODULE_JARS=%QPID_MODULE_JARS%
-"%JAVA_HOME%\bin\java" -server -Xmx1024m %QPID_OPTS% -DQPID_HOME="%QPID_HOME%" -cp "%LAUNCH_JAR%;%MODULE_JARS%" org.apache.qpid.server.Main %QPID_ARGS%
-
-:end
diff --git a/Final/java/broker/bin/qpid.start b/Final/java/broker/bin/qpid.start
deleted file mode 100644
index 99f2d89f64..0000000000
--- a/Final/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.
-#
-
-qpid-server -run:debug "$@" \ No newline at end of file
diff --git a/Final/java/broker/bin/qpid.stop b/Final/java/broker/bin/qpid.stop
deleted file mode 100644
index 6482fc3293..0000000000
--- a/Final/java/broker/bin/qpid.stop
+++ /dev/null
@@ -1,137 +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 PROGRAM and attempts to quit it
-#
-
-MAX_ATTEMPTS=1
-SLEEP_DELAY=1
-PROGRAM="DQPID"
-
-
-#
-# Print what is going to be done
-#
-printActions()
-{
-#ps=`ps o command p $1|grep $PROGRAM`
-ps=`ps -o args -p $1|grep $PROGRAM`
-echo "Attempting to kill: $ps"
-}
-
-#
-# Forcably Quit the specified PID($1)
-#
-forceQuit()
-{
-kill -9 $1
-}
-
-
-#
-# Gracefully ask the PID($1) to quit
-#
-quit()
-{
-kill $1
-}
-
-#
-# Grep the ps log for the PID ($1) to ensure that it has quit
-#
-lookup()
-{
-result=`ps -o args -p $1 |grep -v grep |grep $PROGRAM |wc -l`
-}
-
-#
-# 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 $1
-}
-
-
-
-#
-# Verify the PID($1) is available
-#
-verifyPid()
-{
-lookup $1
-if [[ $[$result] == 1 ]] ; then
- brokerspid=$1
-else
- echo "Unable to locate Qpid Process with PID $1"
- exit -1
-fi
-}
-
-#
-# Main Run
-#
-
-# Check if we are killing all qpid pids or just one.
-if [[ $# == 0 ]] ; then
- echo "Killing All Qpid Brokers for user: '$USER'"
- qpid.stopall
- exit $?
-else
- verifyPid $1
-fi
-
-printActions $brokerspid
-
-# 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"
- exit 0
-else
-
- # Now attempt to force quit the process
- attempt=0
- 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
diff --git a/Final/java/broker/bin/qpid.stopall b/Final/java/broker/bin/qpid.stopall
deleted file mode 100644
index d71f591de8..0000000000
--- a/Final/java/broker/bin/qpid.stopall
+++ /dev/null
@@ -1,74 +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
-#
-
-PROGRAM="DQPID"
-
-#
-# grep ps for instances of $PROGRAM and collect PIDs
-#
-lookup()
-{
-#pids=`ps o pid,command | grep $PROGRAM | grep -v grep | cut -d ' ' -f 1`
-pids=`ps -ef |grep $USER | grep $PROGRAM | grep -v grep | awk '{print $2}'`
-result=`echo -n $pids | wc -w`
-}
-
-
-#
-# Show the PS output for given set of pids
-#
-showPids()
-{
-ps -o user,pid,args -p $pids
-}
-
-
-#
-# Main Run
-#
-
-lookup
-
-if [[ $[$result] == 0 ]] ; then
- echo "No Qpid Brokers found running under user '$USER'"
- exit 0
-fi
-
-for pid in $pids ; do
-
-qpid.stop $pid
-
-done
-
-# Check we have quit all
-lookup
-
-if [[ $[$result] == 0 ]] ; then
- echo "All Qpid brokers successfully quit"
-else
- echo "Some brokers were not quit"
- showPids $pids
-fi
diff --git a/Final/java/broker/bin/run.bat b/Final/java/broker/bin/run.bat
deleted file mode 100755
index 5b0aa0f23b..0000000000
--- a/Final/java/broker/bin/run.bat
+++ /dev/null
@@ -1,31 +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
-set CORE_CLASSES=..\classes;..\testclasses
-
-set COMMONDIR=..\..\common
-
-set COMMONLIB=%COMMONDIR%\lib\slf4j\slf4j-simple.jar;%COMMONDIR%\lib\logging-log4j\log4j-1.2.9.jar;%COMMONDIR%\lib\mina\mina-core-0.9.2.jar
-
-set DIST=..\lib\bdb\je-3.0.12.jar;..\dist\amqpd.jar;..\..\client\dist\amqp-common.jar
-
-set CP=%CORE_CLASSES%;%DIST%;%COMMONLIB%
-
-"%JAVA_HOME%\bin\java" -Xmx512m -Damqj.logging.level=INFO -cp %CP% %*
diff --git a/Final/java/broker/bin/run.sh b/Final/java/broker/bin/run.sh
deleted file mode 100755
index 6b62049e94..0000000000
--- a/Final/java/broker/bin/run.sh
+++ /dev/null
@@ -1,44 +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.
-#
-
-
-COMMONDIR=../../common
-
-COMMONLIB=$COMMONLIB:$COMMONDIR/lib/slf4j/slf4j-simple.jar
-COMMONLIB=$COMMONLIB:$COMMONDIR/lib/logging-log4j/log4j-1.2.13.jar
-COMMONLIB=$COMMONLIB:$COMMONDIR/lib/mina/mina-core-0.9.5-SNAPSHOT.jar
-COMMONLIB=$COMMONLIB:$COMMONDIR/lib/mina/mina-filter-ssl-0.9.5-SNAPSHOT.jar
-COMMONLIB=$COMMONLIB:$COMMONDIR/lib/commons-collections/commons-collections-3.1.jar
-COMMONLIB=$COMMONLIB:$COMMONDIR/lib/commons-cli/commons-cli-1.0.jar
-COMMONLIB=$COMMONLIB:$COMMONDIR/lib/commons-configuration/commons-configuration-1.2.jar
-COMMONLIB=$COMMONLIB:$COMMONDIR/lib/commons-logging/commons-logging-api.jar
-COMMONLIB=$COMMONLIB:$COMMONDIR/lib/commons-logging/commons-logging.jar
-COMMONLIB=$COMMONLIB:$COMMONDIR/lib/commons-lang/commons-lang-2.1.jar
-COMMONLIB=$COMMONLIB:$COMMONDIR/lib/junit/junit-4.0.jar
-
-DIST=../lib/bdb/je-3.0.12.jar:../dist/amqpd-tests.jar:../dist/amqpd.jar:../../client/dist/amqp-common.jar
-
-CP=../intellijclasses:$DIST:$COMMONLIB
-
-if [ "$(uname -a | fgrep Cygwin)" != "" ]; then
- CP=$(cygpath --mixed --path $CP)
-fi
-
-"$JAVA_HOME/bin/java" -Xmx512m -Dprepopulate=10 -Damqj.logging.level=INFO -cp $CP $*
diff --git a/Final/java/broker/bin/runAll b/Final/java/broker/bin/runAll
deleted file mode 100644
index 4ced1d263b..0000000000
--- a/Final/java/broker/bin/runAll
+++ /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.
-#
-
-doRun()
-{
- class=$1
- shift
- echo
- echo ================================================================================
- echo Running $class
- ./run.sh $class "$@"
-}
-
-# parameters are: clients messages iterations
-doRun org.apache.qpid.server.queue.SendPerfTest 10 1000 100
-
-doRun org.apache.qpid.server.queue.QueuePerfTest
-
-doRun org.apache.qpid.server.queue.QueueConcurrentPerfTest
diff --git a/Final/java/broker/distribution/pom.xml b/Final/java/broker/distribution/pom.xml
deleted file mode 100644
index 8737d943eb..0000000000
--- a/Final/java/broker/distribution/pom.xml
+++ /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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-broker-distribution</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid Broker Distributions</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- <java.source.version>1.5</java.source.version>
- <qpid.version>${pom.version}</qpid.version>
- <qpid.targetDir>${project.build.directory}</qpid.targetDir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-broker</artifactId>
- <type>jar</type>
- </dependency>
- </dependencies>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>${java.source.version}</source>
- <target>${java.source.version}</target>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${assembly.version}</version>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/broker-bin.xml</descriptor>
- </descriptors>
- <finalName>qpid-${pom.version}</finalName>
- <outputDirectory>${qpid.targetDir}</outputDirectory>
- <tarLongFileMode>gnu</tarLongFileMode>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <finalName>qpid-incubating</finalName>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- </manifest>
- </archive>
- </configuration>
- </plugin>
-
- </plugins>
- </pluginManagement>
-
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>distribution-package</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/broker-bin.xml</descriptor>
- <descriptor>src/main/assembly/broker-src.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- </build>
-
- <profiles>
- <profile>
- <id>tests</id>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-broker</artifactId>
- <type>test-jar</type>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>distribution-package</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/broker-bin-tests.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/Final/java/broker/distribution/src/main/assembly/broker-bin-tests.xml b/Final/java/broker/distribution/src/main/assembly/broker-bin-tests.xml
deleted file mode 100644
index fa017d6232..0000000000
--- a/Final/java/broker/distribution/src/main/assembly/broker-bin-tests.xml
+++ /dev/null
@@ -1,116 +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>
- <id>java-broker-bin-with-tests</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>
-
- <!-- Include easy access to test source-->
- <fileSet>
- <directory>../src/test</directory>
- <outputDirectory>qpid-${qpid.version}/src</outputDirectory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
-
- <!-- Execution Scripts -->
- <fileSet>
- <directory>../bin/</directory>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <includes>
- <include>**/*</include>
- </includes>
- <fileMode>777</fileMode> <!-- RWX -->
- </fileSet>
-
- <!-- Configuration -->
- <fileSet>
- <directory>../etc/</directory>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <includes>
- <include>**/*</include>
- </includes>
- <fileMode>420</fileMode>
- </fileSet>
-
- <!-- Metadata Jar -->
- <fileSet>
- <directory>target</directory>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <includes>
- <include>qpid-incubating.jar</include>
- </includes>
- </fileSet>
- </fileSets>
-
-
- <files>
- <!-- Common Run scripts -->
- <file>
- <source>../../common/bin/qpid-run</source>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <destName>qpid-run</destName>
- <fileMode>493</fileMode>
- </file>
-
- <!-- Common Configuration -->
- <file>
- <source>../../common/etc/qpid-run.conf</source>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <destName>qpid-run.conf</destName>
- <fileMode>420</fileMode>
- </file>
- </files>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <unpack>false</unpack>
- <excludes>
- <exclude>org.apache.qpid:qpid-broker-distribution</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
-</assembly>
diff --git a/Final/java/broker/distribution/src/main/assembly/broker-bin.xml b/Final/java/broker/distribution/src/main/assembly/broker-bin.xml
deleted file mode 100644
index e66190a3f4..0000000000
--- a/Final/java/broker/distribution/src/main/assembly/broker-bin.xml
+++ /dev/null
@@ -1,183 +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>
- <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
- <id>java-broker-bin</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
-
- <fileSets>
- <!-- Apache Licensing -->
- <fileSet>
- <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>../..</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- <includes>
- <include>*.txt</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>../../src/main/release-docs</directory>
- <outputDirectory>qpid-${qpid.version}/docs</outputDirectory>
- <includes>
- <include>RELEASE_NOTES.txt</include>
- </includes>
- </fileSet>
-
- <!-- Metadata Jar -->
- <fileSet>
- <directory>target</directory>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <includes>
- <include>qpid-incubating.jar</include>
- </includes>
- </fileSet>
- </fileSets>
- <files>
- <!-- due to a bug in the assembly plugin (MASSEMBLY-153) you have
- to use decimal numbers to specify fileMode -->
- <file>
- <source>../../common/etc/qpid-run.conf</source>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <destName>qpid-run.conf</destName>
- <fileMode>420</fileMode>
- </file>
- <file>
- <source>../etc/config.xml</source>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <destName>config.xml</destName>
- <fileMode>420</fileMode>
- </file>
- <file>
- <source>../etc/jmxremote.access</source>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <destName>jmxremote.access</destName>
- <fileMode>420</fileMode>
- </file>
- <file>
- <source>../etc/log4j.xml</source>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <destName>log4j.xml</destName>
- <fileMode>420</fileMode>
- </file>
- <file>
- <source>../etc/passwd</source>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <destName>passwd</destName>
- <fileMode>420</fileMode>
- </file>
- <file>
- <source>../etc/qpid-server.conf</source>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <destName>qpid-server.conf</destName>
- <fileMode>420</fileMode>
- </file>
- <file>
- <source>../etc/virtualhosts.xml</source>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <destName>virtualhosts.xml</destName>
- <fileMode>420</fileMode>
- </file>
- <file>
- <source>../../common/bin/qpid-run</source>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <destName>qpid-run</destName>
- <fileMode>473</fileMode>
- </file>
- <file>
- <source>../bin/qpid-passwd</source>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <destName>qpid-passwd</destName>
- <fileMode>473</fileMode>
- </file>
- <file>
- <source>../bin/qpid-server</source>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <destName>qpid-server</destName>
- <fileMode>473</fileMode>
- </file>
- <file>
- <source>../bin/qpid-server.bat</source>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <destName>qpid-server.bat</destName>
- <fileMode>473</fileMode>
- </file>
- <file>
- <source>../bin/run.bat</source>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <destName>run.bat</destName>
- <fileMode>473</fileMode>
- </file>
- <file>
- <source>../bin/run.sh</source>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <destName>run.sh</destName>
- <fileMode>473</fileMode>
- </file>
- <file>
- <source>../bin/runAll</source>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <destName>runAll</destName>
- <fileMode>473</fileMode>
- </file>
- </files>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <unpack>false</unpack>
- <!-- This needs to be tidied up QPID-280 -->
- <excludes>
- <exclude>org.apache.qpid:qpid-broker-distribution</exclude>
- <exclude>org.apache.qpid.management:org.apache.qpid.management.ui</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.commands</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.contenttype</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.expressions</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.jobs</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.runtime</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.auth</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.registry</exclude>
- <exclude>org.eclipse.equinox:org.eclipse.equinox.common</exclude>
- <exclude>org.eclipse.equinox:org.eclipse.equinox.preferences</exclude>
- <exclude>org.eclipse.equinox:org.eclipse.equinox.registry</exclude>
- <exclude>org.eclipse.help:org.eclipse.help</exclude>
- <exclude>org.eclipse.jface:org.eclipse.jface</exclude>
- <exclude>org.eclipse.osgi:org.eclipse.osgi</exclude>
- <exclude>org.eclipse.swt:org.eclipse.swt</exclude>
- <exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86</exclude>
- <exclude>org.eclipse.ui:org.eclipse.ui</exclude>
- <exclude>org.eclipse.ui:org.eclipse.ui.forms</exclude>
- <exclude>org.eclipse.ui:org.eclipse.ui.workbench</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
-</assembly>
diff --git a/Final/java/broker/distribution/src/main/assembly/broker-src.xml b/Final/java/broker/distribution/src/main/assembly/broker-src.xml
deleted file mode 100644
index 28a22c3851..0000000000
--- a/Final/java/broker/distribution/src/main/assembly/broker-src.xml
+++ /dev/null
@@ -1,78 +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>
- <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
- <id>java-broker-src</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
-
- <fileSets>
- <!-- Apache Licensing -->
- <fileSet>
- <directory>../../resources</directory>
- <outputDirectory>qpid-${qpid.version}-src</outputDirectory>
- <includes>
- <include>DISCLAIMER</include>
- <include>LICENSE.txt</include>
- <include>licenses/*.*</include>
- <include>NOTICE.txt</include>
- <include>README.txt</include>
- <include>BUILDING.txt</include>
- </includes>
- </fileSet>
- <!-- Broker source -->
- <fileSet>
- <directory>..</directory>
- <outputDirectory>qpid-${qpid.version}-src</outputDirectory>
- <includes>
- <include>**/*</include>
- </includes>
- <!-- Tidy up wrt to QPID-280 -->
- <excludes>
- <exclude>build.xml</exclude>
- <exclude>distribution/build.xml</exclude>
- <exclude>benchmark</exclude>
- <exclude>benchmark/**/*</exclude>
- <exclude>**/target</exclude>
- <exclude>**/target/**/*</exclude>
- <exclude>**/build</exclude>
- <exclude>**/build/**/*</exclude>
- <exclude>**/.settings</exclude>
- <exclude>**/.classpath</exclude>
- <exclude>**/.project</exclude>
- <exclude>**/.wtpmodules</exclude>
- <exclude>**/surefire*</exclude>
- <exclude>**/cobertura.ser</exclude>
- <exclude>bin</exclude>
- <exclude>bin/*</exclude>
- <exclude>lib</exclude>
- <exclude>lib/**/*</exclude>
- <exclude>**/var/journal</exclude>
- <exclude>**/build.out*</exclude>
- <exclude>**/eclipse-plugin/bin/**</exclude>
- <exclude>**/eclipse-plugin/plugins/**</exclude>
- <exclude>**/eclipse-plugin/src/main/resources/**</exclude>
- </excludes>
- </fileSet>
- </fileSets>
-</assembly>
diff --git a/Final/java/broker/etc/access b/Final/java/broker/etc/access
deleted file mode 100644
index 58b7443fa9..0000000000
--- a/Final/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/Final/java/broker/etc/config.xml b/Final/java/broker/etc/config.xml
deleted file mode 100644
index b5b81bbeb0..0000000000
--- a/Final/java/broker/etc/config.xml
+++ /dev/null
@@ -1,175 +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>true</qpidnio>
- <transport>nio</transport>
- <port>5672</port>
- <sslport>8672</sslport>
- <socketReceiveBuffer>32768</socketReceiveBuffer>
- <socketSendBuffer>32768</socketSendBuffer>
- </connector>
- <management>
- <enabled>true</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>
- </advanced>
-
- <security>
- <principal-databases>
- <principal-database>
- <name>passwordfile</name>
- <class>org.apache.qpid.server.security.auth.database.PlainPasswordVhostFilePrincipalDatabase</class>
- <attributes>
- <attribute>
- <name>passwordFile</name>
- <value>${conf}/passwdVhost</value>
- </attribute>
- </attributes>
- </principal-database>
-
- <!-- 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.Base64MD5PasswordFilePrincipalDatabase</class>
- <attributes>
- <attribute>
- <name>passwordFile</name>
- <value>${conf}/qpid.passwd</value>
- </attribute>
- </attributes>
- </principal-database-->
- </principal-databases>
-
- <access>
- <class>org.apache.qpid.server.security.access.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}/localhost-store</environment-path> -->
-
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
-
- <security>
- <!-- Need protocol changes to allow this-->
- <authentication>
- <name>passwordfile</name>
- <!-- Currently this can't be used as Vhost isn't specified at connection start only connection open -->
- <mechanism>PLAIN</mechanism>
- </authentication>
- <access>
- <class>org.apache.qpid.server.security.access.PrincipalDatabaseAccessManager</class>
- <attributes>
- <attribute>
- <name>principalDatabase</name>
- <value>passwordfile</value>
- </attribute>
- <attribute>
- <name>defaultAccessManager</name>
- <value>DenyAll</value>
- </attribute>
- </attributes>
- </access>
- </security>
- </localhost>
- </virtualhost>
-
- <virtualhost>
- <name>development</name>
- <development>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
- <security>
- <name>passwordfile-notusedyet</name>
- <mechanism>PLAIN</mechanism>
- <mechanism>CRAM-MD5</mechanism>
- </security>
- </development>
- </virtualhost>
-
- <virtualhost>
- <name>test</name>
- <test>
- <store>
- <class>org.apache.qpid.server.store.MemoryMessageStore</class>
- </store>
- <security>
- <name>passwordfile-notusedyet</name>
- <mechanism>PLAIN</mechanism>
- <mechanism>CRAM-MD5</mechanism>
- </security>
- <access>
- <class>org.apache.qpid.server.security.access.PrincipalDatabaseAccessManager</class>
- <attributes>
- <attribute>
- <name>principalDatabase</name>
- <value>rubbish-to-cause-default</value>
- </attribute>
- </attributes>
- </access>
-
- </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/Final/java/broker/etc/debug.log4j.xml b/Final/java/broker/etc/debug.log4j.xml
deleted file mode 100644
index e8fd7e119d..0000000000
--- a/Final/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="info"/>
- <appender-ref ref="STDOUT"/>
- <appender-ref ref="FileAppender"/>
- </root>
-
-</log4j:configuration>
diff --git a/Final/java/broker/etc/jmxremote.access b/Final/java/broker/etc/jmxremote.access
deleted file mode 100644
index 1a51a6991b..0000000000
--- a/Final/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/Final/java/broker/etc/log4j.xml b/Final/java/broker/etc/log4j.xml
deleted file mode 100644
index af8e7a8293..0000000000
--- a/Final/java/broker/etc/log4j.xml
+++ /dev/null
@@ -1,112 +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>
-
-
- <!-- 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-->
-
- <!--category name="org.apache.qpid.server.txn">
- <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/Final/java/broker/etc/md5passwd b/Final/java/broker/etc/md5passwd
deleted file mode 100644
index 6a149919de..0000000000
--- a/Final/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/Final/java/broker/etc/mstool-log4j.xml b/Final/java/broker/etc/mstool-log4j.xml
deleted file mode 100644
index 8c46010e2d..0000000000
--- a/Final/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/Final/java/broker/etc/passwd b/Final/java/broker/etc/passwd
deleted file mode 100644
index 966a16153d..0000000000
--- a/Final/java/broker/etc/passwd
+++ /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
diff --git a/Final/java/broker/etc/passwdVhost b/Final/java/broker/etc/passwdVhost
deleted file mode 100644
index 48ce8299b6..0000000000
--- a/Final/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/Final/java/broker/etc/persistent_config.xml b/Final/java/broker/etc/persistent_config.xml
deleted file mode 100644
index 178a73515c..0000000000
--- a/Final/java/broker/etc/persistent_config.xml
+++ /dev/null
@@ -1,132 +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>
- <qpidnio>true</qpidnio>
- <transport>nio</transport>
- <port>5672</port>
- <sslport>8672</sslport>
- <socketReceiveBuffer>32768</socketReceiveBuffer>
- <socketSendBuffer>32768</socketSendBuffer>
- </connector>
- <management>
- <enabled>true</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.PlainPasswordVhostFilePrincipalDatabase</class>
- <attributes>
- <attribute>
- <name>passwordFile</name>
- <value>${conf}/passwdVhost</value>
- </attribute>
- </attributes>
- </principal-database>
- </principal-databases>
-
- <access>
- <class>org.apache.qpid.server.security.access.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>
-
- <security>
- <access>
- <class>org.apache.qpid.server.security.access.PrincipalDatabaseAccessManager</class>
- <attributes>
- <attribute>
- <name>principalDatabase</name>
- <value>passwordfile</value>
- </attribute>
- <attribute>
- <name>defaultAccessManager</name>
- <value>DenyAll</value>
- </attribute>
- </attributes>
- </access>
- </security>
- </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/Final/java/broker/etc/qpid-server.conf b/Final/java/broker/etc/qpid-server.conf
deleted file mode 100644
index c310094817..0000000000
--- a/Final/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-incubating.jar:$QPID_HOME/lib/bdbstore-launch.jar
-
-export JAVA=java \
- JAVA_VM=-server \
- JAVA_MEM=-Xmx1024m \
- CLASSPATH=$QPID_LIBS
diff --git a/Final/java/broker/etc/qpid-server.conf.jpp b/Final/java/broker/etc/qpid-server.conf.jpp
deleted file mode 100644
index 3ed2431ef3..0000000000
--- a/Final/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/Final/java/broker/etc/qpid.passwd b/Final/java/broker/etc/qpid.passwd
deleted file mode 100644
index 79b5e11777..0000000000
--- a/Final/java/broker/etc/qpid.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:CE4DQ6BIb/BVMN9scFyLtA==
-admin:ISMvKXpXpadDiUoOSoAfww==
-user:CE4DQ6BIb/BVMN9scFyLtA==
-
diff --git a/Final/java/broker/etc/transient_config.xml b/Final/java/broker/etc/transient_config.xml
deleted file mode 100644
index 164d66cd1b..0000000000
--- a/Final/java/broker/etc/transient_config.xml
+++ /dev/null
@@ -1,128 +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>
- <qpidnio>true</qpidnio>
- <transport>nio</transport>
- <port>5672</port>
- <sslport>8672</sslport>
- <socketReceiveBuffer>32768</socketReceiveBuffer>
- <socketSendBuffer>32768</socketSendBuffer>
- </connector>
- <management>
- <enabled>true</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.PlainPasswordVhostFilePrincipalDatabase</class>
- <attributes>
- <attribute>
- <name>passwordFile</name>
- <value>${conf}/passwdVhost</value>
- </attribute>
- </attributes>
- </principal-database>
- </principal-databases>
- <access>
- <class>org.apache.qpid.server.security.access.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>
-
- <security>
- <access>
- <class>org.apache.qpid.server.security.access.PrincipalDatabaseAccessManager</class>
- <attributes>
- <attribute>
- <name>principalDatabase</name>
- <value>passwordfile</value>
- </attribute>
- <attribute>
- <name>defaultAccessManager</name>
- <value>DenyAll</value>
- </attribute>
- </attributes>
- </access>
- </security>
- </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/Final/java/broker/etc/virtualhosts.xml b/Final/java/broker/etc/virtualhosts.xml
deleted file mode 100644
index f62ec3f5d7..0000000000
--- a/Final/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/Final/java/broker/pom.xml b/Final/java/broker/pom.xml
deleted file mode 100644
index 914a272571..0000000000
--- a/Final/java/broker/pom.xml
+++ /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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-broker</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid Broker</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-common</artifactId>
- </dependency>
-
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.4.0</version>
- </dependency>
-
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>commons-configuration</groupId>
- <artifactId>commons-configuration</artifactId>
- <exclusions>
- <exclusion>
- <groupId>javax.servlet</groupId>
- <artifactId>servlet-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-beanutils</groupId>
- <artifactId>commons-beanutils-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-digester</groupId>
- <artifactId>commons-digester</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- </exclusion>
- <exclusion>
- <groupId>xml-apis</groupId>
- <artifactId>xml-apis</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
- <build>
-
- <plugins>
-
-
- <!--plugin>
- <artifactId>minijar-maven-plugin</artifactId>
- <groupId>org.codehaus.mojo</groupId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>minijars</goal>
- </goals>
- <configuration>
- <stripUnusedClasses>true</stripUnusedClasses>
- </configuration>
- </execution>
- </executions>
- </plugin-->
-
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>javacc-maven-plugin</artifactId>
- <version>2.0</version>
- <executions>
- <execution>
- <phase>generate-sources</phase>
- <configuration>
- <sourceDirectory>${basedir}/src/main/grammar</sourceDirectory>
- <outputDirectory>${basedir}/target/generated-sources</outputDirectory>
- <packageName>org.apache.qpid.server.filter.jms.selector</packageName>
- </configuration>
- <goals>
- <goal>javacc</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemProperties>
- <property>
- <name>amqj.noAutoCreateVMBroker</name>
- <value>true</value>
- </property>
- <property>
- <name>amqj.logging.level</name>
- <value>${amqj.logging.level}</value>
- </property>
- <property>
- <name>log4j.configuration</name>
- <value>file:///${basedir}/src/main/java/log4j.properties</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
-
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- <testResources>
- <testResource>
- <targetPath>src/</targetPath>
- <filtering>false</filtering>
- <directory>src/test/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </testResource>
- </testResources>
-
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>${antrun.version}</version>
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-nodeps</artifactId>
- <version>1.6.5</version>
- </dependency>
- </dependencies>
-
- <executions>
- <execution>
- <id>python_test</id>
- <phase>test</phase>
- <configuration>
- <tasks>
-
- <condition property="skip-python-tests" value="true">
- <isset property="skip.python.tests"/>
- </condition>
-
- <property name="command"
- value="python run-tests -v -I java_failing.txt -b localhost:2000"/>
- <!--value="bash -c 'python run-tests -v -I java_failing.txt'"/>-->
-
- <ant antfile="python-test.xml" inheritRefs="true">
- <target name="run-tests" />
- </ant>
-
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </pluginManagement>
-
-
- </build>
-
-</project>
diff --git a/Final/java/broker/python-test.xml b/Final/java/broker/python-test.xml
deleted file mode 100755
index e044207948..0000000000
--- a/Final/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="2000"/>
- <arg value="-m"/>
- <arg value="2001"/>
-
- <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/Final/java/broker/src/main/grammar/SelectorParser.jj b/Final/java/broker/src/main/grammar/SelectorParser.jj
deleted file mode 100644
index adec1b348d..0000000000
--- a/Final/java/broker/src/main/grammar/SelectorParser.jj
+++ /dev/null
@@ -1,604 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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).initCause(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","_", "$"])* >
-}
-
-// ----------------------------------------------------------------------------
-// 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;
- PropertyExpression left=null;
-}
-{
- (
- t = <ID>
- {
- left = new PropertyExpression(t.image);
- }
- )
- {
- return left;
- }
-}
diff --git a/Final/java/broker/src/main/java/log4j.properties b/Final/java/broker/src/main/java/log4j.properties
deleted file mode 100644
index 87f04f4991..0000000000
--- a/Final/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=info
-log4j.appender.console.layout=org.apache.log4j.PatternLayout
-log4j.appender.console.layout.ConversionPattern=%t %d %p [%c{4}] %m%n
diff --git a/Final/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java b/Final/java/broker/src/main/java/org/apache/log4j/QpidCompositeRollingAppender.java
deleted file mode 100644
index 7e0c4defe1..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/configuration/Configuration.java b/Final/java/broker/src/main/java/org/apache/qpid/configuration/Configuration.java
deleted file mode 100644
index 40ff590a0a..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java b/Final/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.java
deleted file mode 100644
index 9335723bc5..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBean.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.
- *
- */
-/*
- *
- * 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.AMQQueue;
-import org.apache.qpid.server.queue.QueueRegistry;
-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 = new AMQQueue(new AMQShortString(queueName), durable, ownerShortString, false, getVirtualHost());
- if (queue.isDurable() && !queue.isAutoDelete())
- {
- _messageStore.createQueue(queue);
- }
-
- Configuration virtualHostDefaultQueueConfiguration =
- VirtualHostConfiguration.getDefaultQueueConfiguration(queue);
- if (virtualHostDefaultQueueConfiguration != null)
- {
- Configurator.configure(queue, virtualHostDefaultQueueConfiguration);
- }
-
- _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(new AMQShortString(queueName));
-
- }
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java b/Final/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
deleted file mode 100644
index d3b459c48a..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/AMQChannel.java
+++ /dev/null
@@ -1,989 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.UnacknowledgedMessage;
-import org.apache.qpid.server.ack.UnacknowledgedMessageMap;
-import org.apache.qpid.server.ack.UnacknowledgedMessageMapImpl;
-import org.apache.qpid.server.exchange.MessageRouter;
-import org.apache.qpid.server.exchange.NoRouteException;
-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.MessageHandleFactory;
-import org.apache.qpid.server.queue.Subscription;
-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.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicLong;
-
-public class AMQChannel
-{
- public static final int DEFAULT_PREFETCH = 5000;
-
- private static final Logger _log = Logger.getLogger(AMQChannel.class);
-
- private final int _channelId;
-
- // private boolean _transactional;
-
- private long _prefetch_HighWaterMark;
-
- private long _prefetch_LowWaterMark;
-
- private long _prefetchSize;
-
- /**
- * 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 AtomicLong _deliveryTag = new AtomicLong(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 AMQMessage _currentMessage;
-
- /** Maps from consumer tag to queue instance. Allows us to unsubscribe from a queue. */
- private final Map<AMQShortString, AMQQueue> _consumerTag2QueueMap = new HashMap<AMQShortString, AMQQueue>();
-
- private final MessageStore _messageStore;
-
- private UnacknowledgedMessageMap _unacknowledgedMessageMap = new UnacknowledgedMessageMapImpl(DEFAULT_PREFETCH);
-
- private final AtomicBoolean _suspended = new AtomicBoolean(false);
-
- private final MessageRouter _exchanges;
-
- private TransactionalContext _txnContext, _nonTransactedContext;
-
- /**
- * 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();
-
- private Set<Long> _browsedAcks = new HashSet<Long>();
-
- // Why do we need this reference ? - ritchiem
- private final AMQProtocolSession _session;
- private boolean _closing;
-
- public AMQChannel(AMQProtocolSession session, int channelId, MessageStore messageStore, MessageRouter exchanges)
- throws AMQException
- {
- _session = session;
- _channelId = channelId;
- _storeContext = new StoreContext("Session: " + session.getClientIdentifier() + "; channel: " + channelId);
- _prefetch_HighWaterMark = DEFAULT_PREFETCH;
- _prefetch_LowWaterMark = _prefetch_HighWaterMark / 2;
- _messageStore = messageStore;
- _exchanges = exchanges;
- // by default the session is non-transactional
- _txnContext = new NonTransactionalContext(_messageStore, _storeContext, this, _returnMessages, _browsedAcks);
- }
-
- /** Sets this channel to be part of a local transaction */
- public void setLocalTransactional()
- {
- _txnContext = new LocalTransactionalContext(_messageStore, _storeContext, _returnMessages);
- }
-
- 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 long getPrefetchCount()
- {
- return _prefetch_HighWaterMark;
- }
-
- public void setPrefetchCount(long prefetchCount)
- {
- _prefetch_HighWaterMark = prefetchCount;
- }
-
- public long getPrefetchSize()
- {
- return _prefetchSize;
- }
-
- public void setPrefetchSize(long prefetchSize)
- {
- _prefetchSize = prefetchSize;
- }
-
- public long getPrefetchLowMarkCount()
- {
- return _prefetch_LowWaterMark;
- }
-
- public void setPrefetchLowMarkCount(long prefetchCount)
- {
- _prefetch_LowWaterMark = prefetchCount;
- }
-
- public long getPrefetchHighMarkCount()
- {
- return _prefetch_HighWaterMark;
- }
-
- public void setPrefetchHighMarkCount(long prefetchCount)
- {
- _prefetch_HighWaterMark = prefetchCount;
- }
-
- public void setPublishFrame(MessagePublishInfo info, AMQProtocolSession publisher) throws AMQException
- {
-
- _currentMessage = new AMQMessage(_messageStore.getNewMessageId(), info, _txnContext);
- _currentMessage.setPublisher(publisher);
- }
-
- public void publishContentHeader(ContentHeaderBody contentHeaderBody, AMQProtocolSession protocolSession)
- throws AMQException
- {
- if (_currentMessage == null)
- {
- throw new AMQException("Received content header without previously receiving a BasicPublish frame");
- }
- else
- {
- if (_log.isTraceEnabled())
- {
- _log.trace(debugIdentity() + "Content header received on channel " + _channelId);
- }
-
- _currentMessage.setContentHeaderBody(contentHeaderBody);
- _currentMessage.setExpiration();
-
- routeCurrentMessage();
- _currentMessage.routingComplete(_messageStore, _storeContext, _messageHandleFactory);
-
- // check and deliver if header says body length is zero
- if (contentHeaderBody.bodySize == 0)
- {
- _txnContext.messageProcessed(protocolSession);
- _currentMessage = null;
- }
- }
- }
-
- public void publishContentBody(ContentBody contentBody, AMQProtocolSession protocolSession) throws AMQException
- {
- if (_currentMessage == null)
- {
- throw new AMQException("Received content body without previously receiving a JmsPublishBody");
- }
-
- if (_log.isTraceEnabled())
- {
- _log.trace(debugIdentity() + "Content body received on channel " + _channelId);
- }
-
- try
- {
-
- // returns true iff the message was delivered (i.e. if all data was
- // received
- if (_currentMessage.addContentBodyFrame(_storeContext,
- protocolSession.getRegistry().getProtocolVersionMethodConverter().convertToContentChunk(
- contentBody)))
- {
- // 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(protocolSession);
- _currentMessage = null;
- }
- }
- 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
- {
- _exchanges.routeContent(_currentMessage);
- }
- catch (NoRouteException e)
- {
- _returnMessages.add(e);
- }
- }
-
- public long getNextDeliveryTag()
- {
- return _deliveryTag.incrementAndGet();
- }
-
- 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 session the protocol session of the subscriber
- * @param noLocal Flag stopping own messages being receivied.
- * @param exclusive Flag requesting exclusive access to the queue
- * @param acks Are acks enabled for this subscriber
- * @param filters Filters to apply to this subscriber
- *
- * @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, AMQProtocolSession session, boolean acks,
- FieldTable filters, boolean noLocal, boolean exclusive) throws AMQException, ConsumerTagNotUniqueException
- {
- if (tag == null)
- {
- tag = new AMQShortString("sgen_" + getNextConsumerTag());
- }
-
- if (_consumerTag2QueueMap.containsKey(tag))
- {
- throw new ConsumerTagNotUniqueException();
- }
-
- queue.registerProtocolSession(session, _channelId, tag, acks, filters, noLocal, exclusive);
- _consumerTag2QueueMap.put(tag, queue);
-
- return tag;
- }
-
- public void unsubscribeConsumer(AMQProtocolSession session, AMQShortString consumerTag) throws AMQException
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Unacked Map Dump size:" + _unacknowledgedMessageMap.size());
- _unacknowledgedMessageMap.visit(new UnacknowledgedMessageMap.Visitor()
- {
-
- public boolean callback(UnacknowledgedMessage message) throws AMQException
- {
- _log.debug(message);
-
- return true;
- }
-
- public void visitComplete()
- { }
- });
- }
-
- AMQQueue q = _consumerTag2QueueMap.remove(consumerTag);
- if (q != null)
- {
- q.unregisterProtocolSession(session, _channelId, consumerTag);
- }
- }
-
- /**
- * Called from the protocol session to close this channel and clean up. T
- *
- * @param session The session to close
- *
- * @throws AMQException if there is an error during closure
- */
- public void close(AMQProtocolSession session) throws AMQException
- {
- _txnContext.rollback();
- unsubscribeAllConsumers(session);
- requeue();
-
- setClosing(true);
- }
-
- private void setClosing(boolean closing)
- {
- _closing = closing;
- }
-
- private void unsubscribeAllConsumers(AMQProtocolSession session) throws AMQException
- {
- if (_log.isInfoEnabled())
- {
- if (!_consumerTag2QueueMap.isEmpty())
- {
- _log.info("Unsubscribing all consumers on channel " + toString());
- }
- else
- {
- _log.info("No consumers to unsubscribe on channel " + toString());
- }
- }
-
- for (Map.Entry<AMQShortString, AMQQueue> me : _consumerTag2QueueMap.entrySet())
- {
- if (_log.isInfoEnabled())
- {
- _log.info("Unsubscribing consumer '" + me.getKey() + "' on channel " + toString());
- }
-
- me.getValue().unregisterProtocolSession(session, _channelId, me.getKey());
- }
-
- _consumerTag2QueueMap.clear();
- }
-
- /**
- * Add a message to the channel-based list of unacknowledged messages
- *
- * @param message the message that was delivered
- * @param deliveryTag the delivery tag used when delivering the message (see protocol spec for description of the
- * delivery tag)
- * @param consumerTag The tag for the consumer that is to acknowledge this message.
- * @param queue the queue from which the message was delivered
- */
- public void addUnacknowledgedMessage(AMQMessage message, long deliveryTag, AMQShortString consumerTag, AMQQueue queue)
- {
- if (_log.isDebugEnabled())
- {
- if (queue == null)
- {
- _log.debug("Adding unacked message with a null queue:" + message.debugIdentity());
- }
- else
- {
- if (_log.isDebugEnabled())
- {
- _log.debug(debugIdentity() + " Adding unacked message(" + message.toString() + " DT:" + deliveryTag
- + ") with a queue(" + queue + ") for " + consumerTag);
- }
- }
- }
-
- synchronized (_unacknowledgedMessageMap.getLock())
- {
- _unacknowledgedMessageMap.add(deliveryTag, new UnacknowledgedMessage(queue, message, consumerTag, deliveryTag));
- checkSuspension();
- }
- }
-
- 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<UnacknowledgedMessage> 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))
- {
- // if (_nonTransactedContext == null)
- {
- _nonTransactedContext =
- new NonTransactionalContext(_messageStore, _storeContext, this, _returnMessages, _browsedAcks);
- }
-
- deliveryContext = _nonTransactedContext;
- }
- else
- {
- deliveryContext = _txnContext;
- }
- }
-
- for (UnacknowledgedMessage unacked : messagesToBeDelivered)
- {
- if (unacked.queue != null)
- {
- // Ensure message is released for redelivery
- unacked.message.release(unacked.queue);
-
- // Mark message redelivered
- unacked.message.setRedelivered(true);
-
- // Deliver Message
- deliveryContext.deliver(unacked.message, unacked.queue, false);
-
- // Should we allow access To the DM to directy deliver the message?
- // As we don't need to check for Consumers or worry about incrementing the message count?
- // unacked.queue.getDeliveryManager().deliver(_storeContext, unacked.queue.getName(), unacked.message, false);
- }
- }
-
- }
-
- /**
- * Requeue a single message
- *
- * @param deliveryTag The message to requeue
- *
- * @throws AMQException If something goes wrong.
- */
- public void requeue(long deliveryTag) throws AMQException
- {
- UnacknowledgedMessage unacked = _unacknowledgedMessageMap.remove(deliveryTag);
-
- if (unacked != null)
- {
-
- // Ensure message is released for redelivery
- if (unacked.queue != null)
- {
- unacked.message.release(unacked.queue);
- }
-
- // Mark message redelivered
- unacked.message.setRedelivered(true);
-
- // 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))
- {
- // if (_nonTransactedContext == null)
- {
- _nonTransactedContext =
- new NonTransactionalContext(_messageStore, _storeContext, this, _returnMessages, _browsedAcks);
- }
-
- deliveryContext = _nonTransactedContext;
- }
- else
- {
- deliveryContext = _txnContext;
- }
-
- if (unacked.queue != null)
- {
- // Redeliver the messages to the front of the queue
- deliveryContext.deliver(unacked.message, unacked.queue, true);
- // 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.message.debugIdentity()
- + "):" + deliveryTag + " but no queue defined and no DeadLetter queue so DROPPING message.");
- // _log.error("Requested requeue of message:" + deliveryTag +
- // " but no queue defined using DeadLetter queue:" + getDeadLetterQueue());
- //
- // deliveryContext.deliver(unacked.message, getDeadLetterQueue(), false);
- //
- }
- }
- else
- {
- _log.warn("Requested requeue of message:" + deliveryTag + " but no such delivery tag exists."
- + _unacknowledgedMessageMap.size());
-
- if (_log.isDebugEnabled())
- {
- _unacknowledgedMessageMap.visit(new UnacknowledgedMessageMap.Visitor()
- {
- int count = 0;
-
- public boolean callback(UnacknowledgedMessage message) throws AMQException
- {
- _log.debug(
- (count++) + ": (" + message.message.debugIdentity() + ")" + "[" + message.deliveryTag + "]");
-
- return false; // Continue
- }
-
- public void visitComplete()
- { }
- });
- }
- }
-
- }
-
- /**
- * 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 List<UnacknowledgedMessage> msgToRequeue = new LinkedList<UnacknowledgedMessage>();
- final List<UnacknowledgedMessage> msgToResend = new LinkedList<UnacknowledgedMessage>();
-
- 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 UnacknowledgedMessageMap.Visitor()
- {
- public boolean callback(UnacknowledgedMessage message) throws AMQException
- {
- AMQShortString consumerTag = message.consumerTag;
- AMQMessage msg = message.message;
- msg.setRedelivered(true);
- if (consumerTag != null)
- {
- // Consumer exists
- if (_consumerTag2QueueMap.containsKey(consumerTag))
- {
- msgToResend.add(message);
- }
- else // consumer has gone
- {
- msgToRequeue.add(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.queue != null)
- {
- if (requeue)
- {
- msgToRequeue.add(message);
- }
- else
- {
- _log.info("No DeadLetter Queue and requeue not requested so dropping message:" + message);
- }
- }
- else
- {
- _log.info("Message.queue is null and no DeadLetter Queue so dropping message:" + message);
- }
- }
-
- // false means continue processing
- return false;
- }
-
- public void visitComplete()
- { }
- });
-
- // 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 (UnacknowledgedMessage message : msgToResend)
- {
- AMQMessage msg = message.message;
-
- // 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
- msg.release(message.queue);
-
- // 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 = msg.getDeliveredSubscription(message.queue);
-
- if (sub != null)
- {
- // Get the lock so we can tell if the sub scription has closed.
- // will stop delivery to this subscription until the lock is released.
- // note: this approach would allow the use of a single queue if the
- // PreDeliveryQueue would allow head additions.
- // In the Java Qpid client we are suspended whilst doing this so it is all rather Mute..
- // needs guidance from AMQP WG Model SIG
- synchronized (sub.getSendLock())
- {
- if (sub.isClosed())
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Subscription(" + System.identityHashCode(sub)
- + ") closed during resend so requeuing message");
- }
- // move this message to requeue
- msgToRequeue.add(message);
- }
- else
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Requeuing " + msg.debugIdentity() + " for resend via sub:"
- + System.identityHashCode(sub));
- }
-
- sub.addToResendQueue(msg);
- _unacknowledgedMessageMap.remove(message.deliveryTag);
- }
- } // sync(sub.getSendLock)
- }
- else
- {
-
- if (_log.isInfoEnabled())
- {
- _log.info("DeliveredSubscription not recorded so just requeueing(" + message.toString()
- + ")to prevent loss");
- }
- // move this message to requeue
- msgToRequeue.add(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))
- {
- if (_nonTransactedContext == null)
- {
- _nonTransactedContext =
- new NonTransactionalContext(_messageStore, _storeContext, this, _returnMessages, _browsedAcks);
- }
-
- deliveryContext = _nonTransactedContext;
- }
- else
- {
- deliveryContext = _txnContext;
- }
-
- // Process Messages to Requeue at the front of the queue
- for (UnacknowledgedMessage message : msgToRequeue)
- {
- message.message.release(message.queue);
- message.message.setRedelivered(true);
-
- deliveryContext.deliver(message.message, message.queue, true);
-
- _unacknowledgedMessageMap.remove(message.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
- *
- * @throws org.apache.qpid.AMQException if there is an error processing the unacked messages
- */
- public void queueDeleted(final AMQQueue queue) throws AMQException
- {
- _unacknowledgedMessageMap.visit(new UnacknowledgedMessageMap.Visitor()
- {
- public boolean callback(UnacknowledgedMessage message) throws AMQException
- {
- if (message.queue == queue)
- {
- try
- {
- message.discard(_storeContext);
- message.queue = null;
- }
- catch (AMQException e)
- {
- _log.error(
- "Error decrementing ref count on message " + message.message.getMessageId() + ": " + e, e);
- }
- }
-
- return false;
- }
-
- public void visitComplete()
- { }
- });
- }
-
- /**
- * 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
- {
- synchronized (_unacknowledgedMessageMap.getLock())
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Unacked (PreAck) Size:" + _unacknowledgedMessageMap.size());
- }
-
- _unacknowledgedMessageMap.acknowledgeMessage(deliveryTag, multiple, _txnContext);
-
- if (_log.isDebugEnabled())
- {
- _log.debug("Unacked (PostAck) Size:" + _unacknowledgedMessageMap.size());
- }
-
- }
-
- checkSuspension();
- }
-
- /**
- * Used only for testing purposes.
- *
- * @return the map of unacknowledged messages
- */
- public UnacknowledgedMessageMap getUnacknowledgedMessageMap()
- {
- return _unacknowledgedMessageMap;
- }
-
- private void checkSuspension()
- {
- boolean suspend;
-
- suspend =
- ((_prefetch_HighWaterMark != 0) && (_unacknowledgedMessageMap.size() >= _prefetch_HighWaterMark))
- || ((_prefetchSize != 0) && (_prefetchSize < _unacknowledgedMessageMap.getUnacknowledgeBytes()));
-
- setSuspended(suspend);
- }
-
- public void setSuspended(boolean suspended)
- {
- boolean isSuspended = _suspended.get();
-
- if (isSuspended && !suspended)
- {
- // Continue being suspended if we are above the _prefetch_LowWaterMark
- suspended = _unacknowledgedMessageMap.size() > _prefetch_LowWaterMark;
- }
-
- boolean wasSuspended = _suspended.getAndSet(suspended);
- if (wasSuspended != suspended)
- {
- if (wasSuspended)
- {
- _log.debug("Unsuspending channel " + this);
- // may need to deliver queued messages
- for (AMQQueue q : _consumerTag2QueueMap.values())
- {
- q.deliverAsync();
- }
- }
- else
- {
- _log.debug("Suspending channel " + this);
- }
- }
- }
-
- 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()
- {
- StringBuilder sb = new StringBuilder(30);
- sb.append("Channel: id ").append(_channelId).append(", transaction mode: ").append(isTransactional());
- sb.append(", prefetch marks: ").append(_prefetch_LowWaterMark);
- sb.append("/").append(_prefetch_HighWaterMark);
-
- return sb.toString();
- }
-
- public void setDefaultQueue(AMQQueue queue)
- {
- _defaultQueue = queue;
- }
-
- public AMQQueue getDefaultQueue()
- {
- return _defaultQueue;
- }
-
- public StoreContext getStoreContext()
- {
- return _storeContext;
- }
-
- public void processReturns(AMQProtocolSession session) throws AMQException
- {
- 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 boolean wouldSuspend(AMQMessage msg)
- {
- if (isSuspended())
- {
- return true;
- }
- else
- {
- boolean willSuspend =
- ((_prefetch_HighWaterMark != 0) && ((_unacknowledgedMessageMap.size() + 1) > _prefetch_HighWaterMark));
- if (!willSuspend)
- {
- final long unackedSize = _unacknowledgedMessageMap.getUnacknowledgeBytes();
-
- willSuspend = (_prefetchSize != 0) && (unackedSize != 0) && (_prefetchSize < (msg.getSize() + unackedSize));
- }
-
- if (willSuspend)
- {
- setSuspended(true);
- }
-
- return willSuspend;
- }
-
- }
-
- public TransactionalContext getTransactionalContext()
- {
- return _txnContext;
- }
-
- public boolean isClosing()
- {
- return _closing;
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/ConsumerTagNotUniqueException.java b/Final/java/broker/src/main/java/org/apache/qpid/server/ConsumerTagNotUniqueException.java
deleted file mode 100644
index 9a98af5689..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/Main.java b/Final/java/broker/src/main/java/org/apache/qpid/server/Main.java
deleted file mode 100644
index a87c704cf8..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/Main.java
+++ /dev/null
@@ -1,521 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.SimpleByteBufferAllocator;
-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());
-
- }
- catch (ConfigurationException e)
- {
- System.out.println("Error configuring message broker: " + e);
- _brokerLogger.error("Error configuring message broker: " + e);
- e.printStackTrace();
- }
- catch (Exception e)
- {
- System.out.println("Error intialising message broker: " + e);
- _brokerLogger.error("Error intialising message broker: " + e);
- e.printStackTrace();
- }
- }
- }
-
- 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 SimpleByteBufferAllocator());
- }
-
- 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);
- }
-
- acceptor.bind(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
- {
-
- acceptor.bind(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());
- }
- }
-
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/ManagedChannel.java b/Final/java/broker/src/main/java/org/apache/qpid/server/ManagedChannel.java
deleted file mode 100644
index e76f9c3f6c..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.java b/Final/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.java
deleted file mode 100644
index d61bb8916a..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/RequiredDeliveryException.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 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 final AMQMessage _amqMessage;
-
- public RequiredDeliveryException(String message, AMQMessage payload)
- {
- super(message);
-
- // 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();
-
- // payload.incrementReference();
- }
-
- public AMQMessage getAMQMessage()
- {
- return _amqMessage;
- }
-
- public AMQConstant getErrorCode()
- {
- return getReplyCode();
- }
-
- public abstract AMQConstant getReplyCode();
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/ack/TxAck.java b/Final/java/broker/src/main/java/org/apache/qpid/server/ack/TxAck.java
deleted file mode 100644
index 5ca8d57f7c..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/ack/TxAck.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.ack;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.txn.TxnOp;
-
-/**
- * A TxnOp implementation for handling accumulated acks
- */
-public class TxAck implements TxnOp
-{
- private final UnacknowledgedMessageMap _map;
- private final List <UnacknowledgedMessage> _unacked = new LinkedList<UnacknowledgedMessage>();
- private final List<Long> _individual = new LinkedList<Long>();
- private long _deliveryTag;
- private boolean _multiple;
-
- public TxAck(UnacknowledgedMessageMap map)
- {
- _map = map;
- }
-
- public void update(long deliveryTag, boolean multiple)
- {
- if (!multiple)
- {
- //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()
- {
- //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);
- }
- //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
- {
- //if any of the messages in unacked are persistent the txn
- //buffer must be marked as persistent:
- for (UnacknowledgedMessage msg : _unacked)
- {
- if (msg.message.isPersistent())
- {
- return true;
- }
- }
- return false;
- }
-
- public void prepare(StoreContext storeContext) throws AMQException
- {
- //make persistent changes, i.e. dequeue and decrementReference
- for (UnacknowledgedMessage msg : _unacked)
- {
- msg.restoreTransientMessageData();
-
- //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 (UnacknowledgedMessage msg : _unacked)
- {
- msg.clearTransientMessageData();
- msg.message.takeReference();
- }
- }
-
- public void commit(StoreContext storeContext)
- {
- //remove the unacked messages from the channels map
- _map.remove(_unacked);
- for (UnacknowledgedMessage msg : _unacked)
- {
- msg.clearTransientMessageData();
- }
-
- }
-
- public void rollback(StoreContext storeContext)
- {
- }
-}
-
-
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessage.java b/Final/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessage.java
deleted file mode 100644
index 7088c704ed..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessage.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.ack;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.store.StoreContext;
-
-public class UnacknowledgedMessage
-{
- public final AMQMessage message;
- public final AMQShortString consumerTag;
- public final long deliveryTag;
- public AMQQueue queue;
-
- public UnacknowledgedMessage(AMQQueue queue, AMQMessage message, AMQShortString consumerTag, long deliveryTag)
- {
- this.queue = queue;
- this.message = message;
- this.consumerTag = consumerTag;
- this.deliveryTag = deliveryTag;
- }
-
- public String toString()
- {
- StringBuilder sb = new StringBuilder();
- sb.append("Q:");
- sb.append(queue);
- sb.append(" M:");
- sb.append(message);
- sb.append(" CT:");
- sb.append(consumerTag);
- sb.append(" DT:");
- sb.append(deliveryTag);
-
- return sb.toString();
- }
-
- public void discard(StoreContext storeContext) throws AMQException
- {
- if (queue != null)
- {
- queue.dequeue(storeContext, message);
- }
- //if the queue is null then the message is waiting to be acked, but has been removed.
- message.decrementReference(storeContext);
- }
-
- public void restoreTransientMessageData() throws AMQException
- {
- message.restoreTransientMessageData();
- }
-
- public void clearTransientMessageData()
- {
- message.clearTransientMessageData();
- }
-}
-
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMap.java b/Final/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMap.java
deleted file mode 100644
index b69a917081..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMap.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.server.ack;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.txn.TransactionalContext;
-
-public interface UnacknowledgedMessageMap
-{
- public interface Visitor
- {
- /**
- * @param message the message being iterated over
- * @return true to stop iteration, false to continue
- * @throws AMQException
- */
- boolean callback(UnacknowledgedMessage message) throws AMQException;
-
- void visitComplete();
- }
-
- void visit(Visitor visitor) throws AMQException;
-
- Object getLock();
-
- void add(long deliveryTag, UnacknowledgedMessage message);
-
- void collect(long deliveryTag, boolean multiple, List<UnacknowledgedMessage> msgs);
-
- boolean contains(long deliveryTag) throws AMQException;
-
- void remove(List<UnacknowledgedMessage> msgs);
-
- UnacknowledgedMessage remove(long deliveryTag);
-
- void drainTo(Collection<UnacknowledgedMessage> destination, long deliveryTag) throws AMQException;
-
- Collection<UnacknowledgedMessage> cancelAllMessages();
-
- void acknowledgeMessage(long deliveryTag, boolean multiple, TransactionalContext txnContext) throws AMQException;
-
- int size();
-
- void clear();
-
- UnacknowledgedMessage 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/Final/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java b/Final/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.java
deleted file mode 100644
index 30bbdea2ef..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/ack/UnacknowledgedMessageMapImpl.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.ack;
-
-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.txn.TransactionalContext;
-
-public class UnacknowledgedMessageMapImpl implements UnacknowledgedMessageMap
-{
- private final Object _lock = new Object();
-
- private long _unackedSize;
-
- private Map<Long, UnacknowledgedMessage> _map;
-
- private long _lastDeliveryTag;
-
- private final int _prefetchLimit;
-
- public UnacknowledgedMessageMapImpl(int prefetchLimit)
- {
- _prefetchLimit = prefetchLimit;
- _map = new LinkedHashMap<Long, UnacknowledgedMessage>(prefetchLimit);
- }
-
- /*public UnacknowledgedMessageMapImpl(Object lock, Map<Long, UnacknowledgedMessage> map)
- {
- _lock = lock;
- _map = map;
- } */
-
- public void collect(long deliveryTag, boolean multiple, List<UnacknowledgedMessage> msgs)
- {
- if (multiple)
- {
- collect(deliveryTag, msgs);
- }
- else
- {
- msgs.add(get(deliveryTag));
- }
-
- }
-
- public boolean contains(long deliveryTag) throws AMQException
- {
- synchronized (_lock)
- {
- return _map.containsKey(deliveryTag);
- }
- }
-
- public void remove(List<UnacknowledgedMessage> msgs)
- {
- synchronized (_lock)
- {
- for (UnacknowledgedMessage msg : msgs)
- {
- remove(msg.deliveryTag);
- }
- }
- }
-
- public UnacknowledgedMessage remove(long deliveryTag)
- {
- synchronized (_lock)
- {
-
- UnacknowledgedMessage message = _map.remove(deliveryTag);
- if(message != null)
- {
- _unackedSize -= message.message.getSize();
- }
-
- return message;
- }
- }
-
- public void visit(Visitor visitor) throws AMQException
- {
- synchronized (_lock)
- {
- Collection<UnacknowledgedMessage> currentEntries = _map.values();
- for (UnacknowledgedMessage msg : currentEntries)
- {
- visitor.callback(msg);
- }
- visitor.visitComplete();
- }
- }
-
- public Object getLock()
- {
- return _lock;
- }
-
- public void add(long deliveryTag, UnacknowledgedMessage message)
- {
- synchronized (_lock)
- {
- _map.put(deliveryTag, message);
- _unackedSize += message.message.getSize();
- _lastDeliveryTag = deliveryTag;
- }
- }
-
- public Collection<UnacknowledgedMessage> cancelAllMessages()
- {
- synchronized (_lock)
- {
- Collection<UnacknowledgedMessage> currentEntries = _map.values();
- _map = new LinkedHashMap<Long, UnacknowledgedMessage>(_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(Collection<UnacknowledgedMessage> destination, long deliveryTag) throws AMQException
- {
- synchronized (_lock)
- {
- Iterator<Map.Entry<Long, UnacknowledgedMessage>> it = _map.entrySet().iterator();
- while (it.hasNext())
- {
- Map.Entry<Long, UnacknowledgedMessage> 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());
- }
-
- it.remove();
- _unackedSize -= unacked.getValue().message.getSize();
-
- destination.add(unacked.getValue());
- if (unacked.getKey() == deliveryTag)
- {
- break;
- }
- }
- }
- }
-
- public UnacknowledgedMessage get(long key)
- {
- synchronized (_lock)
- {
- return _map.get(key);
- }
- }
-
- public Set<Long> getDeliveryTags()
- {
- synchronized (_lock)
- {
- return _map.keySet();
- }
- }
-
- private void collect(long key, List<UnacknowledgedMessage> msgs)
- {
- synchronized (_lock)
- {
- for (Map.Entry<Long, UnacknowledgedMessage> entry : _map.entrySet())
- {
- msgs.add(entry.getValue());
- if (entry.getKey() == key)
- {
- break;
- }
- }
- }
- }
-
- public long getUnacknowledgeBytes()
- {
- return _unackedSize;
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/configuration/Configurator.java b/Final/java/broker/src/main/java/org/apache/qpid/server/configuration/Configurator.java
deleted file mode 100644
index 31c1b61a21..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java b/Final/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.java
deleted file mode 100644
index 8573902af4..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/configuration/VirtualHostConfiguration.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.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.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.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(AMQQueue queue)
- {
- CompositeConfiguration queueConfiguration = null;
- if (_config == null)
- return null;
-
- Configuration vHostConfiguration = _config.subset(VIRTUALHOST_PROPERTY_BASE + queue.getVirtualHost().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);
-
- queue = new AMQQueue(queueName,
- durable,
- owner == null ? null : new AMQShortString(owner) /* These queues will have no owner */,
- autodelete /* Therefore autodelete makes no sence */, virtualHost);
-
- 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(routingKey, null, exchange);
-
-
- _logger.info("Queue '" + queue.getName() + "' bound to exchange:" + exchangeName + " RK:'" + routingKey + "'");
- }
-
- if(exchange != virtualHost.getExchangeRegistry().getDefaultExchange())
- {
- queue.bind(queue.getName(), null, virtualHost.getExchangeRegistry().getDefaultExchange());
- }
- }
-
- }
-
-
-
- Configurator.configure(queue, queueConfiguration);
- }
-
-
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.java
deleted file mode 100644
index 9ebb893362..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/AbstractExchange.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.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();
- }
- }
-
- abstract public Map<AMQShortString, List<AMQQueue>> getBindings();
-
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.java
deleted file mode 100644
index c349b44d6d..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeFactory.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.server.exchange;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQUnknownExchangeType;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class DefaultExchangeFactory implements ExchangeFactory
-{
- private static final Logger _logger = Logger.getLogger(DefaultExchangeFactory.class);
-
- private Map<AMQShortString, Class<? extends Exchange>> _exchangeClassMap = new HashMap<AMQShortString, Class<? extends Exchange>>();
- private final VirtualHost _host;
-
- public DefaultExchangeFactory(VirtualHost host)
- {
- _host = host;
- _exchangeClassMap.put(ExchangeDefaults.DIRECT_EXCHANGE_CLASS, org.apache.qpid.server.exchange.DestNameExchange.class);
- _exchangeClassMap.put(ExchangeDefaults.TOPIC_EXCHANGE_CLASS, org.apache.qpid.server.exchange.DestWildExchange.class);
- _exchangeClassMap.put(ExchangeDefaults.HEADERS_EXCHANGE_CLASS, org.apache.qpid.server.exchange.HeadersExchange.class);
- _exchangeClassMap.put(ExchangeDefaults.FANOUT_EXCHANGE_CLASS, org.apache.qpid.server.exchange.FanoutExchange.class);
-
- }
-
- public Exchange createExchange(AMQShortString exchange, AMQShortString type, boolean durable, boolean autoDelete,
- int ticket)
- throws AMQException
- {
- Class<? extends Exchange> exchClass = _exchangeClassMap.get(type);
- if (exchClass == null)
- {
-
- throw new AMQUnknownExchangeType("Unknown exchange type: " + type);
- }
- try
- {
- Exchange e = exchClass.newInstance();
- e.initialise(_host, exchange, durable, ticket, autoDelete);
- return e;
- }
- catch (InstantiationException e)
- {
- throw new AMQException("Unable to create exchange: " + e, e);
- }
- catch (IllegalAccessException e)
- {
- throw new AMQException("Unable to create exchange: " + e, e);
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.java
deleted file mode 100644
index 98abf7977a..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DefaultExchangeRegistry.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.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.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(AMQMessage payload) throws AMQException
- {
- final AMQShortString exchange = payload.getMessagePublishInfo().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/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DestNameExchange.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DestNameExchange.java
deleted file mode 100644
index 5edffc19ed..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DestNameExchange.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.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.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.management.MBeanConstructor;
-import org.apache.qpid.server.management.MBeanDescription;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-
-public class DestNameExchange extends AbstractExchange
-{
- private static final Logger _logger = Logger.getLogger(DestNameExchange.class);
-
- /**
- * Maps from queue name to queue instances
- */
- private final Index _index = new Index();
-
- /**
- * MBean class implementing the management interfaces.
- */
- @MBeanDescription("Management Bean for Direct Exchange")
- private final class DestNameExchangeMBean extends ExchangeMBean
- {
- @MBeanConstructor("Creates an MBean for AMQ direct exchange")
- public DestNameExchangeMBean() 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(new AMQShortString(binding), null, DestNameExchange.this);
- }
- catch (AMQException ex)
- {
- throw new MBeanException(ex);
- }
- }
-
- }// End of MBean class
-
-
- protected ExchangeMBean createMBean() throws AMQException
- {
- try
- {
- return new DestNameExchangeMBean();
- }
- 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))
- {
- _logger.debug("Queue " + queue + " is already registered with routing key " + routingKey);
- }
- else
- {
- _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;
- assert routingKey != null;
-
- if (!_index.remove(routingKey, queue))
- {
- throw new AMQException("Queue " + queue + " was not registered with exchange " + this.getName() +
- " with routing key " + routingKey + ". No queue was registered with that _routing key");
- }
- }
-
- public void route(AMQMessage payload) throws AMQException
- {
- final MessagePublishInfo info = payload.getMessagePublishInfo();
- final AMQShortString routingKey = info.getRoutingKey();
- final List<AMQQueue> queues = (routingKey == null) ? null : _index.get(routingKey);
- if (queues == null || queues.isEmpty())
- {
- String msg = "Routing key " + routingKey + " is not known to " + this;
- if (info.isMandatory() || info.isImmediate())
- {
- throw new NoRouteException(msg, payload);
- }
- else
- {
- _logger.error("MESSAGE LOSS: Message should be sent on a Dead Letter Queue");
- _logger.warn(msg);
- }
- }
- else
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Publishing message to queue " + queues);
- }
-
- for (AMQQueue q : queues)
- {
- payload.enqueue(q);
- }
- }
- }
-
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java
deleted file mode 100644
index b55dbcc792..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/DestWildExchange.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.management.MBeanConstructor;
-import org.apache.qpid.server.management.MBeanDescription;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-
-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.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-public class DestWildExchange extends AbstractExchange
-{
- private static final Logger _logger = Logger.getLogger(DestWildExchange.class);
-
- private ConcurrentHashMap<AMQShortString, List<AMQQueue>> _routingKey2queues =
- new ConcurrentHashMap<AMQShortString, List<AMQQueue>>();
- // private ConcurrentHashMap<AMQShortString, AMQQueue> _routingKey2queue = new ConcurrentHashMap<AMQShortString, AMQQueue>();
- private static final String TOPIC_SEPARATOR = ".";
- private static final String AMQP_STAR = "*";
- private static final String AMQP_HASH = "#";
-
- /** DestWildExchangeMBean class implements the management interface for the Topic exchanges. */
- @MBeanDescription("Management Bean for Topic Exchange")
- private final class DestWildExchangeMBean extends ExchangeMBean
- {
- @MBeanConstructor("Creates an MBean for AMQ topic exchange")
- public DestWildExchangeMBean() throws JMException
- {
- super();
- _exchangeType = "topic";
- init();
- }
-
- /** returns exchange bindings in tabular form */
- public TabularData bindings() throws OpenDataException
- {
- _bindingList = new TabularDataSupport(_bindinglistDataType);
- for (Map.Entry<AMQShortString, List<AMQQueue>> entry : _routingKey2queues.entrySet())
- {
- AMQShortString key = entry.getKey();
- List<String> queueList = new ArrayList<String>();
-
- List<AMQQueue> queues = getMatchedQueues(key);
- 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(new AMQShortString(binding), null, DestWildExchange.this);
- }
- 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;
-
- AMQShortString routingKey = normalize(rKey);
-
- _logger.debug("Registering queue " + queue.getName() + " with routing key " + routingKey);
- // we need to use putIfAbsent, which is an atomic operation, to avoid a race condition
- List<AMQQueue> queueList = _routingKey2queues.putIfAbsent(routingKey, new CopyOnWriteArrayList<AMQQueue>());
- // if we got null back, no previous value was associated with the specified routing key hence
- // we need to read back the new value just put into the map
- if (queueList == null)
- {
- queueList = _routingKey2queues.get(routingKey);
- }
-
- if (!queueList.contains(queue))
- {
- queueList.add(queue);
- }
- else if (_logger.isDebugEnabled())
- {
- _logger.debug("Queue " + queue + " is already registered with routing key " + routingKey);
- }
-
- }
-
- private AMQShortString normalize(AMQShortString routingKey)
- {
- StringTokenizer routingTokens = new StringTokenizer(routingKey.toString(), TOPIC_SEPARATOR);
- List<String> _subscription = new ArrayList<String>();
-
- while (routingTokens.hasMoreTokens())
- {
- _subscription.add(routingTokens.nextToken());
- }
-
- int size = _subscription.size();
-
- for (int index = 0; index < size; index++)
- {
- // if there are more levels
- if ((index + 1) < size)
- {
- if (_subscription.get(index).equals(AMQP_HASH))
- {
- if (_subscription.get(index + 1).equals(AMQP_HASH))
- {
- // we don't need #.# delete this one
- _subscription.remove(index);
- size--;
- // redo this normalisation
- index--;
- }
-
- if (_subscription.get(index + 1).equals(AMQP_STAR))
- {
- // we don't want #.* swap to *.#
- // remove it and put it in at index + 1
- _subscription.add(index + 1, _subscription.remove(index));
- }
- }
- } // if we have more levels
- }
-
- StringBuilder sb = new StringBuilder();
-
- for (String s : _subscription)
- {
- sb.append(s);
- sb.append(TOPIC_SEPARATOR);
- }
-
- sb.deleteCharAt(sb.length() - 1);
-
- return new AMQShortString(sb.toString());
- }
-
- public void route(AMQMessage payload) throws AMQException
- {
- MessagePublishInfo info = payload.getMessagePublishInfo();
-
- final AMQShortString routingKey = normalize(info.getRoutingKey());
-
- List<AMQQueue> queues = getMatchedQueues(routingKey);
- // if we have no registered queues we have nothing to do
- // TODO: add support for the immediate flag
- if ((queues == null) || queues.isEmpty())
- {
- if (info.isMandatory() || info.isImmediate())
- {
- String msg = "Topic " + routingKey + " is not known to " + this;
- throw new NoRouteException(msg, payload);
- }
- else
- {
- _logger.warn("No queues found for routing key " + routingKey);
- _logger.warn("Routing map contains: " + _routingKey2queues);
-
- return;
- }
- }
-
- for (AMQQueue q : queues)
- {
- // TODO: modify code generator to add clone() method then clone the deliver body
- // without this addition we have a race condition - we will be modifying the body
- // before the encoder has encoded the body for delivery
- payload.enqueue(q);
- }
- }
-
- public boolean isBound(AMQShortString routingKey, FieldTable arguments, AMQQueue queue)
- {
- return isBound(routingKey, queue);
- }
-
- public boolean isBound(AMQShortString routingKey, AMQQueue queue)
- {
- List<AMQQueue> queues = _routingKey2queues.get(normalize(routingKey));
-
- return (queues != null) && queues.contains(queue);
- }
-
- public boolean isBound(AMQShortString routingKey)
- {
- List<AMQQueue> queues = _routingKey2queues.get(normalize(routingKey));
-
- return (queues != null) && !queues.isEmpty();
- }
-
- public boolean isBound(AMQQueue queue)
- {
- for (List<AMQQueue> queues : _routingKey2queues.values())
- {
- if (queues.contains(queue))
- {
- return true;
- }
- }
-
- return false;
- }
-
- public boolean hasBindings()
- {
- return !_routingKey2queues.isEmpty();
- }
-
- public synchronized void deregisterQueue(AMQShortString rKey, AMQQueue queue, FieldTable args) throws AMQException
- {
- assert queue != null;
- assert rKey != null;
-
- AMQShortString routingKey = normalize(rKey);
-
- List<AMQQueue> queues = _routingKey2queues.get(routingKey);
- if (queues == null)
- {
- throw new AMQException("Queue " + queue + " was not registered with exchange " + this.getName()
- + " with routing key " + routingKey + ". No queue was registered with that _routing key");
-
- }
-
- boolean removedQ = queues.remove(queue);
- if (!removedQ)
- {
- throw new AMQException("Queue " + queue + " was not registered with exchange " + this.getName()
- + " with routing key " + routingKey);
- }
-
- if (queues.isEmpty())
- {
- _routingKey2queues.remove(routingKey);
- }
- }
-
- protected ExchangeMBean createMBean() throws AMQException
- {
- try
- {
- return new DestWildExchangeMBean();
- }
- 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);
- }
- }
-
- public Map<AMQShortString, List<AMQQueue>> getBindings()
- {
- return _routingKey2queues;
- }
-
- private List<AMQQueue> getMatchedQueues(AMQShortString routingKey)
- {
- List<AMQQueue> list = new LinkedList<AMQQueue>();
- StringTokenizer routingTokens = new StringTokenizer(routingKey.toString(), TOPIC_SEPARATOR);
-
- ArrayList<String> routingkeyList = new ArrayList<String>();
-
- while (routingTokens.hasMoreTokens())
- {
- String next = routingTokens.nextToken();
- if (next.equals(AMQP_HASH) && routingkeyList.get(routingkeyList.size() - 1).equals(AMQP_HASH))
- {
- continue;
- }
-
- routingkeyList.add(next);
- }
-
- for (AMQShortString queue : _routingKey2queues.keySet())
- {
- StringTokenizer queTok = new StringTokenizer(queue.toString(), TOPIC_SEPARATOR);
-
- ArrayList<String> queueList = new ArrayList<String>();
-
- while (queTok.hasMoreTokens())
- {
- queueList.add(queTok.nextToken());
- }
-
- int depth = 0;
- boolean matching = true;
- boolean done = false;
- int routingskip = 0;
- int queueskip = 0;
-
- while (matching && !done)
- {
- if ((queueList.size() == (depth + queueskip)) || (routingkeyList.size() == (depth + routingskip)))
- {
- done = true;
-
- // if it was the routing key that ran out of digits
- if (routingkeyList.size() == (depth + routingskip))
- {
- if (queueList.size() > (depth + queueskip))
- { // a hash and it is the last entry
- matching =
- queueList.get(depth + queueskip).equals(AMQP_HASH)
- && (queueList.size() == (depth + queueskip + 1));
- }
- }
- else if (routingkeyList.size() > (depth + routingskip))
- {
- // There is still more routing key to check
- matching = false;
- }
-
- continue;
- }
-
- // if the values on the two topics don't match
- if (!queueList.get(depth + queueskip).equals(routingkeyList.get(depth + routingskip)))
- {
- if (queueList.get(depth + queueskip).equals(AMQP_STAR))
- {
- depth++;
-
- continue;
- }
- else if (queueList.get(depth + queueskip).equals(AMQP_HASH))
- {
- // Is this a # at the end
- if (queueList.size() == (depth + queueskip + 1))
- {
- done = true;
-
- continue;
- }
-
- // otherwise # in the middle
- while (routingkeyList.size() > (depth + routingskip))
- {
- if (routingkeyList.get(depth + routingskip).equals(queueList.get(depth + queueskip + 1)))
- {
- queueskip++;
- depth++;
-
- break;
- }
-
- routingskip++;
- }
-
- continue;
- }
-
- matching = false;
- }
-
- depth++;
- }
-
- if (matching)
- {
- list.addAll(_routingKey2queues.get(queue));
- }
- }
-
- return list;
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.java
deleted file mode 100644
index 37cd85a8f8..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/Exchange.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.exchange;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.queue.AMQMessage;
-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(AMQMessage 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();
-
- Map<AMQShortString, List<AMQQueue>> getBindings();
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.java
deleted file mode 100644
index e07fd0b8fc..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeFactory.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.server.exchange;
-
-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;
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeInUseException.java
deleted file mode 100644
index c77f114428..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ExchangeRegistry.java
deleted file mode 100644
index fe3b19e74e..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.java
deleted file mode 100644
index aa13f1d8ee..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/FanoutExchange.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.exchange;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.management.MBeanConstructor;
-import org.apache.qpid.server.management.MBeanDescription;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-
-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.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(new AMQShortString(binding), null, FanoutExchange.this);
- }
- 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 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("Queue " + queue + " was not registered with exchange " + this.getName() + ". ");
- }
- }
-
- public void route(AMQMessage payload) throws AMQException
- {
- final MessagePublishInfo publishInfo = payload.getMessagePublishInfo();
- final AMQShortString routingKey = publishInfo.getRoutingKey();
- if ((_queues == null) || _queues.isEmpty())
- {
- String msg = "No queues bound to " + this;
- if (publishInfo.isMandatory() || publishInfo.isImmediate())
- {
- throw new NoRouteException(msg, payload);
- }
- else
- {
- _logger.warn(msg);
- }
- }
- else
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Publishing message to queue " + _queues);
- }
-
- for (AMQQueue q : _queues)
- {
- payload.enqueue(q);
- }
- }
- }
-
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersBinding.java
deleted file mode 100644
index 2b7df4361a..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.java
deleted file mode 100644
index 3544e9d1f8..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/HeadersExchange.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.server.exchange;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-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.AMQMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-
-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.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);
-
- 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());
- _bindings.remove(new Registration(new HeadersBinding(args), queue));
- }
-
- public void route(AMQMessage payload) throws AMQException
- {
- FieldTable headers = getHeaders(payload.getContentHeaderBody());
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Exchange " + getName() + ": routing message with headers " + headers);
- }
- boolean routed = false;
- 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());
- }
- payload.enqueue(e.queue);
- routed = true;
- }
- }
- if (!routed)
- {
-
- String msg = "Exchange " + getName() + ": message not routable.";
-
- if (payload.getMessagePublishInfo().isMandatory() || payload.getMessagePublishInfo().isImmediate())
- {
- throw new NoRouteException(msg, payload);
- }
- else
- {
- _logger.warn(msg);
- }
-
- }
- }
-
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.java
deleted file mode 100644
index eacdad8a8e..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/Index.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.server.exchange;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-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 DestNameExchange.
- */
-class Index
-{
- private ConcurrentMap<AMQShortString, List<AMQQueue>> _index
- = new ConcurrentHashMap<AMQShortString, List<AMQQueue>>();
-
- synchronized boolean add(AMQShortString key, AMQQueue queue)
- {
- List<AMQQueue> queues = _index.get(key);
- if(queues == null)
- {
- queues = new CopyOnWriteArrayList<AMQQueue>();
- //next call is atomic, so there is no race to create the list
- List<AMQQueue> active = _index.putIfAbsent(key, queues);
- if(active != null)
- {
- //someone added the new one in faster than we did, so use theirs
- queues = active;
- }
- }
- if(queues.contains(queue))
- {
- return false;
- }
- else
- {
- return queues.add(queue);
- }
- }
-
- synchronized boolean remove(AMQShortString key, AMQQueue queue)
- {
- List<AMQQueue> queues = _index.get(key);
- if (queues != null)
- {
- boolean removed = queues.remove(queue);
- if (queues.size() == 0)
- {
- _index.remove(key);
- }
- return removed;
- }
- return false;
- }
-
- List<AMQQueue> get(AMQShortString key)
- {
- return _index.get(key);
- }
-
- Map<AMQShortString, List<AMQQueue>> getBindingsMap()
- {
- return new HashMap<AMQShortString, List<AMQQueue>>(_index);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/ManagedExchange.java
deleted file mode 100644
index 5d6d68b3c8..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/MessageRouter.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/MessageRouter.java
deleted file mode 100644
index 7508e80f7f..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/MessageRouter.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 org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-
-/**
- * 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(AMQMessage message) throws AMQException;
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.java b/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.java
deleted file mode 100644
index 1d6ab3842d..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/exchange/NoRouteException.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.exchange;
-
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.queue.AMQMessage;
-
-/**
- * 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 message)
- {
- super(msg, message);
- }
-
- public AMQConstant getReplyCode()
- {
- return AMQConstant.NO_ROUTE;
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/ArithmeticExpression.java
deleted file mode 100644
index fb5220f4da..0000000000
--- a/Final/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.AMQMessage;
-
-/**
- * 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;
-
- /**
- * @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(AMQMessage message) throws AMQException
- {
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/BinaryExpression.java
deleted file mode 100644
index 024257bea9..0000000000
--- a/Final/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 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 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 expression)
- {
- right = expression;
- }
-
- /**
- * @param expression
- */
- public void setLeft(Expression expression)
- {
- left = expression;
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.java
deleted file mode 100644
index e28ff79820..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/BooleanExpression.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.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;
-
-/**
- * A BooleanExpression is an expression that always
- * produces a Boolean result.
- */
-public interface BooleanExpression extends Expression
-{
-
- /**
- * @param message
- * @return true if the expression evaluates to Boolean.TRUE.
- * @throws AMQException
- */
- public boolean matches(AMQMessage message) throws AMQException;
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.java
deleted file mode 100644
index 72a9ef7969..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/ComparisonExpression.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.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;
-
-/**
- * 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(createGreaterThanEqual(value, left), createLessThanEqual(value, right));
- }
-
- public static BooleanExpression createNotBetween(Expression value, Expression left, Expression 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 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 (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(AMQMessage message) throws AMQException
- {
-
- 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(AMQMessage message) throws AMQException
- {
- 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 BooleanExpression doCreateEqual(Expression left, Expression right)
- {
- return new ComparisonExpression(left, right)
- {
-
- public Object evaluate(AMQMessage message) throws AMQException
- {
- 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)
- {
- 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(AMQMessage message) throws AMQException
- {
- 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(AMQMessage message) throws AMQException
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/ConstantExpression.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/ConstantExpression.java
deleted file mode 100644
index 0e729cc521..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/ConstantExpression.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.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;
-
-/**
- * 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(AMQMessage message) throws AMQException
- {
- 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(AMQMessage message) throws AMQException
- {
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.java
deleted file mode 100644
index 5f646c15db..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/Expression.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.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;
-
-/**
- * Represents an expression
- */
-public interface Expression
-{
-
- /**
- * @return the value of this expression
- */
- public Object evaluate(AMQMessage message) throws AMQException;
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManager.java
deleted file mode 100644
index c82de9fa15..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManager.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.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;
-
-public interface FilterManager
-{
- void add(MessageFilter filter);
-
- void remove(MessageFilter filter);
-
- boolean allAllow(AMQMessage msg);
-
- boolean hasFilters();
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.java
deleted file mode 100644
index 311f0680ec..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/FilterManagerFactory.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 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)
- {
-
- manager = new SimpleFilterManager();
-
- if(filters.containsKey(AMQPFilterTypes.JMS_SELECTOR.getValue()))
- {
- String selector = filters.getString(AMQPFilterTypes.JMS_SELECTOR.getValue());
-
- if (selector != null && !selector.equals(""))
- {
- manager.add(new JMSSelectorFilter(selector));
- }
-
- }
-
- if (filters.containsKey(AMQPFilterTypes.NO_CONSUME.getValue()))
- {
- manager.add(new NoConsumerFilter());
- }
-
-
-
- //If we added no filters don't bear the overhead of having an filter manager
- if (!manager.hasFilters())
- {
- manager = null;
- }
- }
- else
- {
- _logger.debug("No Filters found.");
- }
-
-
- return manager;
-
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.java
deleted file mode 100644
index 2061803d65..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/JMSSelectorFilter.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.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.AMQMessage;
-
-
-
-public class JMSSelectorFilter implements MessageFilter
-{
- private final static Logger _logger = org.apache.log4j.Logger.getLogger(JMSSelectorFilter.class);
-
- private String _selector;
- private BooleanExpression _matcher;
-
- public JMSSelectorFilter(String selector) throws AMQException
- {
- _selector = selector;
- _logger.info("Created JMSSelectorFilter with selector:" + _selector);
-
-
- _matcher = new SelectorParser().parse(selector);
-
-
- }
-
- public boolean matches(AMQMessage message)
- {
- try
- {
- boolean match = _matcher.matches(message);
- _logger.info(message + " match(" + match + ") selector(" + System.identityHashCode(_selector) + "):" + _selector);
- return match;
- }
- catch (AMQException e)
- {
- //fixme this needs to be sorted.. it shouldn't happen
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
- }
- return false;
- }
-
- public String getSelector()
- {
- return _selector;
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.java
deleted file mode 100644
index c8cbdb2125..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/LogicExpression.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.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;
-
-/**
- * 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(AMQMessage message) throws AMQException
- {
-
- 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(AMQMessage message) throws AMQException
- {
-
- 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(AMQMessage message) throws AMQException;
-
- public boolean matches(AMQMessage message) throws AMQException
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/MessageFilter.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/MessageFilter.java
deleted file mode 100644
index e6bfe974d5..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/MessageFilter.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.filter;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-
-public interface MessageFilter
-{
- boolean matches(AMQMessage message) throws AMQException;
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/NoConsumerFilter.java
deleted file mode 100644
index 47ca930d12..0000000000
--- a/Final/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.AMQMessage;
-
-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(AMQMessage message)
- {
- return true;
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java
deleted file mode 100644
index 5ab360ca19..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/PropertyExpression.java
+++ /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.
- *
- */
-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.AMQMessage;
-
-/**
- * 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 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> JMS_PROPERTY_EXPRESSIONS = new HashMap<String, Expression>();
-
- static
- {
- JMS_PROPERTY_EXPRESSIONS.put("JMSDestination", new Expression()
- {
- public Object evaluate(AMQMessage message)
- {
- //TODO
- return null;
- }
- });
- JMS_PROPERTY_EXPRESSIONS.put("JMSReplyTo", new Expression()
- {
- public Object evaluate(AMQMessage message)
- {
- try
- {
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
- AMQShortString replyTo = _properties.getReplyTo();
-
- return (replyTo == null) ? null : replyTo.toString();
- }
- catch (AMQException e)
- {
- _logger.warn(e);
-
- return null;
- }
-
- }
-
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSType", new Expression()
- {
- public Object evaluate(AMQMessage message)
- {
- try
- {
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
- AMQShortString type = _properties.getType();
-
- return (type == null) ? null : type.toString();
- }
- catch (AMQException e)
- {
- _logger.warn(e);
-
- return null;
- }
-
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSDeliveryMode", new Expression()
- {
- public Object evaluate(AMQMessage message)
- {
- try
- {
- int mode = message.isPersistent() ? PERSISTENT : NON_PERSISTENT;
- if (_logger.isDebugEnabled())
- {
- _logger.debug("JMSDeliveryMode is :" + mode);
- }
-
- return mode;
- }
- catch (AMQException e)
- {
- _logger.warn(e);
- }
-
- return NON_PERSISTENT;
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSPriority", new Expression()
- {
- public Object evaluate(AMQMessage message)
- {
- try
- {
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
-
- return (int) _properties.getPriority();
- }
- catch (AMQException e)
- {
- _logger.warn(e);
- }
-
- return DEFAULT_PRIORITY;
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("AMQMessageID", new Expression()
- {
- public Object evaluate(AMQMessage message)
- {
-
- try
- {
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
- AMQShortString messageId = _properties.getMessageId();
-
- return (messageId == null) ? null : messageId;
- }
- catch (AMQException e)
- {
- _logger.warn(e);
-
- return null;
- }
-
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSTimestamp", new Expression()
- {
- public Object evaluate(AMQMessage message)
- {
-
- try
- {
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
-
- return _properties.getTimestamp();
- }
- catch (AMQException e)
- {
- _logger.warn(e);
-
- return null;
- }
-
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSCorrelationID", new Expression()
- {
- public Object evaluate(AMQMessage message)
- {
-
- try
- {
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
- AMQShortString correlationId = _properties.getCorrelationId();
-
- return (correlationId == null) ? null : correlationId.toString();
- }
- catch (AMQException e)
- {
- _logger.warn(e);
-
- return null;
- }
-
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSExpiration", new Expression()
- {
- public Object evaluate(AMQMessage message)
- {
-
- try
- {
- CommonContentHeaderProperties _properties =
- (CommonContentHeaderProperties)
- message.getContentHeaderBody().properties;
-
- return _properties.getExpiration();
- }
- catch (AMQException e)
- {
- _logger.warn(e);
-
- return null;
- }
-
- }
- });
-
- JMS_PROPERTY_EXPRESSIONS.put("JMSRedelivered", new Expression()
- {
- public Object evaluate(AMQMessage message)
- {
- return message.isRedelivered();
- }
- });
-
- }
-
- private final String name;
- private final Expression jmsPropertyExpression;
-
- public PropertyExpression(String name)
- {
- this.name = name;
- jmsPropertyExpression = JMS_PROPERTY_EXPRESSIONS.get(name);
- }
-
- public Object evaluate(AMQMessage message) throws AMQException
- {
-
- 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);
-
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.java
deleted file mode 100644
index 62a45f5420..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/SimpleFilterManager.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.filter;
-
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-
-public class SimpleFilterManager implements FilterManager
-{
- private final Logger _logger = Logger.getLogger(SimpleFilterManager.class);
-
- private final ConcurrentLinkedQueue<MessageFilter> _filters;
-
- public SimpleFilterManager()
- {
- _logger.debug("Creating SimpleFilterManager");
- _filters = new ConcurrentLinkedQueue<MessageFilter>();
- }
-
- public void add(MessageFilter filter)
- {
- _filters.add(filter);
- }
-
- public void remove(MessageFilter filter)
- {
- _filters.remove(filter);
- }
-
- public boolean allAllow(AMQMessage msg)
- {
- for (MessageFilter 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/Final/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.java
deleted file mode 100644
index 83b4ed5358..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/UnaryExpression.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.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.AMQMessage;
-
-/**
- * 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(AMQMessage message) throws AMQException
- {
- Object rvalue = right.evaluate(message);
- if (rvalue == null)
- {
- return null;
- }
-
- if (rvalue instanceof Number)
- {
- return 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(AMQMessage message) throws AMQException
- {
-
- 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(AMQMessage message) throws AMQException
- {
- Object object = evaluate(message);
-
- return (object != null) && (object == Boolean.TRUE);
- }
- }
- ;
-
- public static BooleanExpression createNOT(BooleanExpression left)
- {
- return new BooleanUnaryExpression(left)
- {
- public Object evaluate(AMQMessage message) throws AMQException
- {
- 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 createXPath(final String xpath)
- {
- return new XPathExpression(xpath);
- }
-
- public static BooleanExpression createXQuery(final String xpath)
- {
- return new XQueryExpression(xpath);
- }
-
- public static BooleanExpression createBooleanCast(Expression left)
- {
- return new BooleanUnaryExpression(left)
- {
- public Object evaluate(AMQMessage message) throws AMQException
- {
- 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 (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 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();
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/XPathExpression.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/XPathExpression.java
deleted file mode 100644
index f5454afae5..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/XPathExpression.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.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 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(AMQMessage 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(AMQMessage 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(AMQMessage message) throws AMQException
- {
- Object object = evaluate(message);
- return object!=null && object==Boolean.TRUE;
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/XQueryExpression.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/XQueryExpression.java
deleted file mode 100644
index f5debb607a..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/XQueryExpression.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.filter;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.queue.AMQMessage;
-
-//
-// 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(AMQMessage 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(AMQMessage message) throws AMQException
- {
- Object object = evaluate(message);
- return object!=null && object==Boolean.TRUE;
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/XalanXPathEvaluator.java b/Final/java/broker/src/main/java/org/apache/qpid/server/filter/XalanXPathEvaluator.java
deleted file mode 100644
index 35d770fd5d..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/filter/XalanXPathEvaluator.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.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.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(AMQMessage 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/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicAckMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicAckMethodHandler.java
deleted file mode 100644
index a6972475a6..0000000000
--- a/Final/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, AMQMethodEvent<BasicAckBody> evt) throws AMQException
- {
- AMQProtocolSession protocolSession = stateManager.getProtocolSession();
- BasicAckBody body = evt.getMethod();
-
- if (_log.isDebugEnabled())
- {
- _log.debug("Ack(Tag:" + body.deliveryTag + ":Mult:" + body.multiple + ") received on channel " + evt.getChannelId());
- }
-
- final AMQChannel channel = protocolSession.getChannel(evt.getChannelId());
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(evt.getChannelId());
- }
-
- // this method throws an AMQException if the delivery tag is not known
- channel.acknowledgeMessage(body.deliveryTag, body.multiple);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicCancelMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicCancelMethodHandler.java
deleted file mode 100644
index 8bab96a11b..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicCancelMethodHandler.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.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.BasicCancelBody;
-import org.apache.qpid.framing.BasicCancelOkBody;
-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;
-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, AMQMethodEvent<BasicCancelBody> evt) throws AMQException
- {
- AMQProtocolSession protocolSession = stateManager.getProtocolSession();
-
- final AMQChannel channel = protocolSession.getChannel(evt.getChannelId());
- final BasicCancelBody body = evt.getMethod();
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(evt.getChannelId());
- }
-
- if (_log.isDebugEnabled())
- {
- _log.debug("BasicCancel: for:" + body.consumerTag +
- " nowait:" + body.nowait);
- }
-
- channel.unsubscribeConsumer(protocolSession, body.consumerTag);
- if (!body.nowait)
- {
- // 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.
- final AMQFrame responseFrame = BasicCancelOkBody.createAMQFrame(evt.getChannelId(),
- (byte) 8, (byte) 0, // AMQP version (major, minor)
- body.consumerTag); // consumerTag
- protocolSession.writeFrame(responseFrame);
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.java
deleted file mode 100644
index d1e4ae6aa6..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicConsumeMethodHandler.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.server.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicConsumeBody;
-import org.apache.qpid.framing.BasicConsumeOkBody;
-import org.apache.qpid.framing.ChannelCloseBody;
-import org.apache.qpid.framing.ConnectionCloseBody;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQMethodEvent;
-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.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 _log = Logger.getLogger(BasicConsumeMethodHandler.class);
-
- private static final BasicConsumeMethodHandler _instance = new BasicConsumeMethodHandler();
-
- public static BasicConsumeMethodHandler getInstance()
- {
- return _instance;
- }
-
- private BasicConsumeMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<BasicConsumeBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- BasicConsumeBody body = evt.getMethod();
- final int channelId = evt.getChannelId();
-
- AMQChannel channel = session.getChannel(channelId);
-
- VirtualHost vHost = session.getVirtualHost();
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(evt.getChannelId());
- }
- else
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("BasicConsume: from '" + body.queue +
- "' for:" + body.consumerTag +
- " nowait:" + body.nowait +
- " args:" + body.arguments);
- }
-
- AMQQueue queue = body.queue == null ? channel.getDefaultQueue() : vHost.getQueueRegistry().getQueue(body.queue);
-
- if (queue == null)
- {
- if (_log.isTraceEnabled())
- {
- _log.trace("No queue for '" + body.queue + "'");
- }
- if (body.queue != null)
- {
- String msg = "No such queue, '" + body.queue + "'";
- 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
- {
-
- if (body.consumerTag != null)
- {
- body.consumerTag = body.consumerTag.intern();
- }
-
- try
- {
- AMQShortString consumerTag = channel.subscribeToQueue(body.consumerTag, queue, session, !body.noAck,
- body.arguments, body.noLocal, body.exclusive);
- if (!body.nowait)
- {
- // 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(BasicConsumeOkBody.createAMQFrame(channelId,
- (byte) 8, (byte) 0, // AMQP version (major, minor)
- consumerTag)); // consumerTag
- }
-
- //now allow queue to start async processing of any backlog of messages
- queue.deliverAsync();
- }
- catch (org.apache.qpid.AMQInvalidArgumentException ise)
- {
- _log.debug("Closing connection due to invalid selector");
- // Why doesn't this ChannelException work.
-// throw body.getChannelException(AMQConstant.INVALID_ARGUMENT, ise.getMessage());
- // 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(ChannelCloseBody.createAMQFrame(channelId,
- (byte) 8, (byte) 0, // AMQP version (major, minor)
- BasicConsumeBody.getClazz((byte) 8, (byte) 0), // classId
- BasicConsumeBody.getMethod((byte) 8, (byte) 0), // methodId
- AMQConstant.INVALID_ARGUMENT.getCode(), // replyCode
- new AMQShortString(ise.getMessage()))); // replyText
- }
- catch (ConsumerTagNotUniqueException e)
- {
- AMQShortString msg = new AMQShortString("Non-unique consumer tag, '" + body.consumerTag + "'");
- // If the above doesn't work then perhaps this is wrong too.
-// throw body.getConnectionException(AMQConstant.NOT_ALLOWED,
-// "Non-unique consumer tag, '" + body.consumerTag + "'");
- // 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(ConnectionCloseBody.createAMQFrame(channelId,
- (byte) 8, (byte) 0, // AMQP version (major, minor)
- BasicConsumeBody.getClazz((byte) 8, (byte) 0), // classId
- BasicConsumeBody.getMethod((byte) 8, (byte) 0), // methodId
- AMQConstant.NOT_ALLOWED.getCode(), // replyCode
- msg)); // replyText
- }
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.java
deleted file mode 100644
index 782a89c704..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicGetMethodHandler.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.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.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-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;
-
-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, AMQMethodEvent<BasicGetBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- BasicGetBody body = evt.getMethod();
- final int channelId = evt.getChannelId();
- VirtualHost vHost = session.getVirtualHost();
-
- AMQChannel channel = session.getChannel(channelId);
- if (channel == null)
- {
- throw body.getChannelNotFoundException(evt.getChannelId());
- }
- else
- {
- AMQQueue queue = body.queue == null ? channel.getDefaultQueue() : vHost.getQueueRegistry().getQueue(body.queue);
-
- if (queue == null)
- {
- _log.info("No queue for '" + body.queue + "'");
- if(body.queue!=null)
- {
- throw body.getConnectionException(AMQConstant.NOT_FOUND,
- "No such queue, '" + body.queue + "'");
- }
- else
- {
- throw body.getConnectionException(AMQConstant.NOT_ALLOWED,
- "No queue name provided, no default queue defined.");
- }
- }
- else
- {
- if(!queue.performGet(session, channel, !body.noAck))
- {
-
-
- // TODO - set clusterId
- session.writeFrame(BasicGetEmptyBody.createAMQFrame(channelId, body.getMajor(), body.getMinor(), null));
- }
- }
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.java
deleted file mode 100644
index 68d4483df3..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicPublishMethodHandler.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.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.protocol.AMQMethodEvent;
-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.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 _log = Logger.getLogger(BasicPublishMethodHandler.class);
-
- private static final BasicPublishMethodHandler _instance = new BasicPublishMethodHandler();
-
-
- public static BasicPublishMethodHandler getInstance()
- {
- return _instance;
- }
-
- private BasicPublishMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<BasicPublishBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- final BasicPublishBody body = evt.getMethod();
-
- if (_log.isDebugEnabled())
- {
- _log.debug("Publish received on channel " + evt.getChannelId());
- }
-
- // TODO: check the delivery tag field details - is it unique across the broker or per subscriber?
- if (body.exchange == null)
- {
- body.exchange = ExchangeDefaults.DEFAULT_EXCHANGE_NAME;
-
- }
- else
- {
- body.exchange = body.exchange.intern();
- }
- VirtualHost vHost = session.getVirtualHost();
- Exchange e = vHost.getExchangeRegistry().getExchange(body.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(evt.getChannelId());
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(evt.getChannelId());
- }
-
- if(body.routingKey != null)
- {
- body.routingKey = body.routingKey.intern();
- }
-
- MessagePublishInfo info = session.getRegistry().getProtocolVersionMethodConverter().convertToInfo(body);
- channel.setPublishFrame(info, session);
- }
- }
-}
-
-
-
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicQosHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicQosHandler.java
deleted file mode 100644
index 3cd6a87f64..0000000000
--- a/Final/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.BasicQosOkBody;
-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 BasicQosHandler implements StateAwareMethodListener<BasicQosBody>
-{
- private static final BasicQosHandler _instance = new BasicQosHandler();
-
- public static BasicQosHandler getInstance()
- {
- return _instance;
- }
-
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<BasicQosBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- AMQChannel channel = session.getChannel(evt.getChannelId());
- if (channel == null)
- {
- throw evt.getMethod().getChannelNotFoundException(evt.getChannelId());
- }
-
- channel.setPrefetchCount(evt.getMethod().prefetchCount);
- channel.setPrefetchSize(evt.getMethod().prefetchSize);
-
- // 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(BasicQosOkBody.createAMQFrame(evt.getChannelId(), (byte) 8, (byte) 0));
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverMethodHandler.java
deleted file mode 100644
index a436c35473..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRecoverMethodHandler.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.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.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, AMQMethodEvent<BasicRecoverBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- _logger.debug("Recover received on protocol session " + session + " and channel " + evt.getChannelId());
- AMQChannel channel = session.getChannel(evt.getChannelId());
- BasicRecoverBody body = evt.getMethod();
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(evt.getChannelId());
- }
-
- channel.resend(body.requeue);
-
- // 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(BasicRecoverOkBody.createAMQFrame(evt.getChannelId(), (byte) 8, (byte) 0));
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.java
deleted file mode 100644
index aca485f62a..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/BasicRejectMethodHandler.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.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicRejectBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.ack.UnacknowledgedMessage;
-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, AMQMethodEvent<BasicRejectBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- int channelId = evt.getChannelId();
-
-// if (_logger.isDebugEnabled())
-// {
-// _logger.debug("Rejecting:" + evt.getMethod().deliveryTag +
-// ": Requeue:" + evt.getMethod().requeue +
-//// ": Resend:" + evt.getMethod().resend +
-// " on channel:" + channelId);
-// }
-
- AMQChannel channel = session.getChannel(channelId);
-
- if (channel == null)
- {
- throw evt.getMethod().getChannelNotFoundException(channelId);
- }
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Rejecting:" + evt.getMethod().deliveryTag +
- ": Requeue:" + evt.getMethod().requeue +
- //": Resend:" + evt.getMethod().resend +
- " on channel:" + channel.debugIdentity());
- }
-
- long deliveryTag = evt.getMethod().deliveryTag;
-
- UnacknowledgedMessage 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.queue == null || message.queue.isDeleted())
- {
- _logger.warn("Message's Queue as already been purged, unable to Reject. " +
- "Dropping message should use Dead Letter Queue");
- //sendtoDeadLetterQueue(msg)
- return;
- }
-
- if (!message.message.isReferenced())
- {
- _logger.warn("Message as already been purged, unable to Reject.");
- return;
- }
-
-
- if (_logger.isTraceEnabled())
- {
- _logger.trace("Rejecting: DT:" + deliveryTag + "-" + message.message.debugIdentity() +
- ": Requeue:" + evt.getMethod().requeue +
- //": 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.message.reject(message.message.getDeliveredSubscription(message.queue));
- }
-
- if (evt.getMethod().requeue)
- {
- channel.requeue(deliveryTag);
- }
- else
- {
- _logger.warn("Dropping message as requeue not required and there is no dead letter queue");
- //sendtoDeadLetterQueue(AMQMessage message)
-// message.queue = channel.getDefaultDeadLetterQueue();
-// channel.requeue(deliveryTag);
- }
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseHandler.java
deleted file mode 100644
index 1f4f1f9221..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseHandler.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.AMQFrame;
-import org.apache.qpid.framing.ChannelCloseBody;
-import org.apache.qpid.framing.ChannelCloseOkBody;
-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, AMQMethodEvent<ChannelCloseBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- ChannelCloseBody body = evt.getMethod();
- if (_logger.isInfoEnabled())
- {
- _logger.info("Received channel close for id " + evt.getChannelId() + " citing class " + body.classId +
- " and method " + body.methodId);
- }
- int channelId = evt.getChannelId();
-
- 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);
-
- // 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 response = ChannelCloseOkBody.createAMQFrame(evt.getChannelId(), (byte) 8, (byte) 0);
- session.writeFrame(response);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseOkHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelCloseOkHandler.java
deleted file mode 100644
index ad5604e7ea..0000000000
--- a/Final/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, AMQMethodEvent<ChannelCloseOkBody> evt) throws AMQException
- {
- int channelId = evt.getChannelId();
- _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/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelFlowHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelFlowHandler.java
deleted file mode 100644
index bfa170cfc5..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelFlowHandler.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.ChannelFlowBody;
-import org.apache.qpid.framing.ChannelFlowOkBody;
-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, AMQMethodEvent<ChannelFlowBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- ChannelFlowBody body = evt.getMethod();
-
- AMQChannel channel = session.getChannel(evt.getChannelId());
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(evt.getChannelId());
- }
-
- channel.setSuspended(!body.active);
- _logger.debug("Channel.Flow for channel " + evt.getChannelId() + ", active=" + body.active);
-
- // 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 response = ChannelFlowOkBody.createAMQFrame(evt.getChannelId(),
- (byte)8, (byte)0, // AMQP version (major, minor)
- body.active); // active
- session.writeFrame(response);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelOpenHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelOpenHandler.java
deleted file mode 100644
index 03fc7a3926..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ChannelOpenHandler.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.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.ChannelOpenBody;
-import org.apache.qpid.framing.ChannelOpenOkBody;
-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;
-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, AMQMethodEvent<ChannelOpenBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
-
- final AMQChannel channel = new AMQChannel(session,evt.getChannelId(), virtualHost.getMessageStore(),
- virtualHost.getExchangeRegistry());
- session.addChannel(channel);
- // 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 response = ChannelOpenOkBody.createAMQFrame(evt.getChannelId(), (byte)8, (byte)0);
- session.writeFrame(response);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseMethodHandler.java
deleted file mode 100644
index b086cad67f..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseMethodHandler.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.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.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, AMQMethodEvent<ConnectionCloseBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- final ConnectionCloseBody body = evt.getMethod();
- if (_logger.isInfoEnabled())
- {
- _logger.info("ConnectionClose received with reply code/reply text " + body.replyCode + "/" +
- body.replyText + " for " + session);
- }
- try
- {
- session.closeSession();
- }
- catch (Exception e)
- {
- _logger.error("Error closing protocol session: " + e, e);
- }
- // 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.
- final AMQFrame response = ConnectionCloseOkBody.createAMQFrame(evt.getChannelId(), (byte) 8, (byte) 0);
- session.writeFrame(response);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseOkMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionCloseOkMethodHandler.java
deleted file mode 100644
index 853f4df435..0000000000
--- a/Final/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, AMQMethodEvent<ConnectionCloseOkBody> evt) 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/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.java
deleted file mode 100644
index 30a40c5a75..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionOpenMethodHandler.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.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ConnectionOpenBody;
-import org.apache.qpid.framing.ConnectionOpenOkBody;
-import org.apache.qpid.protocol.AMQConstant;
-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;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.security.access.AccessResult;
-import org.apache.qpid.server.security.access.AccessRights;
-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, AMQMethodEvent<ConnectionOpenBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- ConnectionOpenBody body = evt.getMethod();
-
- //ignore leading '/'
- String virtualHostName;
- if ((body.virtualHost != null) && body.virtualHost.charAt(0) == '/')
- {
- virtualHostName = new StringBuilder(body.virtualHost.subSequence(1, body.virtualHost.length())).toString();
- }
- else
- {
- virtualHostName = body.virtualHost == null ? null : String.valueOf(body.virtualHost);
- }
-
- VirtualHost virtualHost = stateManager.getVirtualHostRegistry().getVirtualHost(virtualHostName);
-
- if (virtualHost == null)
- {
- throw body.getConnectionException(AMQConstant.NOT_FOUND, "Unknown virtual host: '" + virtualHostName + "'");
- }
- else
- {
- session.setVirtualHost(virtualHost);
-
- AccessResult result = virtualHost.getAccessManager().isAuthorized(virtualHost, session.getAuthorizedID(), AccessRights.Rights.ANY);
-
- switch (result.getStatus())
- {
- default:
- case REFUSED:
- String error = "Any access denied to vHost '" + virtualHostName + "' by "
- + result.getAuthorizer();
-
- _logger.warn(error);
-
- throw body.getConnectionException(AMQConstant.ACCESS_REFUSED, error);
- case GRANTED:
- _logger.info("Granted any access to vHost '" + virtualHostName + "' for " + session.getAuthorizedID()
- + " by '" + result.getAuthorizer() + "'");
- }
-
- // See Spec (0.8.2). Section 3.1.2 Virtual Hosts
- if (session.getContextKey() == null)
- {
- session.setContextKey(generateClientID());
- }
-
- // 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 response = ConnectionOpenOkBody.createAMQFrame((short) 0,
- (byte) 8, (byte) 0, // AMQP version (major, minor)
- body.virtualHost);
- stateManager.changeState(AMQState.CONNECTION_OPEN);
- session.writeFrame(response);
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionSecureOkMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionSecureOkMethodHandler.java
deleted file mode 100644
index fef00942a0..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionSecureOkMethodHandler.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.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.AMQFrame;
-import org.apache.qpid.framing.ConnectionCloseBody;
-import org.apache.qpid.framing.ConnectionSecureBody;
-import org.apache.qpid.framing.ConnectionSecureOkBody;
-import org.apache.qpid.framing.ConnectionTuneBody;
-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, AMQMethodEvent<ConnectionSecureOkBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- ConnectionSecureOkBody body = evt.getMethod();
-
- //fixme Vhost not defined yet
- //session.getVirtualHost().getAuthenticationManager();
- AuthenticationManager authMgr = ApplicationRegistry.getInstance().getAuthenticationManager();
-
- SaslServer ss = session.getSaslServer();
- if (ss == null)
- {
- throw new AMQException("No SASL context set up in session");
- }
-
- AuthenticationResult authResult = authMgr.authenticate(ss, body.response);
- switch (authResult.status)
- {
- case ERROR:
- // Can't do this as we violate protocol. Need to send Close
- // throw new AMQException(AMQConstant.NOT_ALLOWED.getCode(), AMQConstant.NOT_ALLOWED.getName());
- _logger.info("Authentication failed");
- stateManager.changeState(AMQState.CONNECTION_CLOSING);
- // 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 close = ConnectionCloseBody.createAMQFrame(0,
- (byte)8, (byte)0, // AMQP version (major, minor)
- ConnectionCloseBody.getClazz((byte)8, (byte)0), // classId
- ConnectionCloseBody.getMethod((byte)8, (byte)0), // methodId
- AMQConstant.NOT_ALLOWED.getCode(), // replyCode
- AMQConstant.NOT_ALLOWED.getName()); // replyText
- session.writeFrame(close);
- disposeSaslServer(session);
- break;
- case SUCCESS:
- _logger.info("Connected as: " + ss.getAuthorizationID());
- stateManager.changeState(AMQState.CONNECTION_NOT_TUNED);
- // TODO: Check the value of channelMax here: This should be the max
- // value of a 2-byte unsigned integer (as channel is only 2 bytes on the wire),
- // not Integer.MAX_VALUE (which is signed 4 bytes).
- // 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 tune = ConnectionTuneBody.createAMQFrame(0,
- (byte)8, (byte)0, // AMQP version (major, minor)
- Integer.MAX_VALUE, // channelMax
- ConnectionStartOkMethodHandler.getConfiguredFrameSize(), // frameMax
- HeartbeatConfig.getInstance().getDelay()); // heartbeat
- session.writeFrame(tune);
- session.setAuthorizedID(new UsernamePrincipal(ss.getAuthorizationID()));
- disposeSaslServer(session);
- break;
- case CONTINUE:
- stateManager.changeState(AMQState.CONNECTION_NOT_AUTH);
- // 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 challenge = ConnectionSecureBody.createAMQFrame(0,
- (byte)8, (byte)0, // AMQP version (major, minor)
- authResult.challenge); // challenge
- session.writeFrame(challenge);
- }
- }
-
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.java
deleted file mode 100644
index bb9eeed1d4..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionStartOkMethodHandler.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.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.AMQFrame;
-import org.apache.qpid.framing.ConnectionSecureBody;
-import org.apache.qpid.framing.ConnectionStartOkBody;
-import org.apache.qpid.framing.ConnectionTuneBody;
-import org.apache.qpid.framing.ConnectionCloseBody;
-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 StateAwareMethodListener<ConnectionStartOkBody> getInstance()
- {
- return _instance;
- }
-
- private ConnectionStartOkMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<ConnectionStartOkBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- final ConnectionStartOkBody body = evt.getMethod();
- _logger.info("SASL Mechanism selected: " + body.mechanism);
- _logger.info("Locale selected: " + body.locale);
-
- AuthenticationManager authMgr = ApplicationRegistry.getInstance().getAuthenticationManager();//session.getVirtualHost().getAuthenticationManager();
-
- SaslServer ss = null;
- try
- {
- ss = authMgr.createSaslServer(String.valueOf(body.mechanism), session.getLocalFQDN());
-
- if (ss == null)
- {
- throw body.getConnectionException(AMQConstant.RESOURCE_ERROR, "Unable to create SASL Server:" + body.mechanism
- );
- }
-
- session.setSaslServer(ss);
-
- AuthenticationResult authResult = authMgr.authenticate(ss, body.response);
-
- //save clientProperties
- if (session.getClientProperties() == null)
- {
- session.setClientProperties(body.clientProperties);
- }
-
- switch (authResult.status)
- {
- case ERROR:
- _logger.info("Authentication failed");
- stateManager.changeState(AMQState.CONNECTION_CLOSING);
- // 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 close = ConnectionCloseBody.createAMQFrame(0,
- (byte) 8, (byte) 0, // AMQP version (major, minor)
- ConnectionCloseBody.getClazz((byte) 8, (byte) 0), // classId
- ConnectionCloseBody.getMethod((byte) 8, (byte) 0), // methodId
- AMQConstant.NOT_ALLOWED.getCode(), // replyCode
- AMQConstant.NOT_ALLOWED.getName()); // replyText
- session.writeFrame(close);
- disposeSaslServer(session);
- break;
-
- case SUCCESS:
- _logger.info("Connected as: " + ss.getAuthorizationID());
- session.setAuthorizedID(new UsernamePrincipal(ss.getAuthorizationID()));
-
- stateManager.changeState(AMQState.CONNECTION_NOT_TUNED);
- // 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 tune = ConnectionTuneBody.createAMQFrame(0,
- (byte) 8, (byte) 0, // AMQP version (major, minor)
- Integer.MAX_VALUE, // channelMax
- getConfiguredFrameSize(), // frameMax
- HeartbeatConfig.getInstance().getDelay()); // heartbeat
- session.writeFrame(tune);
- break;
- case CONTINUE:
- stateManager.changeState(AMQState.CONNECTION_NOT_AUTH);
- // 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 challenge = ConnectionSecureBody.createAMQFrame(0,
- (byte) 8, (byte) 0, // AMQP version (major, minor)
- authResult.challenge); // challenge
- session.writeFrame(challenge);
- }
- }
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionTuneOkMethodHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ConnectionTuneOkMethodHandler.java
deleted file mode 100644
index ab7695955c..0000000000
--- a/Final/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, AMQMethodEvent<ConnectionTuneOkBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- ConnectionTuneOkBody body = evt.getMethod();
- if (_logger.isDebugEnabled())
- {
- _logger.debug(body);
- }
- stateManager.changeState(AMQState.CONNECTION_NOT_OPENED);
- session.initHeartbeats(body.heartbeat);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.java
deleted file mode 100644
index 162c03b025..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeBoundHandler.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.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ExchangeBoundBody;
-import org.apache.qpid.framing.ExchangeBoundOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.exchange.Exchange;
-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.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, AMQMethodEvent<ExchangeBoundBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
-
- // 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.
- byte major = (byte)8;
- byte minor = (byte)0;
-
- ExchangeBoundBody body = evt.getMethod();
-
- AMQShortString exchangeName = body.exchange;
- AMQShortString queueName = body.queue;
- AMQShortString routingKey = body.routingKey;
- if (exchangeName == null)
- {
- throw new AMQException("Exchange exchange must not be null");
- }
- Exchange exchange = virtualHost.getExchangeRegistry().getExchange(exchangeName);
- AMQFrame response;
- if (exchange == null)
- {
- // AMQP version change: Be aware of possible changes to parameter order as versions change.
- response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
- major, minor, // AMQP version (major, minor)
- EXCHANGE_NOT_FOUND, // replyCode
- new AMQShortString("Exchange " + exchangeName + " not found")); // replyText
- }
- else if (routingKey == null)
- {
- if (queueName == null)
- {
- if (exchange.hasBindings())
- {
- // AMQP version change: Be aware of possible changes to parameter order as versions change.
- response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
- major, minor, // AMQP version (major, minor)
- OK, // replyCode
- null); // replyText
- }
- else
- {
- // AMQP version change: Be aware of possible changes to parameter order as versions change.
- response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
- major, minor, // AMQP version (major, minor)
- NO_BINDINGS, // replyCode
- null); // replyText
- }
- }
- else
- {
-
- AMQQueue queue = queueRegistry.getQueue(queueName);
- if (queue == null)
- {
- // AMQP version change: Be aware of possible changes to parameter order as versions change.
- response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
- major, minor, // AMQP version (major, minor)
- QUEUE_NOT_FOUND, // replyCode
- new AMQShortString("Queue " + queueName + " not found")); // replyText
- }
- else
- {
- if (exchange.isBound(queue))
- {
- // AMQP version change: Be aware of possible changes to parameter order as versions change.
- response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
- major, minor, // AMQP version (major, minor)
- OK, // replyCode
- null); // replyText
- }
- else
- {
- // AMQP version change: Be aware of possible changes to parameter order as versions change.
- response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
- major, minor, // AMQP version (major, minor)
- 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)
- {
- // AMQP version change: Be aware of possible changes to parameter order as versions change.
- response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
- major, minor, // AMQP version (major, minor)
- QUEUE_NOT_FOUND, // replyCode
- new AMQShortString("Queue " + queueName + " not found")); // replyText
- }
- else
- {
- if (exchange.isBound(body.routingKey, queue))
- {
- // AMQP version change: Be aware of possible changes to parameter order as versions change.
- response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
- major, minor, // AMQP version (major, minor)
- OK, // replyCode
- null); // replyText
- }
- else
- {
- // AMQP version change: Be aware of possible changes to parameter order as versions change.
- response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
- major, minor, // AMQP version (major, minor)
- SPECIFIC_QUEUE_NOT_BOUND_WITH_RK, // replyCode
- new AMQShortString("Queue " + queueName + " not bound with routing key " +
- body.routingKey + " to exchange " + exchangeName)); // replyText
- }
- }
- }
- else
- {
- if (exchange.isBound(body.routingKey))
- {
- // AMQP version change: Be aware of possible changes to parameter order as versions change.
- response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
- major, minor, // AMQP version (major, minor)
- OK, // replyCode
- null); // replyText
- }
- else
- {
- // AMQP version change: Be aware of possible changes to parameter order as versions change.
- response = ExchangeBoundOkBody.createAMQFrame(evt.getChannelId(),
- major, minor, // AMQP version (major, minor)
- NO_QUEUE_BOUND_WITH_RK, // replyCode
- new AMQShortString("No queue bound with routing key " + body.routingKey +
- " to exchange " + exchangeName)); // replyText
- }
- }
- session.writeFrame(response);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeclareHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeclareHandler.java
deleted file mode 100644
index 8ab8366d9e..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeclareHandler.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.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.AMQFrame;
-import org.apache.qpid.framing.ExchangeDeclareBody;
-import org.apache.qpid.framing.ExchangeDeclareOkBody;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQMethodEvent;
-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.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, AMQMethodEvent<ExchangeDeclareBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
- ExchangeFactory exchangeFactory = virtualHost.getExchangeFactory();
-
- final ExchangeDeclareBody body = evt.getMethod();
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Request to declare exchange of type " + body.type + " with name " + body.exchange);
- }
- synchronized(exchangeRegistry)
- {
- Exchange exchange = exchangeRegistry.getExchange(body.exchange);
-
-
-
- if (exchange == null)
- {
- if(body.passive && ((body.type == null) || body.type.length() ==0))
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "Unknown exchange: " + body.exchange);
- }
- else
- {
- try
- {
-
- exchange = exchangeFactory.createExchange(body.exchange == null ? null : body.exchange.intern(),
- body.type == null ? null : body.type.intern(),
- body.durable,
- body.passive, body.ticket);
- exchangeRegistry.registerExchange(exchange);
- }
- catch(AMQUnknownExchangeType e)
- {
- throw body.getConnectionException(AMQConstant.COMMAND_INVALID, "Unknown exchange: " + body.exchange,e);
- }
- }
- }
- else if (!exchange.getType().equals(body.type))
- {
-
- throw new AMQConnectionException(AMQConstant.NOT_ALLOWED, "Attempt to redeclare exchange: " + body.exchange + " of type " + exchange.getType() + " to " + body.type +".",body.getClazz(), body.getMethod(),body.getMajor(),body.getMinor());
- }
-
- }
- if(!body.nowait)
- {
- // 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 response = ExchangeDeclareOkBody.createAMQFrame(evt.getChannelId(), (byte)8, (byte)0);
- session.writeFrame(response);
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeleteHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeleteHandler.java
deleted file mode 100644
index f9926c399c..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/ExchangeDeleteHandler.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.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.ExchangeDeleteBody;
-import org.apache.qpid.framing.ExchangeDeleteOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-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.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, AMQMethodEvent<ExchangeDeleteBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
-
- ExchangeDeleteBody body = evt.getMethod();
- try
- {
- exchangeRegistry.unregisterExchange(body.exchange, body.ifUnused);
- // 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 response = ExchangeDeleteOkBody.createAMQFrame(evt.getChannelId(), (byte)8, (byte)0);
- session.writeFrame(response);
- }
- catch (ExchangeInUseException e)
- {
- // TODO: sort out consistent channel close mechanism that does all clean up etc.
- }
-
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/OnCurrentThreadExecutor.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/OnCurrentThreadExecutor.java
deleted file mode 100644
index ac516b6133..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.java
deleted file mode 100644
index 3e68069838..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueueBindHandler.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.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQInvalidRoutingKeyException;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.QueueBindBody;
-import org.apache.qpid.framing.QueueBindOkBody;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQMethodEvent;
-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.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, AMQMethodEvent<QueueBindBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
-
- final QueueBindBody body = evt.getMethod();
- final AMQQueue queue;
- if (body.queue == null)
- {
- AMQChannel channel = session.getChannel(evt.getChannelId());
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(evt.getChannelId());
- }
-
- queue = channel.getDefaultQueue();
-
- if (queue == null)
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "No default queue defined on channel and queue was null");
- }
-
- if (body.routingKey == null)
- {
- body.routingKey = queue.getName();
- }
- }
- else
- {
- queue = queueRegistry.getQueue(body.queue);
- }
-
- if (queue == null)
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "Queue " + body.queue + " does not exist.");
- }
- final Exchange exch = exchangeRegistry.getExchange(body.exchange);
- if (exch == null)
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "Exchange " + body.exchange + " does not exist.");
- }
-
- if (body.routingKey != null)
- {
- body.routingKey = body.routingKey.intern();
- }
-
- try
- {
- if (!exch.isBound(body.routingKey, body.arguments, queue))
- {
- queue.bind(body.routingKey, body.arguments, exch);
- }
- }
- catch (AMQInvalidRoutingKeyException rke)
- {
- throw body.getChannelException(AMQConstant.INVALID_ROUTING_KEY, body.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 " + body.routingKey);
- }
- if (!body.nowait)
- {
- // 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.
- final AMQFrame response = QueueBindOkBody.createAMQFrame(evt.getChannelId(), (byte) 8, (byte) 0);
- session.writeFrame(response);
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.java
deleted file mode 100644
index 29697542be..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeclareHandler.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.server.handler;
-
-import java.text.MessageFormat;
-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.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.QueueDeclareBody;
-import org.apache.qpid.framing.QueueDeclareOkBody;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQMethodEvent;
-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.AMQQueue;
-import org.apache.qpid.server.queue.QueueRegistry;
-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 _log = Logger.getLogger(QueueDeclareHandler.class);
-
- private static final QueueDeclareHandler _instance = new QueueDeclareHandler();
-
- public static QueueDeclareHandler getInstance()
- {
- return _instance;
- }
-
- @Configured(path = "queue.auto_register", defaultValue = "false")
- public boolean autoRegister;
-
- private final AtomicInteger _counter = new AtomicInteger();
-
-
- protected QueueDeclareHandler()
- {
- Configurator.configure(this);
- }
-
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<QueueDeclareBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
- MessageStore store = virtualHost.getMessageStore();
-
- QueueDeclareBody body = evt.getMethod();
-
- // if we aren't given a queue name, we create one which we return to the client
- if (body.queue == null)
- {
- body.queue = createName();
- }
-
- AMQQueue queue;
- //TODO: do we need to check that the queue already exists with exactly the same "configuration"?
-
- synchronized (queueRegistry)
- {
-
-
-
- if (((queue = queueRegistry.getQueue(body.queue)) == null))
- {
- if(body.queue != null)
- {
- body.queue = body.queue.intern();
- }
-
- if (body.passive)
- {
- String msg = "Queue: " + body.queue + " not found on VirtualHost(" + virtualHost + ").";
- throw body.getChannelException(AMQConstant.NOT_FOUND, msg);
- }
- else
- {
- queue = createQueue(body, virtualHost, session);
- if (queue.isDurable() && !queue.isAutoDelete())
- {
- store.createQueue(queue);
- }
- queueRegistry.registerQueue(queue);
- if (autoRegister)
- {
- Exchange defaultExchange = exchangeRegistry.getDefaultExchange();
-
- queue.bind(body.queue, null, defaultExchange);
- _log.info("Queue " + body.queue + " 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('" + body.queue + "'),"
- + " as exclusive queue with same name "
- + "declared on another client ID('"
- + queue.getOwner() + "')");
- }
-
- AMQChannel channel = session.getChannel(evt.getChannelId());
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(evt.getChannelId());
- }
-
- //set this as the default queue on the channel:
- channel.setDefaultQueue(queue);
- }
-
- if (!body.nowait)
- {
- // 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 response = QueueDeclareOkBody.createAMQFrame(evt.getChannelId(),
- (byte) 8, (byte) 0, // AMQP version (major, minor)
- queue.getConsumerCount(), // consumerCount
- queue.getMessageCount(), // messageCount
- body.queue); // queue
- _log.info("Queue " + body.queue + " declared successfully");
- session.writeFrame(response);
- }
- }
-
- protected AMQShortString createName()
- {
- return new AMQShortString("tmp_" + UUID.randomUUID());
- }
-
- protected AMQQueue createQueue(QueueDeclareBody body, VirtualHost virtualHost, final AMQProtocolSession session)
- throws AMQException
- {
- final QueueRegistry registry = virtualHost.getQueueRegistry();
- AMQShortString owner = body.exclusive ? session.getContextKey() : null;
- final AMQQueue queue = new AMQQueue(body.queue, body.durable, owner, body.autoDelete, virtualHost);
- final AMQShortString queueName = queue.getName();
-
- if (body.exclusive && !body.durable)
- {
- 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
-
- Configuration virtualHostDefaultQueueConfiguration = VirtualHostConfiguration.getDefaultQueueConfiguration(queue);
- if (virtualHostDefaultQueueConfiguration != null)
- {
- Configurator.configure(queue, virtualHostDefaultQueueConfiguration);
- }
-
- return queue;
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.java
deleted file mode 100644
index eb7089afdc..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueueDeleteHandler.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.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.QueueDeleteBody;
-import org.apache.qpid.framing.QueueDeleteOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.protocol.AMQConstant;
-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.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;
-
-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, AMQMethodEvent<QueueDeleteBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
- MessageStore store = virtualHost.getMessageStore();
-
- QueueDeleteBody body = evt.getMethod();
- AMQQueue queue;
- if (body.queue == null)
- {
- AMQChannel channel = session.getChannel(evt.getChannelId());
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(evt.getChannelId());
- }
-
- //get the default queue on the channel:
- queue = channel.getDefaultQueue();
- }
- else
- {
- queue = queueRegistry.getQueue(body.queue);
- }
-
- if (queue == null)
- {
- if (_failIfNotFound)
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "Queue " + body.queue + " does not exist.");
- }
- }
- else
- {
- if (body.ifEmpty && !queue.isEmpty())
- {
- throw body.getChannelException(AMQConstant.IN_USE, "Queue: " + body.queue + " is not empty.");
- }
- else if (body.ifUnused && !queue.isUnused())
- {
- // TODO - Error code
- throw body.getChannelException(AMQConstant.IN_USE, "Queue: " + body.queue + " is still used.");
-
- }
- else
- {
- int purged = queue.delete(body.ifUnused, body.ifEmpty);
-
- if (queue.isDurable())
- {
- store.removeQueue(queue.getName());
- }
-
- // 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(QueueDeleteOkBody.createAMQFrame(evt.getChannelId(),
- (byte) 8, (byte) 0, // AMQP version (major, minor)
- purged)); // messageCount
- }
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueuePurgeHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueuePurgeHandler.java
deleted file mode 100644
index 3e1937bb43..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/QueuePurgeHandler.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.server.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.QueuePurgeBody;
-import org.apache.qpid.framing.QueuePurgeOkBody;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQMethodEvent;
-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.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.AMQChannel;
-
-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, AMQMethodEvent<QueuePurgeBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
-
- AMQChannel channel = session.getChannel(evt.getChannelId());
-
- QueuePurgeBody body = evt.getMethod();
- AMQQueue queue;
- if(body.queue == null)
- {
-
- if (channel == null)
- {
- throw body.getChannelNotFoundException(evt.getChannelId());
- }
-
- //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.queue);
- }
-
- if(queue == null)
- {
- if(_failIfNotFound)
- {
- throw body.getChannelException(AMQConstant.NOT_FOUND, "Queue " + body.queue + " does not exist.");
- }
- }
- else
- {
- long purged = queue.clearQueue(channel.getStoreContext());
-
-
- if(!body.nowait)
- {
- // 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(QueuePurgeOkBody.createAMQFrame(evt.getChannelId(),
- (byte)8, (byte)0, // AMQP version (major, minor)
- purged)); // messageCount
- }
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/TxCommitHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/TxCommitHandler.java
deleted file mode 100644
index 3d7ec286f9..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/TxCommitHandler.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.TxCommitBody;
-import org.apache.qpid.framing.TxCommitOkBody;
-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 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, AMQMethodEvent<TxCommitBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- try
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Commit received on channel " + evt.getChannelId());
- }
- AMQChannel channel = session.getChannel(evt.getChannelId());
-
- if (channel == null)
- {
- throw evt.getMethod().getChannelNotFoundException(evt.getChannelId());
- }
-
- channel.commit();
- // 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(TxCommitOkBody.createAMQFrame(evt.getChannelId(), (byte) 8, (byte) 0));
- channel.processReturns(session);
- }
- catch (AMQException e)
- {
- throw evt.getMethod().getChannelException(e.getErrorCode(), "Failed to commit: " + e.getMessage());
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/TxRollbackHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/TxRollbackHandler.java
deleted file mode 100644
index f747f7a840..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/TxRollbackHandler.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.qpid.AMQException;
-import org.apache.qpid.framing.TxRollbackBody;
-import org.apache.qpid.framing.TxRollbackOkBody;
-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, AMQMethodEvent<TxRollbackBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- try
- {
- AMQChannel channel = session.getChannel(evt.getChannelId());
-
- if (channel == null)
- {
- throw evt.getMethod().getChannelNotFoundException(evt.getChannelId());
- }
-
- channel.rollback();
- // 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(TxRollbackOkBody.createAMQFrame(evt.getChannelId(), (byte) 8, (byte) 0));
- //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 evt.getMethod().getChannelException(e.getErrorCode(), "Failed to rollback: " + e.getMessage());
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/handler/TxSelectHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/handler/TxSelectHandler.java
deleted file mode 100644
index a9e478e301..0000000000
--- a/Final/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.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, AMQMethodEvent<TxSelectBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
-
- AMQChannel channel = session.getChannel(evt.getChannelId());
-
- if (channel == null)
- {
- throw evt.getMethod().getChannelNotFoundException(evt.getChannelId());
- }
-
- channel.setLocalTransactional();
-
- // 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(TxSelectOkBody.createAMQFrame(evt.getChannelId(), (byte) 8, (byte) 0));
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/jms/JmsConsumer.java b/Final/java/broker/src/main/java/org/apache/qpid/server/jms/JmsConsumer.java
deleted file mode 100644
index c08fae4e4e..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/AMQManagedObject.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/AMQManagedObject.java
deleted file mode 100644
index a2c2bd62a2..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/DefaultManagedObject.java
deleted file mode 100644
index 84526dbc11..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.java
deleted file mode 100644
index 4caae2b26f..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/management/JMXManagedObjectRegistry.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.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 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 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 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)
- {
- env.put("jmx.remote.profiles", "SASL/PLAIN");
- env.put("jmx.remote.sasl.callback.handler", new UserCallbackHandler(db));
- }
-
- // 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);
- }
- }
-
- /** This class is used for SASL enabled JMXConnector for performing user authentication. */
- private class UserCallbackHandler implements CallbackHandler
- {
- private final PrincipalDatabase _principalDatabase;
-
- protected UserCallbackHandler(PrincipalDatabase database)
- {
- _principalDatabase = database;
- }
-
- public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
- {
- // Retrieve callbacks
- NameCallback ncb = null;
- PasswordCallback pcb = null;
- for (int i = 0; i < callbacks.length; i++)
- {
- if (callbacks[i] instanceof NameCallback)
- {
- ncb = (NameCallback) callbacks[i];
- }
- else if (callbacks[i] instanceof PasswordCallback)
- {
- pcb = (PasswordCallback) callbacks[i];
- }
- else if (callbacks[i] instanceof AuthorizeCallback)
- {
- ((AuthorizeCallback) callbacks[i]).setAuthorized(true);
- }
- else
- {
- throw new UnsupportedCallbackException(callbacks[i]);
- }
- }
-
- boolean authorized = false;
- // Process retrieval of password; can get password if username is available in NameCallback
- if ((ncb != null) && (pcb != null))
- {
- String username = ncb.getDefaultName();
- try
- {
- authorized = _principalDatabase.verifyPassword(username, pcb.getPassword());
- }
- catch (AccountNotFoundException e)
- {
- IOException ioe = new IOException("User not authorized. " + e);
- ioe.initCause(e);
- throw ioe;
- }
- }
-
- if (!authorized)
- {
- throw new IOException("User not authorized.");
- }
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanAttribute.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanAttribute.java
deleted file mode 100644
index 7d42297699..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanConstructor.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanConstructor.java
deleted file mode 100644
index 9138e03085..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanDescription.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanDescription.java
deleted file mode 100644
index 448fed3280..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanIntrospector.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanIntrospector.java
deleted file mode 100644
index 0c2ec2aebd..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanInvocationHandlerImpl.java
deleted file mode 100644
index 4fb260472d..0000000000
--- a/Final/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.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/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperation.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperation.java
deleted file mode 100644
index a2dca3e51d..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperationParameter.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/MBeanOperationParameter.java
deleted file mode 100644
index aba5ec70d8..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/Managable.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/Managable.java
deleted file mode 100644
index 166a2a376d..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/ManagedBroker.java
deleted file mode 100644
index 45e2e91ed7..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObject.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObject.java
deleted file mode 100644
index 42ea8921a4..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObjectRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/ManagedObjectRegistry.java
deleted file mode 100644
index d8d87ef881..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/ManagementConfiguration.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/ManagementConfiguration.java
deleted file mode 100644
index 042f626e8b..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/management/NoopManagedObjectRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/management/NoopManagedObjectRegistry.java
deleted file mode 100644
index b4fbed6948..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverter.java b/Final/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverter.java
deleted file mode 100644
index e01c5aabbf..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverterRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverterRegistry.java
deleted file mode 100644
index 8366c426dd..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/output/ProtocolOutputConverterRegistry.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.
- *
- */
-
-/*
- * 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.output.amqp0_8.ProtocolOutputConverterImpl;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-
-import java.util.Map;
-import java.util.HashMap;
-
-public class ProtocolOutputConverterRegistry
-{
-
- private static final Map<Byte, Map<Byte, Factory>> _registry =
- new HashMap<Byte, Map<Byte, Factory>>();
-
-
- static
- {
- register((byte) 8, (byte) 0, ProtocolOutputConverterImpl.getInstanceFactory());
- }
-
- private static void register(byte major, byte minor, Factory converter)
- {
- if(!_registry.containsKey(major))
- {
- _registry.put(major, new HashMap<Byte, Factory>());
- }
- _registry.get(major).put(minor, converter);
- }
-
-
- public static ProtocolOutputConverter getConverter(AMQProtocolSession session)
- {
- return _registry.get(session.getProtocolMajorVersion()).get(session.getProtocolMinorVersion()).newInstance(session);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.java b/Final/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.java
deleted file mode 100644
index 8462ed9557..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/output/amqp0_8/ProtocolOutputConverterImpl.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.
- *
- */
-
-/*
- * 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
- {
- ByteBuffer deliver = createEncodedDeliverFrame(message, channelId, deliveryTag, consumerTag);
- AMQDataBlock contentHeader = ContentHeaderBody.createAMQFrame(channelId,
- message.getContentHeaderBody());
-
- final AMQMessageHandle messageHandle = message.getMessageHandle();
- final StoreContext storeContext = message.getStoreContext();
- final Long messageId = message.getMessageId();
-
- final int bodyCount = messageHandle.getBodyCount(storeContext,messageId);
-
- 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,messageId, 0);
-
- AMQDataBlock firstContentBody = new AMQFrame(channelId, getProtocolSession().getRegistry().getProtocolVersionMethodConverter().convertToBody(cb));
- AMQDataBlock[] headerAndFirstContent = new AMQDataBlock[]{contentHeader, firstContentBody};
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(deliver, headerAndFirstContent);
- writeFrame(compositeBlock);
-
- //
- // Now start writing out the other content bodies
- //
- for(int i = 1; i < bodyCount; i++)
- {
- cb = messageHandle.getContentChunk(storeContext,messageId, i);
- writeFrame(new AMQFrame(channelId, getProtocolSession().getRegistry().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();
- final long messageId = message.getMessageId();
-
- ByteBuffer deliver = createEncodedGetOkFrame(message, channelId, deliveryTag, queueSize);
-
-
- AMQDataBlock contentHeader = ContentHeaderBody.createAMQFrame(channelId,
- message.getContentHeaderBody());
-
- final int bodyCount = messageHandle.getBodyCount(storeContext,messageId);
- 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,messageId, 0);
-
- AMQDataBlock firstContentBody = new AMQFrame(channelId, getProtocolSession().getRegistry().getProtocolVersionMethodConverter().convertToBody(cb));
- AMQDataBlock[] headerAndFirstContent = new AMQDataBlock[]{contentHeader, firstContentBody};
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(deliver, headerAndFirstContent);
- writeFrame(compositeBlock);
-
- //
- // Now start writing out the other content bodies
- //
- for(int i = 1; i < bodyCount; i++)
- {
- cb = messageHandle.getContentChunk(storeContext, messageId, i);
- writeFrame(new AMQFrame(channelId, getProtocolSession().getRegistry().getProtocolVersionMethodConverter().convertToBody(cb)));
- }
-
-
- }
-
-
- }
-
-
- private ByteBuffer createEncodedDeliverFrame(AMQMessage message, int channelId, long deliveryTag, AMQShortString consumerTag)
- throws AMQException
- {
- final MessagePublishInfo pb = message.getMessagePublishInfo();
- final AMQMessageHandle messageHandle = message.getMessageHandle();
-
- AMQFrame deliverFrame = BasicDeliverBody.createAMQFrame(channelId, getProtocolMajorVersion(),
- getProtocolMinorVersion(),
- consumerTag,
- deliveryTag, pb.getExchange(), messageHandle.isRedelivered(),
- pb.getRoutingKey());
-
-
- return deliverFrame.toByteBuffer();
- }
-
- private ByteBuffer createEncodedGetOkFrame(AMQMessage message, int channelId, long deliveryTag, int queueSize)
- throws AMQException
- {
- final MessagePublishInfo pb = message.getMessagePublishInfo();
- final AMQMessageHandle messageHandle = message.getMessageHandle();
-
- AMQFrame getOkFrame = BasicGetOkBody.createAMQFrame(channelId,
- getProtocolMajorVersion(),
- getProtocolMinorVersion(),
- deliveryTag, pb.getExchange(),
- queueSize,
- messageHandle.isRedelivered(),
- pb.getRoutingKey());
-
- return getOkFrame.toByteBuffer();
- }
-
- public byte getProtocolMinorVersion()
- {
- return getProtocolSession().getProtocolMinorVersion();
- }
-
- public byte getProtocolMajorVersion()
- {
- return getProtocolSession().getProtocolMajorVersion();
- }
-
- private ByteBuffer createEncodedReturnFrame(AMQMessage message, int channelId, int replyCode, AMQShortString replyText) throws AMQException
- {
- AMQFrame returnFrame = BasicReturnBody.createAMQFrame(channelId,
- getProtocolMajorVersion(),
- getProtocolMinorVersion(),
- message.getMessagePublishInfo().getExchange(),
- replyCode, replyText,
- message.getMessagePublishInfo().getRoutingKey());
-
- return returnFrame.toByteBuffer();
- }
-
- public void writeReturn(AMQMessage message, int channelId, int replyCode, AMQShortString replyText)
- throws AMQException
- {
- ByteBuffer 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[] headerAndFirstContent = new AMQDataBlock[]{contentHeader, firstContentBody};
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(returnFrame, headerAndFirstContent);
- writeFrame(compositeBlock);
- }
- else
- {
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(returnFrame,
- new AMQDataBlock[]{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)
- {
-
- writeFrame(BasicCancelOkBody.createAMQFrame(channelId,
- getProtocolMajorVersion(),
- getProtocolMinorVersion(),
- consumerTag // consumerTag
- ));
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java b/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
deleted file mode 100644
index 5bfd47b469..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQMinaProtocolSession.java
+++ /dev/null
@@ -1,773 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.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.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 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;
-
- private 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 VersionSpecificRegistry _registry = MainRegistry.getVersionSpecificRegistry(_protocolVersion);
- private List<Integer> _closingChannelsList = new ArrayList<Integer>();
- private ProtocolOutputConverter _protocolOutputConverter;
- private Principal _authorizedID;
-
- 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;
-
- }
-
- // this(session, queueRegistry, exchangeRegistry, codecFactory, new AMQStateManager());
- }
-
- 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);
- }
-
- if (body instanceof AMQMethodBody)
- {
- methodFrameReceived(channelId, (AMQMethodBody) body);
- }
- else if (body instanceof ContentHeaderBody)
- {
- contentHeaderReceived(channelId, (ContentHeaderBody) body);
- }
- else if (body instanceof ContentBody)
- {
- contentBodyReceived(channelId, (ContentBody) body);
- }
- else if (body instanceof HeartbeatBody)
- {
- // NO OP
- }
- else
- {
- _logger.warn("Unrecognised frame " + frame.getClass().getName());
- }
- }
-
- private void protocolInitiationReceived(ProtocolInitiation pi)
- {
- // this ensures the codec never checks for a PI message again
- ((AMQDecoder) _codecFactory.getDecoder()).setExpectProtocolInitiation(false);
- try
- {
- pi.checkVersion(); // Fails if not correct
-
- // This sets the protocol version (and hence framing classes) for this session.
- setProtocolVersion(pi._protocolMajor, pi._protocolMinor);
-
- String mechanisms = ApplicationRegistry.getInstance().getAuthenticationManager().getMechanisms();
-
- String locales = "en_US";
-
- // Interfacing with generated code - be aware of possible changes to parameter order as versions change.
- AMQFrame response =
- ConnectionStartBody.createAMQFrame((short) 0, getProtocolMajorVersion(), getProtocolMinorVersion(), // AMQP version (major, minor)
- locales.getBytes(), // locales
- mechanisms.getBytes(), // mechanisms
- null, // serverProperties
- (short) getProtocolMajorVersion(), // versionMajor
- (short) getProtocolMinorVersion()); // versionMinor
- _minaProtocolSession.write(response);
- }
- catch (AMQException e)
- {
- _logger.error("Received incorrect protocol initiation", e);
-
- _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
-
- }
- }
-
- private void methodFrameReceived(int channelId, AMQMethodBody methodBody)
- {
-
- final AMQMethodEvent<AMQMethodBody> evt = new AMQMethodEvent<AMQMethodBody>(channelId, methodBody);
-
- // Check that this channel is not closing
- if (channelAwaitingClosure(channelId))
- {
- if ((evt.getMethod() instanceof ChannelCloseOkBody))
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Channel[" + channelId + "] awaiting closure - processing close-ok");
- }
- }
- else
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Channel[" + channelId + "] awaiting closure ignoring");
- }
-
- return;
- }
- }
-
- 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());
- }
-
- closeSession();
-
- AMQConnectionException ce =
- evt.getMethod().getConnectionException(AMQConstant.CHANNEL_ERROR,
- AMQConstant.CHANNEL_ERROR.getName().toString());
-
- _stateManager.changeState(AMQState.CONNECTION_CLOSING);
- writeFrame(ce.getCloseFrame(channelId));
- }
- }
- catch (AMQConnectionException e)
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Closing connection due to: " + e.getMessage());
- }
-
- closeSession();
- _stateManager.changeState(AMQState.CONNECTION_CLOSING);
- writeFrame(e.getCloseFrame(channelId));
- }
- }
- catch (Exception e)
- {
- _stateManager.error(e);
- for (AMQMethodListener listener : _frameListeners)
- {
- listener.error(e);
- }
-
- _minaProtocolSession.close();
- }
- }
-
- private void contentHeaderReceived(int channelId, ContentHeaderBody body) throws AMQException
- {
-
- AMQChannel channel = getAndAssertChannel(channelId);
-
- channel.publishContentHeader(body, this);
-
- }
-
- private void contentBodyReceived(int channelId, ContentBody body) throws AMQException
- {
- AMQChannel channel = getAndAssertChannel(channelId);
-
- channel.publishContentBody(body, this);
- }
-
- /**
- * 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;
- _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.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(this);
- markChannelawaitingCloseOk(channelId);
- }
- finally
- {
- removeChannel(channelId);
- }
- }
- }
-
- public void closeChannelOk(int 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(this);
- }
-
- _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;
- closeAllChannels();
- if (_managedObject != null)
- {
- _managedObject.unregister();
- }
-
- for (Task task : _taskList)
- {
- task.doTask(this);
- }
- }
- }
-
- public String toString()
- {
- return "AMQProtocolSession(" + _minaProtocolSession.getRemoteAddress() + ")";
- }
-
- 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()));
- }
- }
- }
-
- private void setProtocolVersion(byte major, byte minor)
- {
- _protocolVersion = new ProtocolVersion(major, minor);
-
- _registry = MainRegistry.getVersionSpecificRegistry(_protocolVersion);
-
- _protocolOutputConverter = ProtocolOutputConverterRegistry.getConverter(this);
- }
-
- public byte getProtocolMajorVersion()
- {
- return _protocolVersion.getMajorVersion();
- }
-
- public byte getProtocolMinorVersion()
- {
- return _protocolVersion.getMinorVersion();
- }
-
- public boolean isProtocolVersion(byte major, byte minor)
- {
- return (getProtocolMajorVersion() == major) && (getProtocolMinorVersion() == minor);
- }
-
- public VersionSpecificRegistry getRegistry()
- {
- return _registry;
- }
-
- public Object getClientIdentifier()
- {
- return _minaProtocolSession.getRemoteAddress();
- }
-
- public VirtualHost getVirtualHost()
- {
- return _virtualHost;
- }
-
- public void setVirtualHost(VirtualHost virtualHost) throws AMQException
- {
- _virtualHost = virtualHost;
- _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 String getClientVersion()
- {
- return (_clientVersion == null) ? null : _clientVersion.toString();
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQNoMethodHandlerException.java b/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQNoMethodHandlerException.java
deleted file mode 100644
index a7599a3e0d..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java b/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.java
deleted file mode 100644
index 476e608b01..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPFastProtocolHandler.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.protocol;
-
-import org.apache.log4j.Logger;
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoHandlerAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.filter.SSLFilter;
-import org.apache.mina.filter.codec.ProtocolCodecFilter;
-import org.apache.mina.util.SessionUtil;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.AMQProtocolHeaderException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ConnectionCloseBody;
-import org.apache.qpid.framing.HeartbeatBody;
-import org.apache.qpid.framing.ProtocolInitiation;
-import org.apache.qpid.framing.ProtocolVersion;
-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;
-
-
- public AMQPFastProtocolHandler(Integer applicationRegistryInstance)
- {
- this(ApplicationRegistry.getInstance(applicationRegistryInstance));
- }
-
- public AMQPFastProtocolHandler(IApplicationRegistry applicationRegistry)
- {
- _applicationRegistry = applicationRegistry;
- _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 ProtocolCodecFilter pcf = new ProtocolCodecFilter(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()));
- }
-
- }
- }
-
- /**
- * 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)
- {
- amqProtocolSession.closeSession();
- }
- }
-
- 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, throwable);
- }
- else
- {
- _logger.error("Exception caught in" + session + ", closing session explictly: " + throwable, throwable);
-
- // Be aware of possible changes to parameter order as versions change.
- protocolSession.write(ConnectionCloseBody.createAMQFrame(0,
- session.getProtocolMajorVersion(),
- session.getProtocolMinorVersion(), // AMQP version (major, minor)
- 0, // classId
- 0, // methodId
- 200, // replyCode
- new AMQShortString(throwable.getMessage()) // replyText
- ));
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPProtocolProvider.java b/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQPProtocolProvider.java
deleted file mode 100644
index 07c153bfe8..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java b/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.java
deleted file mode 100644
index 390117acf6..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSession.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.server.protocol;
-
-import javax.security.sasl.SaslServer;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-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 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;
-
- /** @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();
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java b/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
deleted file mode 100644
index 66f928a70e..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBean.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT 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.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
- {
- // 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.
- final AMQFrame response =
- ConnectionCloseBody.createAMQFrame(0, _session.getProtocolMajorVersion(), _session.getProtocolMinorVersion(), // AMQP version (major, minor)
- 0, // classId
- 0, // methodId
- AMQConstant.REPLY_SUCCESS.getCode(), // replyCode
- BROKER_MANAGEMENT_CONSOLE_HAS_CLOSED_THE_CONNECTION // replyText
- );
- _session.writeFrame(response);
-
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.java b/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.java
deleted file mode 100644
index 29d55ce763..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/ExchangeInitialiser.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.protocol;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.exchange.ExchangeFactory;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-
-public class ExchangeInitialiser
-{
- public void initialise(ExchangeFactory factory, ExchangeRegistry registry) throws AMQException{
- define(registry, factory, ExchangeDefaults.DEFAULT_EXCHANGE_NAME, ExchangeDefaults.DIRECT_EXCHANGE_CLASS);
- define(registry, factory, ExchangeDefaults.DIRECT_EXCHANGE_NAME, ExchangeDefaults.DIRECT_EXCHANGE_CLASS);
- define(registry, factory, ExchangeDefaults.TOPIC_EXCHANGE_NAME, ExchangeDefaults.TOPIC_EXCHANGE_CLASS);
- define(registry, factory, ExchangeDefaults.HEADERS_EXCHANGE_NAME, ExchangeDefaults.HEADERS_EXCHANGE_CLASS);
- define(registry, factory, ExchangeDefaults.FANOUT_EXCHANGE_NAME, ExchangeDefaults.FANOUT_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/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/HeartbeatConfig.java b/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/HeartbeatConfig.java
deleted file mode 100644
index 310deaaf55..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java b/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/ManagedConnection.java
deleted file mode 100644
index e6e713ac6d..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/UnknnownMessageTypeException.java b/Final/java/broker/src/main/java/org/apache/qpid/server/protocol/UnknnownMessageTypeException.java
deleted file mode 100644
index 6e72aa062f..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
deleted file mode 100644
index dd9f32a306..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessage.java
+++ /dev/null
@@ -1,1000 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.BasicContentHeaderProperties;
-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.registry.ApplicationRegistry;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.txn.TransactionalContext;
-
-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.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-
-/**
- * A deliverable message.
- */
-public class AMQMessage
-{
- /** Used for debugging purposes. */
- private static final Logger _log = Logger.getLogger(AMQMessage.class);
-
- /** Used in clustering. @todo What for? */
- private Set<Object> _tokens;
-
- /** Only use in clustering. @todo What for? */
- private AMQProtocolSession _publisher;
-
- private final Long _messageId;
-
- private final AtomicInteger _referenceCount = new AtomicInteger(1);
-
- private AMQMessageHandle _messageHandle;
-
- /** Holds the transactional context in which this message is being processed. */
- private TransactionalContext _txnContext;
-
- /**
- * 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 boolean _deliveredToConsumer;
-
- /** Flag to indicate that this message requires 'immediate' delivery. */
- private boolean _immediate;
-
- // private Subscription _takenBySubcription;
- // private AtomicBoolean _taken = new AtomicBoolean(false);
- private TransientMessageData _transientMessageData = new TransientMessageData();
-
- //todo: this should be part of a messageOnQueue object
- private Set<Subscription> _rejectedBy = null;
-
- //todo: this should be part of a messageOnQueue object
- private Map<AMQQueue, AtomicBoolean> _takenMap = new HashMap<AMQQueue, AtomicBoolean>();
- //todo: this should be part of a messageOnQueue object
- private Map<AMQQueue, Subscription> _takenBySubcriptionMap = new HashMap<AMQQueue, Subscription>();
-
- private final int hashcode = System.identityHashCode(this);
-
- //todo: this should be part of a messageOnQueue object
- private long _expiration;
-
- public String debugIdentity()
- {
- return "(HC:" + hashcode + " ID:" + _messageId + " Ref:" + _referenceCount.get() + ")";
- }
-
- public void setExpiration()
- {
- long expiration =
- ((BasicContentHeaderProperties) _transientMessageData.getContentHeaderBody().properties).getExpiration();
- long timestamp =
- ((BasicContentHeaderProperties) _transientMessageData.getContentHeaderBody().properties).getTimestamp();
-
- if (ApplicationRegistry.getInstance().getConfiguration().getBoolean("advanced.synced-clocks", false))
- {
- _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 boolean isReferenced()
- {
- return _referenceCount.get() > 0;
- }
-
- /**
- * 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(), _messageId) - 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(),
- _messageId, ++_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.getRegistry().getProtocolVersionMethodConverter();
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- }
-
- public StoreContext getStoreContext()
- {
- return _txnContext.getStoreContext();
- }
-
- private class BodyContentIterator implements Iterator<ContentChunk>
- {
-
- private int _index = -1;
-
- public boolean hasNext()
- {
- try
- {
- return _index < (_messageHandle.getBodyCount(getStoreContext(), _messageId) - 1);
- }
- catch (AMQException e)
- {
- _log.error("Error getting body count: " + e, e);
-
- return false;
- }
- }
-
- public ContentChunk next()
- {
- try
- {
- return _messageHandle.getContentChunk(getStoreContext(), _messageId, ++_index);
- }
- catch (AMQException e)
- {
- throw new RuntimeException("Error getting content body: " + e, e);
- }
- }
-
- public void remove()
- {
- throw new UnsupportedOperationException();
- }
- }
-
- public AMQMessage(Long messageId, MessagePublishInfo info, TransactionalContext txnContext)
- {
- _messageId = messageId;
- _txnContext = txnContext;
- _immediate = info.isImmediate();
- _transientMessageData.setMessagePublishInfo(info);
-
- }
-
- /**
- * 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
- {
- _messageId = messageId;
- _messageHandle = factory.createMessageHandle(messageId, store, true);
- _txnContext = txnConext;
- _transientMessageData = null;
- }
-
- /**
- * Used in testing only. This allows the passing of the content header immediately on construction.
- *
- * @param messageId
- * @param info
- * @param txnContext
- * @param contentHeader
- */
- public AMQMessage(Long messageId, MessagePublishInfo info, TransactionalContext txnContext,
- ContentHeaderBody contentHeader) throws AMQException
- {
- this(messageId, info, txnContext);
- setContentHeaderBody(contentHeader);
- }
-
- /**
- * Used in testing only. This allows the passing of the content header and some body fragments on construction.
- *
- * @param messageId
- * @param info
- * @param txnContext
- * @param contentHeader
- * @param destinationQueues
- * @param contentBodies
- *
- * @throws AMQException
- */
- public AMQMessage(Long messageId, MessagePublishInfo info, TransactionalContext txnContext,
- ContentHeaderBody contentHeader, List<AMQQueue> destinationQueues, List<ContentChunk> contentBodies,
- MessageStore messageStore, StoreContext storeContext, MessageHandleFactory messageHandleFactory) throws AMQException
- {
- this(messageId, info, txnContext, contentHeader);
- _transientMessageData.setDestinationQueues(destinationQueues);
- routingComplete(messageStore, storeContext, messageHandleFactory);
- for (ContentChunk cb : contentBodies)
- {
- addContentBodyFrame(storeContext, cb);
- }
- }
-
- protected AMQMessage(AMQMessage msg) throws AMQException
- {
- _messageId = msg._messageId;
- _messageHandle = msg._messageHandle;
- _txnContext = msg._txnContext;
- _deliveredToConsumer = msg._deliveredToConsumer;
- _transientMessageData = msg._transientMessageData;
- }
-
- 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
- {
- if (_transientMessageData != null)
- {
- return _transientMessageData.getContentHeaderBody();
- }
- else
- {
- return _messageHandle.getContentHeaderBody(getStoreContext(), _messageId);
- }
- }
-
- public void setContentHeaderBody(ContentHeaderBody contentHeaderBody) throws AMQException
- {
- _transientMessageData.setContentHeaderBody(contentHeaderBody);
- }
-
- public void routingComplete(MessageStore store, StoreContext storeContext, 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
-
- for (AMQQueue q : _transientMessageData.getDestinationQueues())
- {
- _messageHandle.enqueue(storeContext, _messageId, q);
- }
-
- if (_transientMessageData.getContentHeaderBody().bodySize == 0)
- {
- deliver(storeContext);
- }
- }
-
- public boolean addContentBodyFrame(StoreContext storeContext, ContentChunk contentChunk) throws AMQException
- {
- _transientMessageData.addBodyLength(contentChunk.getSize());
- final boolean allContentReceived = isAllContentReceived();
- _messageHandle.addContentBodyFrame(storeContext, _messageId, contentChunk, allContentReceived);
- if (allContentReceived)
- {
- deliver(storeContext);
-
- return true;
- }
- else
- {
- return false;
- }
- }
-
- public boolean isAllContentReceived() throws AMQException
- {
- return _transientMessageData.isAllContentReceived();
- }
-
- public Long getMessageId()
- {
- return _messageId;
- }
-
- /**
- * 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;
- }
-
- /** Threadsafe. Increment the reference count on the message. */
- public void incrementReference()
- {
- _referenceCount.incrementAndGet();
- // if (_log.isDebugEnabled())
- // {
- // _log.debug("Ref count on message " + debugIdentity() + " incremented " + Arrays.asList(Thread.currentThread().getStackTrace()).subList(3, 6));
- // }
- }
-
- /**
- * 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)
- {
- try
- {
- // if (_log.isDebugEnabled())
- // {
- // _log.debug("Decremented ref count on message " + debugIdentity() + " is zero; removing message" + Arrays.asList(Thread.currentThread().getStackTrace()).subList(3, 6));
- // }
-
- // 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, _messageId);
- }
- }
- catch (AMQException e)
- {
- // to maintain consistency, we revert the count
- incrementReference();
- throw new MessageCleanupException(_messageId, e);
- }
- }
- else
- {
- if (count < 0)
- {
- throw new MessageCleanupException("Reference count for message id " + debugIdentity()
- + " has gone below 0.");
- }
- }
- }
-
- public void setPublisher(AMQProtocolSession publisher)
- {
- _publisher = publisher;
- }
-
- public AMQProtocolSession getPublisher()
- {
- return _publisher;
- }
-
- /**
- * Called selectors to determin if the message has already been sent
- *
- * @return _deliveredToConsumer
- */
- public boolean getDeliveredToConsumer()
- {
- return _deliveredToConsumer;
- }
-
- public boolean isTaken(AMQQueue queue)
- {
- // return _taken.get();
-
- synchronized (this)
- {
- AtomicBoolean taken = _takenMap.get(queue);
- if (taken == null)
- {
- taken = new AtomicBoolean(false);
- _takenMap.put(queue, taken);
- }
-
- return taken.get();
- }
- }
-
- public boolean taken(AMQQueue queue, Subscription sub)
- {
- // if (_taken.getAndSet(true))
- // {
- // return true;
- // }
- // else
- // {
- // _takenBySubcription = sub;
- // return false;
- // }
-
- synchronized (this)
- {
- AtomicBoolean taken = _takenMap.get(queue);
- if (taken == null)
- {
- taken = new AtomicBoolean(false);
- }
-
- if (taken.getAndSet(true))
- {
- return true;
- }
- else
- {
- _takenMap.put(queue, taken);
- _takenBySubcriptionMap.put(queue, sub);
-
- return false;
- }
- }
- }
-
- public void release(AMQQueue queue)
- {
- if (_log.isTraceEnabled())
- {
- _log.trace("Releasing Message:" + debugIdentity());
- }
-
- // _taken.set(false);
- // _takenBySubcription = null;
-
- synchronized (this)
- {
- AtomicBoolean taken = _takenMap.get(queue);
- if (taken == null)
- {
- taken = new AtomicBoolean(false);
- }
- else
- {
- taken.set(false);
- }
-
- _deliveredToConsumer = false;
- _takenMap.put(queue, taken);
- _takenBySubcriptionMap.put(queue, null);
- }
- }
-
- public boolean checkToken(Object token)
- {
-
- if (_tokens == null)
- {
- _tokens = new HashSet<Object>();
- }
-
- if (_tokens.contains(token))
- {
- return true;
- }
- else
- {
- _tokens.add(token);
-
- return false;
- }
- }
-
- /**
- * Registers a queue to which this message is to be delivered. This is called from the exchange when it is routing
- * the message. This will be called before any content bodies have been received so that the choice of
- * AMQMessageHandle implementation can be picked based on various criteria.
- *
- * @param queue the queue
- *
- * @throws org.apache.qpid.AMQException if there is an error enqueuing the message
- */
- public void enqueue(AMQQueue queue) throws AMQException
- {
- _transientMessageData.addDestinationQueue(queue);
- }
-
- /**
- * NOTE: Think about why you are using this method. Normal usages would want to do
- * AMQQueue.dequeue(StoreContext, AMQMessage)
- * This will keep the queue statistics up-to-date.
- * Currently this method is only called _correctly_ from AMQQueue dequeue.
- * Ideally we would have a better way for the queue to dequeue the message.
- * Especially since enqueue isn't the recipriocal of this method.
- * @deprecated
- * @param storeContext
- * @param queue
- * @throws AMQException
- */
- void dequeue(StoreContext storeContext, AMQQueue queue) throws AMQException
- {
- _messageHandle.dequeue(storeContext, _messageId, queue);
- }
-
- public boolean isPersistent() throws AMQException
- {
- if (_transientMessageData != null)
- {
- return _transientMessageData.isPersistent();
- }
- else
- {
- return _messageHandle.isPersistent(getStoreContext(), _messageId);
- }
- }
-
- /**
- * Called to enforce the 'immediate' flag.
- *
- * @throws NoConsumersException if the message is marked for immediate delivery but has not been marked as delivered
- * to a consumer
- */
- public void checkDeliveredToConsumer() throws NoConsumersException
- {
-
- if (_immediate && !_deliveredToConsumer)
- {
- throw new NoConsumersException(this);
- }
- }
-
- public MessagePublishInfo getMessagePublishInfo() throws AMQException
- {
- MessagePublishInfo pb;
- if (_transientMessageData != null)
- {
- pb = _transientMessageData.getMessagePublishInfo();
- }
- else
- {
- pb = _messageHandle.getMessagePublishInfo(getStoreContext(), _messageId);
- }
-
- return pb;
- }
-
- 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
- {
- // note: If the storecontext isn't need then we can remove the getChannel() from Subscription.
-
- 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()
- {
- _deliveredToConsumer = true;
- }
-
- private void deliver(StoreContext storeContext) throws AMQException
- {
- // we get a reference to the destination queues now so that we can clear the
- // transient message data as quickly as possible
- List<AMQQueue> destinationQueues = _transientMessageData.getDestinationQueues();
- if (_log.isDebugEnabled())
- {
- _log.debug("Delivering message " + debugIdentity() + " to " + destinationQueues);
- }
-
- 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(storeContext, _messageId,
- _transientMessageData.getMessagePublishInfo(), _transientMessageData.getContentHeaderBody());
-
- // 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());
-
- _transientMessageData = null;
-
- for (AMQQueue q : destinationQueues)
- {
- // Increment the references to this message for each queue delivery.
- incrementReference();
- // normal deliver so add this message at the end.
- _txnContext.deliver(this, q, false);
- }
- }
- finally
- {
- destinationQueues.clear();
- // Remove refence for routing process . Reference count should now == delivered queue count
- decrementReference(storeContext);
- }
- }
-
- /*
- public void writeDeliver(AMQProtocolSession protocolSession, int channelId, long deliveryTag, AMQShortString consumerTag)
- throws AMQException
- {
- ByteBuffer deliver = createEncodedDeliverFrame(protocolSession, channelId, deliveryTag, consumerTag);
- AMQDataBlock contentHeader = ContentHeaderBody.createAMQFrame(channelId,
- getContentHeaderBody());
-
- final int bodyCount = _messageHandle.getBodyCount(getStoreContext(), _messageId);
- if (bodyCount == 0)
- {
- SmallCompositeAMQDataBlock compositeBlock = new SmallCompositeAMQDataBlock(deliver,
- contentHeader);
-
- protocolSession.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(getStoreContext(), _messageId, 0);
-
- AMQDataBlock firstContentBody = new AMQFrame(channelId, protocolSession.getRegistry().getProtocolVersionMethodConverter().convertToBody(cb));
- AMQDataBlock[] headerAndFirstContent = new AMQDataBlock[]{contentHeader, firstContentBody};
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(deliver, headerAndFirstContent);
- protocolSession.writeFrame(compositeBlock);
-
- //
- // Now start writing out the other content bodies
- //
- for (int i = 1; i < bodyCount; i++)
- {
- cb = _messageHandle.getContentChunk(getStoreContext(), _messageId, i);
- protocolSession.writeFrame(new AMQFrame(channelId, protocolSession.getRegistry().getProtocolVersionMethodConverter().convertToBody(cb)));
- }
-
-
- }
-
-
- }
-
- public void writeGetOk(AMQProtocolSession protocolSession, int channelId, long deliveryTag, int queueSize) throws AMQException
- {
- ByteBuffer deliver = createEncodedGetOkFrame(protocolSession, channelId, deliveryTag, queueSize);
- AMQDataBlock contentHeader = ContentHeaderBody.createAMQFrame(channelId,
- getContentHeaderBody());
-
- final int bodyCount = _messageHandle.getBodyCount(getStoreContext(), _messageId);
- if (bodyCount == 0)
- {
- SmallCompositeAMQDataBlock compositeBlock = new SmallCompositeAMQDataBlock(deliver,
- contentHeader);
- protocolSession.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(getStoreContext(), _messageId, 0);
-
- AMQDataBlock firstContentBody = new AMQFrame(channelId, protocolSession.getRegistry().getProtocolVersionMethodConverter().convertToBody(cb));
- AMQDataBlock[] headerAndFirstContent = new AMQDataBlock[]{contentHeader, firstContentBody};
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(deliver, headerAndFirstContent);
- protocolSession.writeFrame(compositeBlock);
-
- //
- // Now start writing out the other content bodies
- //
- for (int i = 1; i < bodyCount; i++)
- {
- cb = _messageHandle.getContentChunk(getStoreContext(), _messageId, i);
- protocolSession.writeFrame(new AMQFrame(channelId, protocolSession.getRegistry().getProtocolVersionMethodConverter().convertToBody(cb)));
- }
-
-
- }
-
-
- }
-
-
- private ByteBuffer createEncodedDeliverFrame(AMQProtocolSession protocolSession, int channelId, long deliveryTag, AMQShortString consumerTag)
- throws AMQException
- {
- MessagePublishInfo pb = getMessagePublishInfo();
- AMQFrame deliverFrame = BasicDeliverBody.createAMQFrame(channelId, protocolSession.getProtocolMajorVersion(), (byte) 0, consumerTag,
- deliveryTag, pb.getExchange(), _messageHandle.isRedelivered(),
- pb.getRoutingKey());
- ByteBuffer buf = ByteBuffer.allocate((int) deliverFrame.getSize()); // XXX: Could cast be a problem?
- deliverFrame.writePayload(buf);
- buf.flip();
- return buf;
- }
-
- private ByteBuffer createEncodedGetOkFrame(AMQProtocolSession protocolSession, int channelId, long deliveryTag, int queueSize)
- throws AMQException
- {
- MessagePublishInfo pb = getMessagePublishInfo();
- AMQFrame getOkFrame = BasicGetOkBody.createAMQFrame(channelId,
- protocolSession.getProtocolMajorVersion(),
- protocolSession.getProtocolMinorVersion(),
- deliveryTag, pb.getExchange(),
- queueSize,
- _messageHandle.isRedelivered(),
- pb.getRoutingKey());
- ByteBuffer buf = ByteBuffer.allocate((int) getOkFrame.getSize()); // XXX: Could cast be a problem?
- getOkFrame.writePayload(buf);
- buf.flip();
- return buf;
- }
-
- private ByteBuffer createEncodedReturnFrame(AMQProtocolSession protocolSession, int channelId, int replyCode, AMQShortString replyText) throws AMQException
- {
- AMQFrame returnFrame = BasicReturnBody.createAMQFrame(channelId,
- protocolSession.getProtocolMajorVersion(),
- protocolSession.getProtocolMinorVersion(),
- getMessagePublishInfo().getExchange(),
- replyCode, replyText,
- getMessagePublishInfo().getRoutingKey());
- ByteBuffer buf = ByteBuffer.allocate((int) returnFrame.getSize()); // XXX: Could cast be a problem?
- returnFrame.writePayload(buf);
- buf.flip();
- return buf;
- }
-
- public void writeReturn(AMQProtocolSession protocolSession, int channelId, int replyCode, AMQShortString replyText)
- throws AMQException
- {
- ByteBuffer returnFrame = createEncodedReturnFrame(protocolSession, channelId, replyCode, replyText);
-
- AMQDataBlock contentHeader = ContentHeaderBody.createAMQFrame(channelId,
- getContentHeaderBody());
-
- Iterator<AMQDataBlock> bodyFrameIterator = getBodyFrameIterator(protocolSession, 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[] headerAndFirstContent = new AMQDataBlock[]{contentHeader, firstContentBody};
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(returnFrame, headerAndFirstContent);
- protocolSession.writeFrame(compositeBlock);
- }
- else
- {
- CompositeAMQDataBlock compositeBlock = new CompositeAMQDataBlock(returnFrame,
- new AMQDataBlock[]{contentHeader});
- protocolSession.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())
- {
- protocolSession.writeFrame(bodyFrameIterator.next());
- }
- }
- */
-
- public AMQMessageHandle getMessageHandle()
- {
- return _messageHandle;
- }
-
- public long getSize()
- {
- try
- {
- long size = getContentHeaderBody().bodySize;
-
- return size;
- }
- catch (AMQException e)
- {
- _log.error(e.toString(), e);
-
- return 0;
- }
-
- }
-
- public void restoreTransientMessageData() throws AMQException
- {
- TransientMessageData transientMessageData = new TransientMessageData();
- transientMessageData.setMessagePublishInfo(getMessagePublishInfo());
- transientMessageData.setContentHeaderBody(getContentHeaderBody());
- transientMessageData.addBodyLength(getContentHeaderBody().getSize());
- _transientMessageData = transientMessageData;
- }
-
- public void clearTransientMessageData()
- {
- _transientMessageData = null;
- }
-
- public String toString()
- {
- // return "Message[" + debugIdentity() + "]: " + _messageId + "; ref count: " + _referenceCount + "; taken : " +
- // _taken + " by :" + _takenBySubcription;
-
- return "Message[" + debugIdentity() + "]: " + _messageId + "; ref count: " + _referenceCount + "; taken for queues: "
- + _takenMap.toString() + " by Subs:" + _takenBySubcriptionMap.toString();
- }
-
- public Subscription getDeliveredSubscription(AMQQueue queue)
- {
- // return _takenBySubcription;
- synchronized (this)
- {
- return _takenBySubcriptionMap.get(queue);
- }
- }
-
- 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)
- {
- boolean rejected = _rejectedBy != null;
-
- if (rejected) // We have subscriptions that rejected this message
- {
- return _rejectedBy.contains(subscription);
- }
- else // This messasge hasn't been rejected yet.
- {
- return rejected;
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessageHandle.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQMessageHandle.java
deleted file mode 100644
index ede55b3bbf..0000000000
--- a/Final/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.
- *
- * The method all take a messageId to avoid having to store it in the instance - the AMQMessage container
- * must already keen the messageId so it is pointless storing it twice.
- */
-public interface AMQMessageHandle
-{
- ContentHeaderBody getContentHeaderBody(StoreContext context, Long messageId) throws AMQException;
-
- /**
- * @return the number of body frames associated with this message
- */
- int getBodyCount(StoreContext context, Long messageId) throws AMQException;
-
- /**
- * @return the size of the body
- */
- long getBodySize(StoreContext context, Long messageId) 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, Long messageId, int index) throws IllegalArgumentException, AMQException;
-
- void addContentBodyFrame(StoreContext storeContext, Long messageId, ContentChunk contentBody, boolean isLastContentBody) throws AMQException;
-
- MessagePublishInfo getMessagePublishInfo(StoreContext context, Long messageId) throws AMQException;
-
- boolean isRedelivered();
-
- void setRedelivered(boolean redelivered);
-
- boolean isPersistent(StoreContext context, Long messageId) throws AMQException;
-
- void setPublishAndContentHeaderBody(StoreContext storeContext, Long messageId, MessagePublishInfo messagePublishInfo,
- ContentHeaderBody contentHeaderBody)
- throws AMQException;
-
- void removeMessage(StoreContext storeContext, Long messageId) throws AMQException;
-
- void enqueue(StoreContext storeContext, Long messageId, AMQQueue queue) throws AMQException;
-
- void dequeue(StoreContext storeContext, Long messageId, AMQQueue queue) throws AMQException;
-
- long getArrivalTime();
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
deleted file mode 100644
index 0c52a358f7..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueue.java
+++ /dev/null
@@ -1,940 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.configuration.Configured;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.exchange.Exchange;
-import org.apache.qpid.server.management.Managable;
-import org.apache.qpid.server.management.ManagedObject;
-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.virtualhost.VirtualHost;
-
-import javax.management.JMException;
-import java.text.MessageFormat;
-import java.util.List;
-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;
-
-/**
- * This is an AMQ Queue, and should not be confused with a JMS queue or any other abstraction like that. It is described
- * fully in RFC 006.
- */
-public class AMQQueue implements Managable, Comparable
-{
- /**
- * 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.
- */
- public 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.
- */
- public static final class ExistingSubscriptionPreventsExclusive extends AMQException
- {
- public ExistingSubscriptionPreventsExclusive()
- {
- super("");
- }
- }
-
- private static final Logger _logger = Logger.getLogger(AMQQueue.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;
-
- /** Holds subscribers to the queue. */
- private final SubscriptionSet _subscribers;
-
- private final SubscriptionFactory _subscriptionFactory;
-
- private final AtomicInteger _subscriberCount = new AtomicInteger();
-
- private final AtomicBoolean _isExclusive = new AtomicBoolean();
-
- private final AtomicBoolean _deleted = new AtomicBoolean(false);
-
- private List<Task> _deleteTaskList = new CopyOnWriteArrayList<Task>();
-
- /** Manages message delivery. */
- private final DeliveryManager _deliveryMgr;
-
- /** Used to track bindings to exchanges so that on deletion they can easily be cancelled. */
- private final ExchangeBindings _bindings = new ExchangeBindings(this);
-
- /** Executor on which asynchronous delivery will be carriedout where required */
- private final Executor _asyncDelivery;
-
- private final AMQQueueMBean _managedObject;
-
- private final VirtualHost _virtualHost;
-
- /** 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;
-
- /** total messages received by the queue since startup. */
- public AtomicLong _totalMessagesReceived = new AtomicLong();
-
- public int compareTo(Object o)
- {
- return _name.compareTo(((AMQQueue) o).getName());
- }
-
- public AMQQueue(AMQShortString name, boolean durable, AMQShortString owner, boolean autoDelete, VirtualHost virtualHost)
- throws AMQException
- {
- this(name, durable, owner, autoDelete, virtualHost, AsyncDeliveryConfig.getAsyncDeliveryExecutor(),
- new SubscriptionSet(), new SubscriptionImpl.Factory());
- }
-
- protected AMQQueue(AMQShortString name, boolean durable, AMQShortString owner, boolean autoDelete,
- VirtualHost virtualHost, SubscriptionSet subscribers) throws AMQException
- {
- this(name, durable, owner, autoDelete, virtualHost, AsyncDeliveryConfig.getAsyncDeliveryExecutor(), subscribers,
- new SubscriptionImpl.Factory());
- }
-
- protected AMQQueue(AMQShortString name, boolean durable, AMQShortString owner, boolean autoDelete,
- VirtualHost virtualHost, Executor asyncDelivery, SubscriptionSet subscribers,
- SubscriptionFactory subscriptionFactory) 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;
- _asyncDelivery = asyncDelivery;
-
- _managedObject = createMBean();
- _managedObject.register();
-
- _subscribers = subscribers;
- _subscriptionFactory = subscriptionFactory;
- _deliveryMgr = new ConcurrentSelectorDeliveryManager(_subscribers, this);
- }
-
- private AMQQueueMBean createMBean() throws AMQException
- {
- try
- {
- return new AMQQueueMBean(this);
- }
- catch (JMException ex)
- {
- throw new AMQException("AMQQueue MBean creation has failed ", ex);
- }
- }
-
- public AMQShortString getName()
- {
- return _name;
- }
-
- public boolean isShared()
- {
- return _owner == null;
- }
-
- public boolean isDurable()
- {
- return _durable;
- }
-
- public AMQShortString getOwner()
- {
- return _owner;
- }
-
- public boolean isAutoDelete()
- {
- return _autoDelete;
- }
-
- public boolean isDeleted()
- {
- return _deleted.get();
- }
-
- /** @return no of messages(undelivered) on the queue. */
- public int getMessageCount()
- {
- return _deliveryMgr.getQueueMessageCount();
- }
-
- /** @return List of messages(undelivered) on the queue. */
- public List<AMQMessage> getMessagesOnTheQueue()
- {
- return _deliveryMgr.getMessages();
- }
-
- /**
- * Returns messages within the given range of message Ids.
- *
- * @param fromMessageId
- * @param toMessageId
- *
- * @return List of messages
- */
- public List<AMQMessage> getMessagesOnTheQueue(long fromMessageId, long toMessageId)
- {
- return _deliveryMgr.getMessages(fromMessageId, toMessageId);
- }
-
- public long getQueueDepth()
- {
- return _deliveryMgr.getTotalMessageSize();
- }
-
- /**
- * @param messageId
- *
- * @return AMQMessage with give id if exists. null if AMQMessage with given id doesn't exist.
- */
- public AMQMessage getMessageOnTheQueue(long messageId)
- {
- List<AMQMessage> list = getMessagesOnTheQueue(messageId, messageId);
- if ((list == null) || (list.size() == 0))
- {
- return null;
- }
-
- return list.get(0);
- }
-
- /**
- * Moves messages from this queue to another queue, and also commits the move on the message store. Delivery activity
- * on the queues being moved between is suspended during the move.
- *
- * @param fromMessageId The first message id to move.
- * @param toMessageId The last message id to move.
- * @param queueName The queue to move the messages to.
- * @param storeContext The context of the message store under which to perform the move. This is associated with
- * the stores transactional context.
- */
- public synchronized void moveMessagesToAnotherQueue(long fromMessageId, long toMessageId, String queueName,
- StoreContext storeContext)
- {
- AMQQueue toQueue = getVirtualHost().getQueueRegistry().getQueue(new AMQShortString(queueName));
-
- MessageStore fromStore = getVirtualHost().getMessageStore();
- MessageStore toStore = toQueue.getVirtualHost().getMessageStore();
-
- if (toStore != fromStore)
- {
- throw new RuntimeException("Can only move messages between queues on the same message store.");
- }
-
- try
- {
- // Obtain locks to prevent activity on the queues being moved between.
- startMovingMessages();
- toQueue.startMovingMessages();
-
- // Get the list of messages to move.
- List<AMQMessage> foundMessagesList = getMessagesOnTheQueue(fromMessageId, toMessageId);
-
- try
- {
- fromStore.beginTran(storeContext);
-
- // Move the messages in on the message store.
- for (AMQMessage message : foundMessagesList)
- {
- fromStore.dequeueMessage(storeContext, _name, message.getMessageId());
- toStore.enqueueMessage(storeContext, toQueue._name, message.getMessageId());
- }
-
- // Commit and flush the move transcations.
- try
- {
- fromStore.commitTran(storeContext);
- }
- catch (AMQException e)
- {
- throw new RuntimeException("Failed to commit transaction whilst moving messages on message store.", e);
- }
-
- // Move the messages on the in-memory queues.
- toQueue.enqueueMovedMessages(storeContext, foundMessagesList);
- _deliveryMgr.removeMovedMessages(foundMessagesList);
- }
- // Abort the move transactions on move failures.
- catch (AMQException e)
- {
- try
- {
- fromStore.abortTran(storeContext);
- }
- catch (AMQException ae)
- {
- throw new RuntimeException("Failed to abort transaction whilst moving messages on message store.", ae);
- }
- }
- }
- // Release locks to allow activity on the queues being moved between to continue.
- finally
- {
- toQueue.stopMovingMessages();
- stopMovingMessages();
- }
- }
-
- /**
- * Copies messages on this queue to another queue, and also commits the move on the message store. Delivery activity
- * on the queues being moved between is suspended during the move.
- *
- * @param fromMessageId The first message id to move.
- * @param toMessageId The last message id to move.
- * @param queueName The queue to move the messages to.
- * @param storeContext The context of the message store under which to perform the move. This is associated with
- * the stores transactional context.
- */
- public synchronized void copyMessagesToAnotherQueue(long fromMessageId, long toMessageId, String queueName,
- StoreContext storeContext)
- {
- AMQQueue toQueue = getVirtualHost().getQueueRegistry().getQueue(new AMQShortString(queueName));
-
- MessageStore fromStore = getVirtualHost().getMessageStore();
- MessageStore toStore = toQueue.getVirtualHost().getMessageStore();
-
- if (toStore != fromStore)
- {
- throw new RuntimeException("Can only move messages between queues on the same message store.");
- }
-
- try
- {
- // Obtain locks to prevent activity on the queues being moved between.
- startMovingMessages();
- toQueue.startMovingMessages();
-
- // Get the list of messages to move.
- List<AMQMessage> foundMessagesList = getMessagesOnTheQueue(fromMessageId, toMessageId);
-
- try
- {
- fromStore.beginTran(storeContext);
-
- // Move the messages in on the message store.
- for (AMQMessage message : foundMessagesList)
- {
- toStore.enqueueMessage(storeContext, toQueue._name, message.getMessageId());
- message.takeReference();
- }
-
- // Commit and flush the move transcations.
- try
- {
- fromStore.commitTran(storeContext);
- }
- catch (AMQException e)
- {
- throw new RuntimeException("Failed to commit transaction whilst moving messages on message store.", e);
- }
-
- // Move the messages on the in-memory queues.
- toQueue.enqueueMovedMessages(storeContext, foundMessagesList);
- }
- // Abort the move transactions on move failures.
- catch (AMQException e)
- {
- try
- {
- fromStore.abortTran(storeContext);
- }
- catch (AMQException ae)
- {
- throw new RuntimeException("Failed to abort transaction whilst moving messages on message store.", ae);
- }
- }
- }
- // Release locks to allow activity on the queues being moved between to continue.
- finally
- {
- toQueue.stopMovingMessages();
- stopMovingMessages();
- }
- }
-
- /**
- * Removes messages from this queue, and also commits the remove on the message store. Delivery activity
- * on the queues being moved between is suspended during the remove.
- *
- * @param fromMessageId The first message id to move.
- * @param toMessageId The last message id to move.
- * @param storeContext The context of the message store under which to perform the move. This is associated with
- * the stores transactional context.
- */
- public synchronized void removeMessagesFromQueue(long fromMessageId, long toMessageId, StoreContext storeContext)
- {
- MessageStore fromStore = getVirtualHost().getMessageStore();
-
- try
- {
- // Obtain locks to prevent activity on the queues being moved between.
- startMovingMessages();
-
- // Get the list of messages to move.
- List<AMQMessage> foundMessagesList = getMessagesOnTheQueue(fromMessageId, toMessageId);
-
- try
- {
- fromStore.beginTran(storeContext);
-
- // remove the messages in on the message store.
- for (AMQMessage message : foundMessagesList)
- {
- fromStore.dequeueMessage(storeContext, _name, message.getMessageId());
- }
-
- // Commit and flush the move transcations.
- try
- {
- fromStore.commitTran(storeContext);
- }
- catch (AMQException e)
- {
- throw new RuntimeException("Failed to commit transaction whilst moving messages on message store.", e);
- }
-
- // remove the messages on the in-memory queues.
- _deliveryMgr.removeMovedMessages(foundMessagesList);
- }
- // Abort the move transactions on move failures.
- catch (AMQException e)
- {
- try
- {
- fromStore.abortTran(storeContext);
- }
- catch (AMQException ae)
- {
- throw new RuntimeException("Failed to abort transaction whilst moving messages on message store.", ae);
- }
- }
- }
- // Release locks to allow activity on the queues being moved between to continue.
- finally
- {
- stopMovingMessages();
- }
- }
-
- public void startMovingMessages()
- {
- _deliveryMgr.startMovingMessages();
- }
-
- private void enqueueMovedMessages(StoreContext storeContext, List<AMQMessage> messageList)
- {
- _deliveryMgr.enqueueMovedMessages(storeContext, messageList);
- _totalMessagesReceived.addAndGet(messageList.size());
- }
-
- public void stopMovingMessages()
- {
- _deliveryMgr.stopMovingMessages();
- _deliveryMgr.processAsync(_asyncDelivery);
- }
-
- /** @return MBean object associated with this Queue */
- public ManagedObject getManagedObject()
- {
- return _managedObject;
- }
-
- public long getMaximumMessageSize()
- {
- return _maximumMessageSize;
- }
-
- public void setMaximumMessageSize(long value)
- {
- _maximumMessageSize = value;
- }
-
- public int getConsumerCount()
- {
- return _subscribers.size();
- }
-
- public int getActiveConsumerCount()
- {
- return _subscribers.getWeight();
- }
-
- public long getReceivedMessageCount()
- {
- return _totalMessagesReceived.get();
- }
-
- public long getMaximumMessageCount()
- {
- return _maximumMessageCount;
- }
-
- public void setMaximumMessageCount(long value)
- {
- _maximumMessageCount = value;
- }
-
- public long getMaximumQueueDepth()
- {
- return _maximumQueueDepth;
- }
-
- // Sets the queue depth, the max queue size
- public void setMaximumQueueDepth(long value)
- {
- _maximumQueueDepth = value;
- }
-
- public long getOldestMessageArrivalTime()
- {
- return _deliveryMgr.getOldestMessageArrival();
-
- }
-
- /** Removes the AMQMessage from the top of the queue. */
- public synchronized void deleteMessageFromTop(StoreContext storeContext) throws AMQException
- {
- _deliveryMgr.removeAMessageFromTop(storeContext, this);
- }
-
- /** removes all the messages from the queue. */
- public synchronized long clearQueue(StoreContext storeContext) throws AMQException
- {
- return _deliveryMgr.clearAllMessages(storeContext);
- }
-
- public void bind(AMQShortString routingKey, FieldTable arguments, Exchange exchange) 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(AMQShortString routingKey, FieldTable arguments, Exchange exchange) throws AMQException
- {
- exchange.deregisterQueue(routingKey, this, arguments);
- if (isDurable() && exchange.isDurable())
- {
- _virtualHost.getMessageStore().unbindQueue(exchange, routingKey, this, arguments);
- }
-
- _bindings.remove(routingKey, arguments, exchange);
- }
-
- public void registerProtocolSession(AMQProtocolSession ps, int channel, AMQShortString consumerTag, boolean acks,
- FieldTable filters, boolean noLocal, boolean exclusive) throws AMQException
- {
- if (incrementSubscriberCount() > 1)
- {
- if (isExclusive())
- {
- decrementSubscriberCount();
- throw new ExistingExclusiveSubscription();
- }
- else if (exclusive)
- {
- decrementSubscriberCount();
- throw new ExistingSubscriptionPreventsExclusive();
- }
-
- }
- else if (exclusive)
- {
- setExclusive(true);
- }
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug(MessageFormat.format("Registering protocol session {0} with channel {1} and "
- + "consumer tag {2} with {3}", ps, channel, consumerTag, this));
- }
-
- Subscription subscription =
- _subscriptionFactory.createSubscription(channel, ps, consumerTag, acks, filters, noLocal, this);
-
- if (subscription.filtersMessages())
- {
- if (_deliveryMgr.hasQueuedMessages())
- {
- _deliveryMgr.populatePreDeliveryQueue(subscription);
- }
- }
-
- _subscribers.addSubscriber(subscription);
- }
-
- private boolean isExclusive()
- {
- return _isExclusive.get();
- }
-
- private void setExclusive(boolean exclusive)
- {
- _isExclusive.set(exclusive);
- }
-
- private int incrementSubscriberCount()
- {
- return _subscriberCount.incrementAndGet();
- }
-
- private int decrementSubscriberCount()
- {
- return _subscriberCount.decrementAndGet();
- }
-
- public void unregisterProtocolSession(AMQProtocolSession ps, int channel, AMQShortString consumerTag) throws AMQException
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug(MessageFormat.format(
- "Unregistering protocol session {0} with channel {1} and consumer tag {2} from {3}",
- ps, channel, consumerTag, this));
- }
-
- Subscription removedSubscription;
- if ((removedSubscription = _subscribers.removeSubscriber(_subscriptionFactory.createSubscription(channel, ps,
- consumerTag)))
- == null)
- {
- throw new AMQException("Protocol session with channel " + channel + " and consumer tag " + consumerTag
- + " and protocol session key " + ps.getKey() + " not registered with queue " + this);
- }
-
- removedSubscription.close();
- setExclusive(false);
- decrementSubscriberCount();
-
- // if we are eligible for auto deletion, unregister from the queue registry
- if (_autoDelete && _subscribers.isEmpty())
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Auto-deleteing queue:" + this);
- }
-
- autodelete();
- // 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
- removedSubscription.queueDeleted(this);
- }
- }
-
- public boolean isUnused()
- {
- return _subscribers.isEmpty();
- }
-
- public boolean isEmpty()
- {
- return !_deliveryMgr.hasQueuedMessages();
- }
-
- public int delete(boolean checkUnused, boolean checkEmpty) throws AMQException
- {
- if (checkUnused && !_subscribers.isEmpty())
- {
- _logger.info("Will not delete " + this + " as it is in use.");
-
- return 0;
- }
- else if (checkEmpty && _deliveryMgr.hasQueuedMessages())
- {
- _logger.info("Will not delete " + this + " as it is not empty.");
-
- return 0;
- }
- else
- {
- delete();
-
- return _deliveryMgr.getQueueMessageCount();
- }
- }
-
- public void delete() throws AMQException
- {
- if (!_deleted.getAndSet(true))
- {
- _subscribers.queueDeleted(this);
- _bindings.deregister();
- _virtualHost.getQueueRegistry().unregisterQueue(_name);
- _managedObject.unregister();
- for (Task task : _deleteTaskList)
- {
- task.doTask(this);
- }
-
- _deleteTaskList.clear();
- }
- }
-
- protected void autodelete() throws AMQException
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug(MessageFormat.format("autodeleting {0}", this));
- }
-
- delete();
- }
-
- /*public void processGet(StoreContext storeContext, AMQMessage msg, boolean deliverFirst) throws AMQException
- {
- // fixme not sure what this is doing. should we be passing deliverFirst through here?
- // This code is not used so when it is perhaps it should
- _deliveryMgr.deliver(storeContext, getName(), msg, deliverFirst);
- try
- {
- msg.checkDeliveredToConsumer();
- updateReceivedMessageCount(msg);
- }
- catch (NoConsumersException e)
- {
- // as this message will be returned, it should be removed
- // from the queue:
- dequeue(storeContext, msg);
- }
- }*/
-
- // public DeliveryManager getDeliveryManager()
- // {
- // return _deliveryMgr;
- // }
-
- public void process(StoreContext storeContext, AMQMessage msg, boolean deliverFirst) throws AMQException
- {
- _deliveryMgr.deliver(storeContext, getName(), msg, deliverFirst);
- try
- {
- msg.checkDeliveredToConsumer();
- updateReceivedMessageCount(msg);
- }
- catch (NoConsumersException e)
- {
- // as this message will be returned, it should be removed
- // from the queue:
- dequeue(storeContext, msg);
- }
- }
-
- public void dequeue(StoreContext storeContext, AMQMessage msg) throws FailedDequeueException
- {
- try
- {
- msg.dequeue(storeContext, this);
- }
- 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);
- }
- }
-
- public void deliverAsync()
- {
- _deliveryMgr.processAsync(_asyncDelivery);
- }
-
- protected SubscriptionManager getSubscribers()
- {
- return _subscribers;
- }
-
- protected void updateReceivedMessageCount(AMQMessage msg) throws AMQException
- {
- if (!msg.isRedelivered())
- {
- _totalMessagesReceived.incrementAndGet();
- }
-
- try
- {
- _managedObject.checkForNotification(msg);
- }
- catch (JMException e)
- {
- throw new AMQException("Unable to get notification from manage queue: " + e, e);
- }
- }
-
- public boolean equals(Object o)
- {
- if (this == o)
- {
- return true;
- }
-
- if ((o == null) || (getClass() != o.getClass()))
- {
- return false;
- }
-
- final AMQQueue amqQueue = (AMQQueue) o;
-
- return (_name.equals(amqQueue._name));
- }
-
- public int hashCode()
- {
- return _name.hashCode();
- }
-
- public String toString()
- {
- return "Queue(" + _name + ")@" + System.identityHashCode(this);
- }
-
- public boolean performGet(AMQProtocolSession session, AMQChannel channel, boolean acks) throws AMQException
- {
- return _deliveryMgr.performGet(session, channel, acks);
- }
-
- public QueueRegistry getQueueRegistry()
- {
- return _virtualHost.getQueueRegistry();
- }
-
- public VirtualHost getVirtualHost()
- {
- return _virtualHost;
- }
-
- public static interface Task
- {
- public void doTask(AMQQueue queue) throws AMQException;
- }
-
- public void addQueueDeleteTask(Task task)
- {
- _deleteTaskList.add(task);
- }
-
- public long getMinimumAlertRepeatGap()
- {
- return _minimumAlertRepeatGap;
- }
-
- public void setMinimumAlertRepeatGap(long minimumAlertRepeatGap)
- {
- _minimumAlertRepeatGap = minimumAlertRepeatGap;
- }
-
- public long getMaximumMessageAge()
- {
- return _maximumMessageAge;
- }
-
- public void setMaximumMessageAge(long maximumMessageAge)
- {
- _maximumMessageAge = maximumMessageAge;
- }
-
- public void subscriberHasPendingResend(boolean hasContent, SubscriptionImpl subscription, AMQMessage msg)
- {
- _deliveryMgr.subscriberHasPendingResend(hasContent, subscription, msg);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
deleted file mode 100644
index 07872d7644..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AMQQueueMBean.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * 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 long currentTime = System.currentTimeMillis();
- final long thresholdTime = currentTime - _queue.getMinimumAlertRepeatGap();
-
- for (NotificationCheck check : NotificationCheck.values())
- {
- 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 org.apache.qpid.server.queue.AMQQueue#deleteMessageFromTop
- */
- public void deleteMessageFromTop() throws JMException
- {
- try
- {
- _queue.deleteMessageFromTop(_storeContext);
- }
- catch (AMQException ex)
- {
- throw new MBeanException(ex, ex.toString());
- }
- }
-
- /**
- * @see org.apache.qpid.server.queue.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
- {
- AMQMessage msg = _queue.getMessageOnTheQueue(msgId);
- if (msg == null)
- {
- throw new OperationsException("AMQMessage with message id = " + msgId + " is not in the " + _queueName);
- }
- // 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<AMQMessage> 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);
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AsyncDeliveryConfig.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/AsyncDeliveryConfig.java
deleted file mode 100644
index 290fedcf7b..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/ConcurrentSelectorDeliveryManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/ConcurrentSelectorDeliveryManager.java
deleted file mode 100644
index eabc8ebf38..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/ConcurrentSelectorDeliveryManager.java
+++ /dev/null
@@ -1,1049 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.configuration.Configured;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.configuration.Configurator;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.util.ConcurrentLinkedMessageQueueAtomicSize;
-import org.apache.qpid.util.MessageQueue;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Queue;
-import java.util.Set;
-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.locks.ReentrantLock;
-
-
-/** Manages delivery of messages on behalf of a queue */
-public class ConcurrentSelectorDeliveryManager implements DeliveryManager
-{
- private static final Logger _log = Logger.getLogger(ConcurrentSelectorDeliveryManager.class);
-
- @Configured(path = "advanced.compressBufferOnQueue",
- defaultValue = "false")
- public boolean compressBufferOnQueue;
- /** Holds any queued messages */
- private final MessageQueue<AMQMessage> _messages = new ConcurrentLinkedMessageQueueAtomicSize<AMQMessage>();
-
- /** Ensures that only one asynchronous task is running for this manager at any time. */
- private final AtomicBoolean _processing = new AtomicBoolean();
- /** The subscriptions on the queue to whom messages are delivered */
- private final SubscriptionManager _subscriptions;
-
- /**
- * A reference to the queue we are delivering messages for. We need this to be able to pass the code that handles
- * acknowledgements a handle on the queue.
- */
- private final AMQQueue _queue;
-
- /**
- * Flag used while moving messages from this queue to another. For moving messages the async delivery should also
- * stop. This flat should be set to true to stop async delivery and set to false to enable async delivery again.
- */
- private AtomicBoolean _movingMessages = new AtomicBoolean();
-
- /**
- * Lock used to ensure that an channel that becomes unsuspended during the start of the queueing process is forced
- * to wait till the first message is added to the queue. This will ensure that the _queue has messages to be
- * delivered via the async thread. <p/> Lock is used to control access to hasQueuedMessages() and over the addition
- * of messages to the queue.
- */
- private ReentrantLock _lock = new ReentrantLock();
- private AtomicLong _totalMessageSize = new AtomicLong();
- private AtomicInteger _extraMessages = new AtomicInteger();
- private Set<Subscription> _hasContent = Collections.synchronizedSet(new HashSet<Subscription>());
- private final Object _queueHeadLock = new Object();
- private String _processingThreadName = "";
-
-
- /** Used by any reaping thread to purge messages */
- private StoreContext _reapingStoreContext = new StoreContext();
-
- ConcurrentSelectorDeliveryManager(SubscriptionManager subscriptions, AMQQueue queue)
- {
-
- //Set values from configuration
- Configurator.configure(this);
-
- if (compressBufferOnQueue)
- {
- _log.warn("Compressing Buffers on queue.");
- }
-
- _subscriptions = subscriptions;
- _queue = queue;
- }
-
-
- private boolean addMessageToQueue(AMQMessage msg, boolean deliverFirst)
- {
- // Shrink the ContentBodies to their actual size to save memory.
- if (compressBufferOnQueue)
- {
- Iterator<ContentChunk> it = msg.getContentBodyIterator();
- while (it.hasNext())
- {
- ContentChunk cb = it.next();
- cb.reduceToFit();
- }
- }
-
- if (deliverFirst)
- {
- synchronized (_queueHeadLock)
- {
- _messages.pushHead(msg);
- }
- }
- else
- {
- _messages.offer(msg);
- }
-
- _totalMessageSize.addAndGet(msg.getSize());
-
- return true;
- }
-
-
- public boolean hasQueuedMessages()
- {
- _lock.lock();
- try
- {
- return !(_messages.isEmpty() && _hasContent.isEmpty());
- }
- finally
- {
- _lock.unlock();
- }
- }
-
- public int getQueueMessageCount()
- {
- return getMessageCount();
- }
-
- /**
- * This is an EXPENSIVE opperation to perform with a ConcurrentLinkedQueue as it must run the queue to determine
- * size. The ConcurrentLinkedQueueAtomicSize uses an AtomicInteger to record the number of elements on the queue.
- *
- * @return int the number of messages in the delivery queue.
- */
- private int getMessageCount()
- {
- return _messages.size() + _extraMessages.get();
- }
-
-
- public long getTotalMessageSize()
- {
- return _totalMessageSize.get();
- }
-
- public long getOldestMessageArrival()
- {
- AMQMessage msg = _messages.peek();
- return msg == null ? Long.MAX_VALUE : msg.getArrivalTime();
- }
-
- public void subscriberHasPendingResend(boolean hasContent, Subscription subscription, AMQMessage msg)
- {
- _lock.lock();
- try
- {
- if (hasContent)
- {
- _log.debug("Queue has adding subscriber content");
- _hasContent.add(subscription);
- _totalMessageSize.addAndGet(msg.getSize());
- _extraMessages.addAndGet(1);
- }
- else
- {
- _log.debug("Queue has removing subscriber content");
- if (msg == null)
- {
- _hasContent.remove(subscription);
- }
- else
- {
- _totalMessageSize.addAndGet(-msg.getSize());
- _extraMessages.addAndGet(-1);
- }
- }
- }
- finally
- {
- _lock.unlock();
- }
- }
-
- /** @return the state of the async processor. */
- public boolean isProcessingAsync()
- {
- return _processing.get();
- }
-
- /**
- * Returns all the messages in the Queue
- *
- * @return List of messages
- */
- public List<AMQMessage> getMessages()
- {
- _lock.lock();
- List<AMQMessage> list = new ArrayList<AMQMessage>();
-
- for (AMQMessage message : _messages)
- {
- list.add(message);
- }
- _lock.unlock();
-
- return list;
- }
-
- /**
- * Returns messages within the range of given messageIds
- *
- * @param fromMessageId
- * @param toMessageId
- *
- * @return
- */
- public List<AMQMessage> getMessages(long fromMessageId, long toMessageId)
- {
- if (fromMessageId <= 0 || toMessageId <= 0)
- {
- return null;
- }
-
- long maxMessageCount = toMessageId - fromMessageId + 1;
-
- _lock.lock();
-
- List<AMQMessage> foundMessagesList = new ArrayList<AMQMessage>();
-
- for (AMQMessage message : _messages)
- {
- long msgId = message.getMessageId();
- if (msgId >= fromMessageId && msgId <= toMessageId)
- {
- foundMessagesList.add(message);
- }
- // break if the no of messages are found
- if (foundMessagesList.size() == maxMessageCount)
- {
- break;
- }
- }
- _lock.unlock();
-
- return foundMessagesList;
- }
-
- public void populatePreDeliveryQueue(Subscription subscription)
- {
- if (_log.isTraceEnabled())
- {
- _log.trace("Populating PreDeliveryQueue for Subscription(" + System.identityHashCode(subscription) + ")");
- }
-
- Iterator<AMQMessage> currentQueue = _messages.iterator();
-
- while (currentQueue.hasNext())
- {
- AMQMessage message = currentQueue.next();
- if (!message.getDeliveredToConsumer())
- {
- if (subscription.hasInterest(message))
- {
- subscription.enqueueForPreDelivery(message, false);
- }
- }
- }
- }
-
- public boolean performGet(AMQProtocolSession protocolSession, AMQChannel channel, boolean acks) throws AMQException
- {
- AMQMessage msg = getNextMessage();
- if (msg == null)
- {
- return false;
- }
- else
- {
-
- 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.
- if (!acks)
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("No ack mode so dequeuing message immediately: " + msg.getMessageId());
- }
- _queue.dequeue(channel.getStoreContext(), msg);
- }
- synchronized (channel)
- {
- long deliveryTag = channel.getNextDeliveryTag();
-
- if (acks)
- {
- channel.addUnacknowledgedMessage(msg, deliveryTag, null, _queue);
- }
-
- protocolSession.getProtocolOutputConverter().writeGetOk(msg, channel.getChannelId(),
- deliveryTag, _queue.getMessageCount());
- _totalMessageSize.addAndGet(-msg.getSize());
- }
-
- if (!acks)
- {
- msg.decrementReference(channel.getStoreContext());
- }
- }
- finally
- {
- msg.setDeliveredToConsumer();
- }
- return true;
-
- }
- }
-
- /**
- * For feature of moving messages, this method is used. It sets the lock and sets the movingMessages flag, so that
- * the asyn delivery is also stopped.
- */
- public void startMovingMessages()
- {
- _movingMessages.set(true);
- }
-
- /**
- * Once moving messages to another queue is done or aborted, remove lock and unset the movingMessages flag, so that
- * the async delivery can start again.
- */
- public void stopMovingMessages()
- {
- _movingMessages.set(false);
- if (_lock.isHeldByCurrentThread())
- {
- _lock.unlock();
- }
- }
-
- /**
- * Messages will be removed from this queue and all preDeliveryQueues
- *
- * @param messageList
- */
- public void removeMovedMessages(List<AMQMessage> messageList)
- {
- // Remove from the
- boolean hasSubscribers = _subscriptions.hasActiveSubscribers();
- if (hasSubscribers)
- {
- for (Subscription sub : _subscriptions.getSubscriptions())
- {
- if (!sub.isSuspended() && sub.filtersMessages())
- {
- Queue<AMQMessage> preDeliveryQueue = sub.getPreDeliveryQueue();
- for (AMQMessage msg : messageList)
- {
- preDeliveryQueue.remove(msg);
- }
- }
- }
- }
-
- for (AMQMessage msg : messageList)
- {
- if (_messages.remove(msg))
- {
- _totalMessageSize.getAndAdd(-msg.getSize());
- }
- }
- }
-
- /**
- * Now with implementation of predelivery queues, this method will mark the message on the top as taken.
- *
- * @param storeContext
- *
- * @throws AMQException
- */
- public void removeAMessageFromTop(StoreContext storeContext, AMQQueue queue) throws AMQException
- {
- _lock.lock();
-
- AMQMessage message = _messages.poll();
-
- if (message != null)
- {
- queue.dequeue(storeContext, message);
-
- _totalMessageSize.addAndGet(-message.getSize());
-
- //If this causes ref count to hit zero then data will be purged so message.getSize() will NPE.
- message.decrementReference(storeContext);
-
- }
-
- _lock.unlock();
- }
-
- public long clearAllMessages(StoreContext storeContext) throws AMQException
- {
- long count = 0;
- _lock.lock();
-
- synchronized (_queueHeadLock)
- {
- AMQMessage msg = getNextMessage();
- while (msg != null)
- {
- //and remove it
- _messages.poll();
-
- _queue.dequeue(storeContext, msg);
-
- msg.decrementReference(_reapingStoreContext);
-
- msg = getNextMessage();
- count++;
- }
- _totalMessageSize.set(0L);
- }
- _lock.unlock();
- return count;
- }
-
- /**
- * This can only be used to clear the _messages queue. Any subscriber resend queue will not be purged.
- *
- * @return the next message or null
- *
- * @throws org.apache.qpid.AMQException
- */
- private AMQMessage getNextMessage() throws AMQException
- {
- return getNextMessage(_messages, null, false);
- }
-
- private AMQMessage getNextMessage(Queue<AMQMessage> messages, Subscription sub, boolean purgeOnly) throws AMQException
- {
- AMQMessage message = messages.peek();
-
- //while (we have a message) && ((The subscriber is not a browser or message is taken ) or we are clearing) && (Check message is taken.)
- while (purgeMessage(message, sub, purgeOnly))
- {
- // if we are purging then ensure we mark this message taken for the current subscriber
- // the current subscriber may be null in the case of a get or a purge but this is ok.
-// boolean alreadyTaken = message.taken(_queue, sub);
-
- //remove the already taken message or expired
- AMQMessage removed = messages.poll();
-
- assert removed == message;
-
- // if the message expired then the _totalMessageSize needs adjusting
- if (message.expired(_queue) && !message.getDeliveredToConsumer())
- {
- _totalMessageSize.addAndGet(-message.getSize());
-
- // Use the reapingStoreContext as any sub(if we have one) may be in a tx.
- _queue.dequeue(_reapingStoreContext, message);
-
- message.decrementReference(_reapingStoreContext);
-
- if (_log.isInfoEnabled())
- {
- _log.info(debugIdentity() + " Doing clean up of the main _message queue.");
- }
- }
-
- //else the clean up is not required as the message has already been taken for this queue therefore
- // it was the responsibility of the code that took the message to ensure the _totalMessageSize was updated.
-
- if (_log.isTraceEnabled())
- {
- _log.trace("Removed taken message:" + message.debugIdentity());
- }
-
- // try the next message
- message = messages.peek();
- }
-
- return message;
- }
-
- /**
- * This method will return true if the message is to be purged from the queue.
- *
- *
- * SIDE-EFFECT: The message will be taken by the Subscription(sub) for the current Queue(_queue)
- *
- * @param message
- * @param sub
- *
- * @return
- *
- * @throws AMQException
- */
- private boolean purgeMessage(AMQMessage message, Subscription sub) throws AMQException
- {
- return purgeMessage(message, sub, false);
- }
-
- /**
- * This method will return true if the message is to be purged from the queue.
- * \
- * SIDE-EFFECT: The msg will be taken by the Subscription(sub) for the current Queue(_queue) when purgeOnly is false
- *
- * @param message
- * @param sub
- * @param purgeOnly When set to false the message will be taken by the given Subscription.
- *
- * @return if the msg should be purged
- *
- * @throws AMQException
- */
- private boolean purgeMessage(AMQMessage message, Subscription sub, boolean purgeOnly) throws AMQException
- {
- //Original.. complicated while loop control
-// (message != null
-// && (
-// ((sub != null && !sub.isBrowser()) || message.isTaken(_queue))
-// || sub == null)
-// && message.taken(_queue, sub));
-
- boolean purge = false;
-
- // if the message is null then don't purge as we have no messagse.
- if (message != null)
- {
- // Check that the message hasn't expired.
- if (message.expired(_queue))
- {
- return true;
- }
-
- // if we have a subscriber perform message checks
- if (sub != null)
- {
- // if we have a queue browser(we don't purge) so check mark the message as taken
- purge = ((!sub.isBrowser() || message.isTaken(_queue)));
- }
- else
- {
- // if there is no subscription we are doing
- // a get or purging so mark message as taken.
- message.isTaken(_queue);
- // and then ensure that it gets purged
- purge = true;
- }
- }
-
- if (purgeOnly)
- {
- // If we are simply purging the queue don't take the message
- // just purge up to the next non-taken msg.
- return purge && message.isTaken(_queue);
- }
- else
- {
- // if we are purging then ensure we mark this message taken for the current subscriber
- // the current subscriber may be null in the case of a get or a purge but this is ok.
- return purge && message.taken(_queue, sub);
- }
- }
-
- public void sendNextMessage(Subscription sub, AMQQueue queue)//Queue<AMQMessage> messageQueue)
- {
-
- Queue<AMQMessage> messageQueue = sub.getNextQueue(_messages);
-
- if (_log.isTraceEnabled())
- {
- _log.trace(debugIdentity() + "Async sendNextMessage for sub (" + System.identityHashCode(sub) +
- ") from queue (" + System.identityHashCode(messageQueue) +
- ") AMQQueue (" + System.identityHashCode(queue) + ")");
- }
-
- if (messageQueue == null)
- {
- // There is no queue with messages currently. This is ok... just means the queue has no msgs matching selector
- if (_log.isInfoEnabled())
- {
- _log.info(debugIdentity() + sub + ": asked to send messages but has none on given queue:" + queue);
- }
- return;
- }
-
- AMQMessage message = null;
- AMQMessage removed = null;
- try
- {
- synchronized (_queueHeadLock)
- {
- message = getNextMessage(messageQueue, sub, false);
-
- // message will be null if we have no messages in the messageQueue.
- if (message == null)
- {
- if (_log.isTraceEnabled())
- {
- _log.trace(debugIdentity() + "No messages for Subscriber(" + System.identityHashCode(sub) + ") from queue; (" + System.identityHashCode(messageQueue) + ")");
- }
- return;
- }
- if (_log.isDebugEnabled())
- {
- _log.debug(debugIdentity() + "Async Delivery Message :" + message + "(" + System.identityHashCode(message) +
- ") by :" + System.identityHashCode(this) +
- ") to :" + System.identityHashCode(sub));
- }
-
-
- if (messageQueue == _messages)
- {
- _totalMessageSize.addAndGet(-message.getSize());
- }
-
- sub.send(message, _queue);
-
- //remove sent message from our queue.
- removed = messageQueue.poll();
- //If we don't remove the message from _messages
- // Otherwise the Async send will never end
- }
-
- if (removed != message)
- {
- _log.error("Just send message:" + message.debugIdentity() + " BUT removed this from queue:" + removed);
- }
-
- if (_log.isDebugEnabled())
- {
- _log.debug(debugIdentity() + "Async Delivered Message r:" + removed.debugIdentity() + "d:" + message +
- ") by :" + System.identityHashCode(this) +
- ") to :" + System.identityHashCode(sub));
- }
-
-
- if (messageQueue == sub.getResendQueue())
- {
- if (_log.isTraceEnabled())
- {
- _log.trace(debugIdentity() + "All messages sent from resendQueue for " + sub);
- }
- if (messageQueue.isEmpty())
- {
- subscriberHasPendingResend(false, sub, null);
- //better to use the above method as this keeps all the tracking in one location.
- // _hasContent.remove(sub);
- }
-
- _extraMessages.decrementAndGet();
- }
- else if (messageQueue == sub.getPreDeliveryQueue() && !sub.isBrowser())
- {
- if (_log.isInfoEnabled())
- {
- //fixme - we should do the clean up as the message remains on the _message queue
- // this is resulting in the next consumer receiving the message and then attempting to purge it
- //
- cleanMainQueue(sub);
- }
- }
-
- }
- catch (AMQException e)
- {
- if (message != null)
- {
- message.release(_queue);
- }
- else
- {
- _log.error(debugIdentity() + "Unable to release message as it is null. " + e, e);
- }
- _log.error(debugIdentity() + "Unable to deliver message as dequeue failed: " + e, e);
- }
- }
-
- private void cleanMainQueue(Subscription sub)
- {
- try
- {
- getNextMessage(_messages, sub, true);
- }
- catch (AMQException e)
- {
- _log.warn("Problem during main queue purge:" + e.getMessage());
- }
- }
-
- /**
- * enqueues the messages in the list on the queue and all required predelivery queues
- *
- * @param storeContext
- * @param movedMessageList
- */
- public void enqueueMovedMessages(StoreContext storeContext, List<AMQMessage> movedMessageList)
- {
- _lock.lock();
- for (AMQMessage msg : movedMessageList)
- {
- addMessageToQueue(msg, false);
- }
-
- // enqueue on the pre delivery queues
- for (Subscription sub : _subscriptions.getSubscriptions())
- {
- for (AMQMessage msg : movedMessageList)
- {
- // Only give the message to those that want them.
- if (sub.hasInterest(msg))
- {
- sub.enqueueForPreDelivery(msg, true);
- }
- }
- }
- _lock.unlock();
- }
-
- /**
- * Only one thread should ever execute this method concurrently, but it can do so while other threads invoke
- * deliver().
- */
- private void processQueue()
- {
- //record thread name
- if (_log.isDebugEnabled())
- {
- _processingThreadName = Thread.currentThread().getName();
- }
-
- if (_log.isDebugEnabled())
- {
- _log.debug(debugIdentity() + "Running process Queue." + currentStatus());
- }
-
- // Continue to process delivery while we haveSubscribers and messages
- boolean hasSubscribers = _subscriptions.hasActiveSubscribers();
-
- while (hasSubscribers && hasQueuedMessages() && !_movingMessages.get())
- {
- hasSubscribers = false;
-
- for (Subscription sub : _subscriptions.getSubscriptions())
- {
- synchronized (sub.getSendLock())
- {
- if (!sub.isSuspended())
- {
- sendNextMessage(sub, _queue);
-
- hasSubscribers = true;
- }
- }
- }
- }
-
- if (_log.isDebugEnabled())
- {
- _log.debug(debugIdentity() + "Done process Queue." + currentStatus());
- }
-
- }
-
- public void deliver(StoreContext context, AMQShortString name, AMQMessage msg, boolean deliverFirst) throws AMQException
- {
-
- final boolean debugEnabled = _log.isDebugEnabled();
- if (debugEnabled)
- {
- _log.debug(debugIdentity() + "deliver :first(" + deliverFirst + ") :" + msg);
- }
-
- //Check if we have someone to deliver the message to.
- _lock.lock();
- try
- {
- Subscription s = _subscriptions.nextSubscriber(msg);
-
- if (s == null || (!s.filtersMessages() && hasQueuedMessages())) //no-one can take the message right now or we're queueing
- {
- if (debugEnabled)
- {
- _log.debug(debugIdentity() + "Testing Message(" + msg + ") for Queued Delivery:" + currentStatus());
- }
- if (!msg.getMessagePublishInfo().isImmediate())
- {
- addMessageToQueue(msg, deliverFirst);
-
- //release lock now message is on queue.
- _lock.unlock();
-
- //Pre Deliver to all subscriptions
- if (debugEnabled)
- {
- _log.debug(debugIdentity() + "We have " + _subscriptions.getSubscriptions().size() +
- " subscribers to give the message to:" + currentStatus());
- }
- for (Subscription sub : _subscriptions.getSubscriptions())
- {
-
- // stop if the message gets delivered whilst PreDelivering if we have a shared queue.
- if (_queue.isShared() && msg.getDeliveredToConsumer())
- {
- if (debugEnabled)
- {
- _log.debug(debugIdentity() + "Stopping PreDelivery as message(" + System.identityHashCode(msg) +
- ") is already delivered.");
- }
- continue;
- }
-
- // Only give the message to those that want them.
- if (sub.hasInterest(msg))
- {
- if (debugEnabled)
- {
- _log.debug(debugIdentity() + "Queuing message(" + System.identityHashCode(msg) +
- ") for PreDelivery for subscriber(" + System.identityHashCode(sub) + ")");
- }
- sub.enqueueForPreDelivery(msg, deliverFirst);
- }
- }
-
- //if we have a non-filtering subscriber but queued messages && we're not Async && we have other Active subs then something is wrong!
- if ((s != null && hasQueuedMessages()) && !isProcessingAsync() && _subscriptions.hasActiveSubscribers())
- {
- _queue.deliverAsync();
- }
-
- }
- }
- else
- {
-
- if (s.filtersMessages())
- {
- if (s.getPreDeliveryQueue().size() > 0)
- {
- _log.error("Direct delivery from PDQ with queued msgs:" + s.getPreDeliveryQueue().size());
- }
- }
- else if (_messages.size() > 0)
- {
- _log.error("Direct delivery from MainQueue queued msgs:" + _messages.size());
- }
-
- //release lock now
- _lock.unlock();
- synchronized (s.getSendLock())
- {
- if (!s.isSuspended())
- {
- if (_log.isTraceEnabled())
- {
- _log.trace(debugIdentity() + "Delivering Message:" + msg.debugIdentity() + " to(" +
- System.identityHashCode(s) + ") :" + s);
- }
-
- if (msg.taken(_queue, s))
- {
- //Message has been delivered so don't redeliver.
- // This can currently occur because of the recursive call below
- // During unit tests the send can occur
- // client then rejects
- // this reject then releases the message by the time the
- // if(!msg.isTaken()) call is made below
- // the message has been released so that thread loops to send the message again
- // of course by the time it gets back to here. the thread that released the
- // message is now ready to send it. Here is a sample trace for reference
-//1192627162613:Thread[pool-917-thread-4,5,main]:CSDM:delivery:(true)message:Message[(HC:5529738 ID:145 Ref:1)]: 145; ref count: 1; taken for queues: {Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=false} by Subs:{Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=null}:sub:[channel=Channel: id 1, transaction mode: true, prefetch marks: 2500/5000, consumerTag=41, session=anonymous(5050419), resendQueue=false]
-//1192627162613:Thread[pool-917-thread-4,5,main]:Msg:taken:Q:Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326:sub:[channel=Channel: id 1, transaction mode: true, prefetch marks: 2500/5000, consumerTag=41, session=anonymous(5050419), resendQueue=false]:this:Message[(HC:5529738 ID:145 Ref:1)]: 145; ref count: 1; taken for queues: {Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=false} by Subs:{Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=null}
-//1192627162613:Thread[pool-917-thread-4,5,main]:28398657 Sent :dt:214 msg:(HC:5529738 ID:145 Ref:1)
-//1192627162613:Thread[pool-917-thread-2,5,main]:Reject message by:[channel=Channel: id 1, transaction mode: true, prefetch marks: 2500/5000, consumerTag=41, session=anonymous(5050419), resendQueue=false]
-//1192627162613:Thread[pool-917-thread-2,5,main]:Releasing Message:(HC:5529738 ID:145 Ref:1)
-//1192627162613:Thread[pool-917-thread-2,5,main]:Msg:Release:Q:Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326:This:Message[(HC:5529738 ID:145 Ref:1)]: 145; ref count: 1; taken for queues: {Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=false} by Subs:{Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=[channel=Channel: id 1, transaction mode: true, prefetch marks: 2500/5000, consumerTag=41, session=anonymous(5050419), resendQueue=false]}
-//1192627162613:Thread[pool-917-thread-2,5,main]:CSDM:delivery:(true)message:Message[(HC:5529738 ID:145 Ref:1)]: 145; ref count: 1; taken for queues: {Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=false} by Subs:{Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=null}:sub:[channel=Channel: id 1, transaction mode: true, prefetch marks: 2500/5000, consumerTag=33, session=anonymous(26960027), resendQueue=false]
-//1192627162629:Thread[pool-917-thread-4,5,main]:CSDM:suspended: Message((HC:5529738 ID:145 Ref:1)) has not been taken so recursing!: Subscriber:28398657
-//1192627162629:Thread[pool-917-thread-4,5,main]:CSDM:delivery:(true)message:Message[(HC:5529738 ID:145 Ref:1)]: 145; ref count: 1; taken for queues: {Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=false} by Subs:{Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=null}:sub:[channel=Channel: id 1, transaction mode: true, prefetch marks: 2500/5000, consumerTag=33, session=anonymous(26960027), resendQueue=false]
-//1192627162629:Thread[pool-917-thread-2,5,main]:Msg:taken:Q:Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326:sub:[channel=Channel: id 1, transaction mode: true, prefetch marks: 2500/5000, consumerTag=33, session=anonymous(26960027), resendQueue=false]:this:Message[(HC:5529738 ID:145 Ref:1)]: 145; ref count: 1; taken for queues: {Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=false} by Subs:{Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=null}
-//1192627162629:Thread[pool-917-thread-2,5,main]:25386607 Sent :dt:172 msg:(HC:5529738 ID:145 Ref:1)
-//1192627162629:Thread[pool-917-thread-4,5,main]:Msg:taken:Q:Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326:sub:[channel=Channel: id 1, transaction mode: true, prefetch marks: 2500/5000, consumerTag=33, session=anonymous(26960027), resendQueue=false]:this:Message[(HC:5529738 ID:145 Ref:1)]: 145; ref count: 1; taken for queues: {Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=true} by Subs:{Queue(queue-596fb10e-2968-4e51-a751-1e6643bf9dd6)@16017326=[channel=Channel: id 1, transaction mode: true, prefetch marks: 2500/5000, consumerTag=33, session=anonymous(26960027), resendQueue=false]}
- // Note: In the last request to take the message from thread 4,5 the message has been
- // taken by the previous call done by thread 2,5
-
-
- return;
- }
- //Deliver the message
- s.send(msg, _queue);
- }
- else
- {
- if (debugEnabled)
- {
- _log.debug(debugIdentity() + " Subscription(" + System.identityHashCode(s) + ") became " +
- "suspended between nextSubscriber and send for message:" + msg.debugIdentity());
- }
- }
- }
-
- //
- // Why do we do this? What was the reasoning? We should have a better approach
- // than recursion and rejecting if someone else sends it before we do.
- //
- if (!msg.isTaken(_queue))
- {
- if (debugEnabled)
- {
- _log.debug(debugIdentity() + " Message(" + msg.debugIdentity() + ") has not been taken so recursing!:" +
- " Subscriber:" + System.identityHashCode(s));
- }
-
- deliver(context, name, msg, deliverFirst);
- }
- else
- {
- if (debugEnabled)
- {
- _log.debug(debugIdentity() + " Message(" + msg.toString() +
- ") has been taken so disregarding deliver request to Subscriber:" +
- System.identityHashCode(s));
- }
- }
- }
-
- }
- finally
- {
- //ensure lock is released
- if (_lock.isHeldByCurrentThread())
- {
- _lock.unlock();
- }
- }
- }
-
- private final String id = "(" + String.valueOf(System.identityHashCode(this)) + ")";
-
- private String debugIdentity()
- {
- return id;
- }
-
- final Runner _asyncDelivery = new Runner();
-
- private class Runner implements Runnable
- {
- public void run()
- {
- String startName = Thread.currentThread().getName();
- Thread.currentThread().setName("CSDM-AsyncDelivery:" + startName);
- boolean running = true;
- while (running && !_movingMessages.get())
- {
- processQueue();
-
- //Check that messages have not been added since we did our last peek();
- // Synchronize with the thread that adds to the queue.
- // If the queue is still empty then we can exit
- synchronized (_asyncDelivery)
- {
- if (!(hasQueuedMessages() && _subscriptions.hasActiveSubscribers()))
- {
- running = false;
- _processing.set(false);
- }
- }
- }
- Thread.currentThread().setName(startName);
- }
- }
-
- public void processAsync(Executor executor)
- {
- if (_log.isDebugEnabled())
- {
- _log.debug(debugIdentity() + "Processing Async." + currentStatus());
- }
-
- synchronized (_asyncDelivery)
- {
- if (hasQueuedMessages() && _subscriptions.hasActiveSubscribers())
- {
- //are we already running? if so, don't re-run
- if (_processing.compareAndSet(false, true))
- {
- if (_log.isDebugEnabled())
- {
- _log.debug(debugIdentity() + "Executing Async process.");
- }
- executor.execute(_asyncDelivery);
- }
- }
- }
- }
-
- private String currentStatus()
- {
- return " Queued:" + (_messages.isEmpty() ? "Empty " : "Contains(H:M)") +
- "(" + ((ConcurrentLinkedMessageQueueAtomicSize) _messages).headSize() +
- ":" + (_messages.size() - ((ConcurrentLinkedMessageQueueAtomicSize) _messages).headSize()) + ") " +
- " Extra: " + (_hasContent.isEmpty() ? "Empty " : "Contains") +
- "(" + _hasContent.size() + ":" + _extraMessages.get() + ") " +
- " Active:" + _subscriptions.hasActiveSubscribers() +
- " Processing:" + (_processing.get() ? " true : Processing Thread: " + _processingThreadName : " false");
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/DefaultQueueRegistry.java
deleted file mode 100644
index cbe9246f09..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/DeliveryManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/DeliveryManager.java
deleted file mode 100644
index 153106d919..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/DeliveryManager.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.queue;
-
-import java.util.List;
-import java.util.concurrent.Executor;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.store.StoreContext;
-
-interface DeliveryManager
-{
- /**
- * Determines whether there are queued messages. Sets _queueing to false if there are no queued messages. This needs
- * to be atomic.
- *
- * @return true if there are queued messages
- */
- boolean hasQueuedMessages();
-
- /**
- * This method should not be used to determin if there are messages in the queue.
- *
- * @return int The number of messages in the queue
- *
- * @use hasQueuedMessages() for all controls relating to having messages on the queue.
- */
- int getQueueMessageCount();
-
- /**
- * Requests that the delivery manager start processing the queue asynchronously if there is work that can be done
- * (i.e. there are messages queued up and subscribers that can receive them. <p/> This should be called when
- * subscribers are added, but only after the consume-ok message has been returned as message delivery may start
- * immediately. It should also be called after unsuspending a client. <p/>
- *
- * @param executor the executor on which the delivery should take place
- */
- void processAsync(Executor executor);
-
- /**
- * Handles message delivery. The delivery manager is always in one of two modes; it is either queueing messages for
- * asynchronous delivery or delivering directly.
- *
- * @param storeContext
- * @param name the name of the entity on whose behalf we are delivering the message
- * @param msg the message to deliver
- * @param deliverFirst
- *
- * @throws org.apache.qpid.server.queue.FailedDequeueException
- * if the message could not be dequeued
- */
- void deliver(StoreContext storeContext, AMQShortString name, AMQMessage msg, boolean deliverFirst) throws FailedDequeueException, AMQException;
-
- void removeAMessageFromTop(StoreContext storeContext, AMQQueue queue) throws AMQException;
-
- long clearAllMessages(StoreContext storeContext) throws AMQException;
-
- void startMovingMessages();
-
- void enqueueMovedMessages(StoreContext context, List<AMQMessage> messageList);
-
- void stopMovingMessages();
-
- void removeMovedMessages(List<AMQMessage> messageListToRemove);
-
- List<AMQMessage> getMessages();
-
- List<AMQMessage> getMessages(long fromMessageId, long toMessageId);
-
- void populatePreDeliveryQueue(Subscription subscription);
-
- boolean performGet(AMQProtocolSession session, AMQChannel channel, boolean acks) throws AMQException;
-
- long getTotalMessageSize();
-
- long getOldestMessageArrival();
-
- void subscriberHasPendingResend(boolean hasContent, Subscription subscription, AMQMessage msg);
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.java
deleted file mode 100644
index 60c1a8f574..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/ExchangeBindings.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.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 static final FieldTable EMPTY_ARGUMENTS = new FieldTable();
-
- static class ExchangeBinding
- {
- private final Exchange _exchange;
- private final AMQShortString _routingKey;
- private final FieldTable _arguments;
-
- ExchangeBinding(AMQShortString routingKey, Exchange exchange)
- {
- this(routingKey, exchange, EMPTY_ARGUMENTS);
- }
-
- ExchangeBinding(AMQShortString routingKey, Exchange exchange, FieldTable arguments)
- {
- _routingKey = 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 int hashCode()
- {
- return (_exchange == null ? 0 : _exchange.hashCode())
- + (_routingKey == null ? 0 : _routingKey.hashCode())
- + (_arguments == null ? 0 : _arguments.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)
- && _arguments.equals(eb._arguments);
- }
- }
-
- 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 void remove(AMQShortString routingKey, FieldTable arguments, Exchange exchange)
- {
- _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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/FailedDequeueException.java
deleted file mode 100644
index 6466e81dd2..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/InMemoryMessageHandle.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/InMemoryMessageHandle.java
deleted file mode 100644
index 630186991b..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/InMemoryMessageHandle.java
+++ /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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.ContentBody;
-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 = new LinkedList<ContentChunk>();
-
- private boolean _redelivered;
-
- private long _arrivalTime;
-
- public InMemoryMessageHandle()
- {
- }
-
- public ContentHeaderBody getContentHeaderBody(StoreContext context, Long messageId) throws AMQException
- {
- return _contentHeaderBody;
- }
-
- public int getBodyCount(StoreContext context, Long messageId)
- {
- return _contentBodies.size();
- }
-
- public long getBodySize(StoreContext context, Long messageId) throws AMQException
- {
- return getContentHeaderBody(context, messageId).bodySize;
- }
-
- public ContentChunk getContentChunk(StoreContext context, Long messageId, 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, Long messageId, ContentChunk contentBody, boolean isLastContentBody)
- throws AMQException
- {
- _contentBodies.add(contentBody);
- }
-
- public MessagePublishInfo getMessagePublishInfo(StoreContext context, Long messageId) throws AMQException
- {
- return _messagePublishInfo;
- }
-
- public boolean isRedelivered()
- {
- return _redelivered;
- }
-
-
- public void setRedelivered(boolean redelivered)
- {
- _redelivered = redelivered;
- }
-
- public boolean isPersistent(StoreContext context, Long messageId) throws AMQException
- {
- //todo remove literal values to a constant file such as AMQConstants in common
- ContentHeaderBody chb = getContentHeaderBody(context, messageId);
- return chb.properties instanceof BasicContentHeaderProperties &&
- ((BasicContentHeaderProperties) chb.properties).getDeliveryMode() == 2;
- }
-
- /**
- * This is called when all the content has been received.
- * @param messagePublishInfo
- * @param contentHeaderBody
- * @throws AMQException
- */
- public void setPublishAndContentHeaderBody(StoreContext storeContext, Long messageId, MessagePublishInfo messagePublishInfo,
- ContentHeaderBody contentHeaderBody)
- throws AMQException
- {
- _messagePublishInfo = messagePublishInfo;
- _contentHeaderBody = contentHeaderBody;
- _arrivalTime = System.currentTimeMillis();
- }
-
- public void removeMessage(StoreContext storeContext, Long messageId) throws AMQException
- {
- // NO OP
- }
-
- public void enqueue(StoreContext storeContext, Long messageId, AMQQueue queue) throws AMQException
- {
- // NO OP
- }
-
- public void dequeue(StoreContext storeContext, Long messageId, AMQQueue queue) throws AMQException
- {
- // NO OP
- }
-
- public long getArrivalTime()
- {
- return _arrivalTime;
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/ManagedQueue.java
deleted file mode 100644
index 061ab56024..0000000000
--- a/Final/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 thr 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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/MessageCleanupException.java
deleted file mode 100644
index 090096d3c3..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/MessageHandleFactory.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/MessageHandleFactory.java
deleted file mode 100644
index 94ab935115..0000000000
--- a/Final/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(store);
- }
- else
- {
- return new InMemoryMessageHandle();
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/MessageMetaData.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/MessageMetaData.java
deleted file mode 100644
index 6118a4c11f..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/NoConsumersException.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/NoConsumersException.java
deleted file mode 100644
index d6fd1eec89..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/NotificationCheck.java
deleted file mode 100644
index 6b3d65661f..0000000000
--- a/Final/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 = queue.getMessageCount();
- final long maximumMessageCount = queue.getMaximumMessageCount();
- if (maximumMessageCount!= 0 && msgCount >= 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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/QueueNotificationListener.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/QueueNotificationListener.java
deleted file mode 100644
index 959ca03c80..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/QueueRegistry.java
deleted file mode 100644
index 1210f0e97c..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/Subscription.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/Subscription.java
deleted file mode 100644
index 77688f19be..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/Subscription.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.queue;
-
-import java.util.Queue;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.AMQChannel;
-
-public interface Subscription
-{
- void send(AMQMessage msg, AMQQueue queue) throws AMQException;
-
- boolean isSuspended();
-
- void queueDeleted(AMQQueue queue) throws AMQException;
-
- boolean filtersMessages();
-
- boolean hasInterest(AMQMessage msg);
-
- Queue<AMQMessage> getPreDeliveryQueue();
-
- Queue<AMQMessage> getResendQueue();
-
- Queue<AMQMessage> getNextQueue(Queue<AMQMessage> messages);
-
- void enqueueForPreDelivery(AMQMessage msg, boolean deliverFirst);
-
- boolean isAutoClose();
-
- void close();
-
- boolean isClosed();
-
- boolean isBrowser();
-
- boolean wouldSuspend(AMQMessage msg);
-
- void addToResendQueue(AMQMessage msg);
-
- Object getSendLock();
-
- AMQChannel getChannel();
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionFactory.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionFactory.java
deleted file mode 100644
index 917f7c4e97..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionFactory.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.framing.FieldTable;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-
-/**
- * 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, AMQQueue queue) throws AMQException;
-
-
- Subscription createSubscription(int channel, AMQProtocolSession protocolSession, AMQShortString consumerTag)
- throws AMQException;
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java
deleted file mode 100644
index 1299c3a80c..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionImpl.java
+++ /dev/null
@@ -1,680 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.Queue;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-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.output.ProtocolOutputConverter;
-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;
-import org.apache.qpid.util.ConcurrentLinkedQueueAtomicSize;
-import org.apache.qpid.util.MessageQueue;
-import org.apache.qpid.util.ConcurrentLinkedMessageQueueAtomicSize;
-
-/**
- * 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 class SubscriptionImpl implements Subscription
-{
-
- private static final Logger _suspensionlogger = Logger.getLogger("Suspension");
- private static final Logger _logger = Logger.getLogger(SubscriptionImpl.class);
-
- public final AMQChannel channel;
-
- public final AMQProtocolSession protocolSession;
-
- public final AMQShortString consumerTag;
-
- private final Object _sessionKey;
-
- private MessageQueue<AMQMessage> _messages;
-
- private Queue<AMQMessage> _resendQueue;
-
- private final boolean _noLocal;
-
- /** True if messages need to be acknowledged */
- private final boolean _acks;
- private FilterManager _filters;
- private final boolean _isBrowser;
- private final Boolean _autoClose;
- private boolean _sentClose = false;
-
- private static final String CLIENT_PROPERTIES_INSTANCE = ClientProperties.instance.toString();
-
- private AMQQueue _queue;
- private final AtomicBoolean _sendLock = new AtomicBoolean(false);
-
-
- public static class Factory implements SubscriptionFactory
- {
- public Subscription createSubscription(int channel, AMQProtocolSession protocolSession,
- AMQShortString consumerTag, boolean acks, FieldTable filters,
- boolean noLocal, AMQQueue queue) throws AMQException
- {
- return new SubscriptionImpl(channel, protocolSession, consumerTag, acks, filters, noLocal, queue);
- }
-
- public SubscriptionImpl createSubscription(int channel, AMQProtocolSession protocolSession, AMQShortString consumerTag)
- throws AMQException
- {
- return new SubscriptionImpl(channel, protocolSession, consumerTag, false, null, false, null);
- }
- }
-
- public SubscriptionImpl(int channelId, AMQProtocolSession protocolSession,
- AMQShortString consumerTag, boolean acks)
- throws AMQException
- {
- this(channelId, protocolSession, consumerTag, acks, null, false, null);
- }
-
- public SubscriptionImpl(int channelId, AMQProtocolSession protocolSession,
- AMQShortString consumerTag, boolean acks, FieldTable filters,
- boolean noLocal, AMQQueue queue)
- throws AMQException
- {
- AMQChannel channel = protocolSession.getChannel(channelId);
- if (channel == null)
- {
- throw new AMQException(AMQConstant.NOT_FOUND, "channel :" + channelId + " not found in protocol session");
- }
-
- this.channel = channel;
- this.protocolSession = protocolSession;
- this.consumerTag = consumerTag;
- _sessionKey = protocolSession.getKey();
- _acks = acks;
- _noLocal = noLocal;
- _queue = queue;
-
- _filters = FilterManagerFactory.createManager(filters);
-
-
- if (_filters != null)
- {
- Object isBrowser = filters.get(AMQPFilterTypes.NO_CONSUME.getValue());
- if (isBrowser != null)
- {
- _isBrowser = (Boolean) isBrowser;
- }
- else
- {
- _isBrowser = false;
- }
- }
- else
- {
- _isBrowser = false;
- }
-
-
- if (_filters != null)
- {
- Object autoClose = filters.get(AMQPFilterTypes.AUTO_CLOSE.getValue());
- if (autoClose != null)
- {
- _autoClose = (Boolean) autoClose;
- }
- else
- {
- _autoClose = false;
- }
- }
- else
- {
- _autoClose = false;
- }
-
-
- if (filtersMessages())
- {
- _messages = new ConcurrentLinkedMessageQueueAtomicSize<AMQMessage>();
- }
- else
- {
- // Reference the DeliveryManager
- _messages = null;
- }
- }
-
-
- public SubscriptionImpl(int channel, AMQProtocolSession protocolSession,
- AMQShortString consumerTag)
- throws AMQException
- {
- this(channel, protocolSession, consumerTag, false);
- }
-
- public boolean equals(Object o)
- {
- return (o instanceof SubscriptionImpl) && equals((SubscriptionImpl) o);
- }
-
- /**
- * Equality holds if the session matches and the channel and consumer tag are the same.
- *
- * @param psc The subscriptionImpl to compare
- *
- * @return equality
- */
- private boolean equals(SubscriptionImpl psc)
- {
- return _sessionKey.equals(psc._sessionKey)
- && psc.channel == channel
- && psc.consumerTag.equals(consumerTag);
- }
-
- public int hashCode()
- {
- return _sessionKey.hashCode();
- }
-
- public String toString()
- {
- String subscriber = "[channel=" + channel +
- ", consumerTag=" + consumerTag +
- ", session=" + protocolSession.getKey() +
- ", resendQueue=" + (_resendQueue != null);
-
- if (_resendQueue != null)
- {
- subscriber += ", resendSize=" + _resendQueue.size();
- }
-
-
- 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
- * @param queue the Queue it has been sent from
- *
- * @throws AMQException
- */
- public void send(AMQMessage msg, AMQQueue queue) throws AMQException
- {
- if (msg != null)
- {
- if (_isBrowser)
- {
- sendToBrowser(msg, queue);
- }
- else
- {
- sendToConsumer(channel.getStoreContext(), msg, queue);
- }
- }
- else
- {
- _logger.error("Attempt to send Null message", new NullPointerException());
- }
- }
-
- private void sendToBrowser(AMQMessage msg, AMQQueue queue) 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 (channel)
- {
- long deliveryTag = channel.getNextDeliveryTag();
-
- // We don't need to add the message to the unacknowledgedMap as we don't need to know if the client
- // received the message. If it is lost in transit that is not important.
-// if (_acks)
-// {
-// channel.addUnacknowledgedBrowsedMessage(msg, deliveryTag, consumerTag, queue);
-// }
-
- if (_sendLock.get())
- {
- _logger.error("Sending " + msg + " when subscriber(" + this + ") is closed!");
- }
-
- protocolSession.getProtocolOutputConverter().writeDeliver(msg, channel.getChannelId(), deliveryTag, consumerTag);
- }
- }
-
- private void sendToConsumer(StoreContext storeContext, AMQMessage msg, AMQQueue queue)
- 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.
- if (!_acks)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("No ack mode so dequeuing message immediately: " + msg.getMessageId());
- }
- queue.dequeue(storeContext, msg);
- }
-
- synchronized (channel)
- {
- long deliveryTag = channel.getNextDeliveryTag();
-
- if (_sendLock.get())
- {
- _logger.error("Sending " + msg + " when subscriber(" + this + ") is closed!");
- }
-
- if (_acks)
- {
- channel.addUnacknowledgedMessage(msg, deliveryTag, consumerTag, queue);
- }
-
- protocolSession.getProtocolOutputConverter().writeDeliver(msg, channel.getChannelId(), deliveryTag, consumerTag);
-
- if (!_acks)
- {
- msg.decrementReference(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?
-
- msg.setDeliveredToConsumer();
- }
- }
-
- public boolean isSuspended()
- {
-// if (_suspensionlogger.isInfoEnabled())
-// {
-// if (channel.isSuspended())
-// {
-// _suspensionlogger.debug("Subscription(" + debugIdentity() + ") channel's is susupended");
-// }
-// if (_sendLock.get())
-// {
-// _suspensionlogger.debug("Subscription(" + debugIdentity() + ") has sendLock set so closing.");
-// }
-// }
- return channel.isSuspended() || _sendLock.get();
- }
-
- /**
- * Callback indicating that a queue has been deleted.
- *
- * @param queue The queue to delete
- */
- public void queueDeleted(AMQQueue queue) throws AMQException
- {
- channel.queueDeleted(queue);
- }
-
- public boolean filtersMessages()
- {
- return _filters != null || _noLocal;
- }
-
- public boolean hasInterest(AMQMessage msg)
- {
- //check that the message hasn't been rejected
- if (msg.isRejectedBy(this))
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Subscription:" + debugIdentity() + " rejected message:" + msg.debugIdentity());
- }
-// return false;
- }
-
- final AMQProtocolSession publisher = msg.getPublisher();
-
- //todo - client id should be recoreded and this test removed but handled below
- if (_noLocal && publisher != null)
- {
- // We don't want local messages so check to see if message is one we sent
- Object localInstance;
- Object msgInstance;
-
- if ((protocolSession.getClientProperties() != null) &&
- (localInstance = protocolSession.getClientProperties().getObject(CLIENT_PROPERTIES_INSTANCE)) != null)
- {
-
- if ((publisher.getClientProperties() != null) &&
- (msgInstance = publisher.getClientProperties().getObject(CLIENT_PROPERTIES_INSTANCE)) != null)
- {
- if (localInstance == msgInstance || localInstance.equals(msgInstance))
- {
-// if (_logger.isTraceEnabled())
-// {
-// _logger.trace("(" + debugIdentity() + ") has no interest as it is a local message(" +
-// msg.debugIdentity() + ")");
-// }
- return false;
- }
- }
- }
- else
- {
-
- localInstance = protocolSession.getClientIdentifier();
- //todo - client id should be recoreded and this test removed but handled here
-
- msgInstance = publisher.getClientIdentifier();
- if (localInstance == msgInstance || ((localInstance != null) && localInstance.equals(msgInstance)))
- {
-// if (_logger.isTraceEnabled())
-// {
-// _logger.trace("(" + debugIdentity() + ") has no interest as it is a local message(" +
-// msg.debugIdentity() + ")");
-// }
- return false;
- }
- }
-
-
- }
-
-
- if (_logger.isTraceEnabled())
- {
- _logger.trace("(" + debugIdentity() + ") checking filters for message (" + msg.debugIdentity());
- }
- return checkFilters(msg);
-
- }
-
- private String id = String.valueOf(System.identityHashCode(this));
-
- private String debugIdentity()
- {
- return id;
- }
-
- private boolean checkFilters(AMQMessage msg)
- {
- if (_filters != null)
- {
-// if (_logger.isTraceEnabled())
-// {
-// _logger.trace("(" + debugIdentity() + ") has filters.");
-// }
- return _filters.allAllow(msg);
- }
- else
- {
-// if (_logger.isTraceEnabled())
-// {
-// _logger.trace("(" + debugIdentity() + ") has no filters");
-// }
-
- return true;
- }
- }
-
- public Queue<AMQMessage> getPreDeliveryQueue()
- {
- return _messages;
- }
-
- public void enqueueForPreDelivery(AMQMessage msg, boolean deliverFirst)
- {
- if (_messages != null)
- {
- if (deliverFirst)
- {
- _messages.pushHead(msg);
- }
- else
- {
- _messages.offer(msg);
- }
- }
- }
-
- public boolean isAutoClose()
- {
- return _autoClose;
- }
-
- public void close()
- {
- boolean closed = false;
- synchronized (_sendLock)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Setting SendLock true:" + debugIdentity());
- }
-
- closed = _sendLock.getAndSet(true);
- }
-
- if (closed)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Called close() on a closed subscription");
- }
-
- return;
- }
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("Closing subscription (" + debugIdentity() + "):" + this);
- }
-
- if (_resendQueue != null && !_resendQueue.isEmpty())
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Requeuing closing subscription (" + debugIdentity() + "):" + this);
- }
- requeue();
- }
-
- //remove references in PDQ
- if (_messages != null)
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Clearing PDQ (" + debugIdentity() + "):" + this);
- }
-
- _messages.clear();
- }
- }
-
- private void autoclose()
- {
- close();
-
- if (_autoClose && !_sentClose)
- {
- _logger.info("Closing autoclose subscription (" + debugIdentity() + "):" + this);
-
- ProtocolOutputConverter converter = protocolSession.getProtocolOutputConverter();
- converter.confirmConsumerAutoClose(channel.getChannelId(), consumerTag);
- _sentClose = true;
-
- //fixme JIRA do this better
- try
- {
- channel.unsubscribeConsumer(protocolSession, consumerTag);
- }
- catch (AMQException e)
- {
- // Occurs if we cannot find the subscriber in the channel with protocolSession and consumerTag.
- }
- }
- }
-
- private void requeue()
- {
- if (_queue != null)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Requeuing :" + _resendQueue.size() + " messages");
- }
-
- while (!_resendQueue.isEmpty())
- {
- AMQMessage resent = _resendQueue.poll();
-
- if (_logger.isTraceEnabled())
- {
- _logger.trace("Removed for resending:" + resent.debugIdentity());
- }
-
- resent.release(_queue);
- _queue.subscriberHasPendingResend(false, this, resent);
-
- try
- {
- channel.getTransactionalContext().deliver(resent, _queue, true);
- }
- catch (AMQException e)
- {
- _logger.error("MESSAGE LOSS : Unable to re-deliver messages", e);
- }
- }
-
- if (!_resendQueue.isEmpty())
- {
- _logger.error("[MESSAGES LOST]Unable to re-deliver messages as queue is null.");
- }
-
- _queue.subscriberHasPendingResend(false, this, null);
- }
- else
- {
- if (!_resendQueue.isEmpty())
- {
- _logger.error("Unable to re-deliver messages as queue is null.");
- }
- }
-
- // Clear the messages
- _resendQueue = null;
- }
-
-
- public boolean isClosed()
- {
- return _sendLock.get(); // This rather than _close is used to signify the subscriber is now closed.
- }
-
- public boolean isBrowser()
- {
- return _isBrowser;
- }
-
- public boolean wouldSuspend(AMQMessage msg)
- {
- return channel.wouldSuspend(msg);
- }
-
- public Queue<AMQMessage> getResendQueue()
- {
- if (_resendQueue == null)
- {
- _resendQueue = new ConcurrentLinkedQueueAtomicSize<AMQMessage>();
- }
- return _resendQueue;
- }
-
-
- public Queue<AMQMessage> getNextQueue(Queue<AMQMessage> messages)
- {
- if (_resendQueue != null && !_resendQueue.isEmpty())
- {
- return _resendQueue;
- }
-
- if (filtersMessages())
- {
- if (isAutoClose())
- {
- if (_messages.isEmpty())
- {
- autoclose();
- return null;
- }
- }
- return _messages;
- }
- else // we want the DM queue
- {
- return messages;
- }
- }
-
- public void addToResendQueue(AMQMessage msg)
- {
- // add to our resend queue
- getResendQueue().add(msg);
-
- // Mark Queue has having content.
- if (_queue == null)
- {
- _logger.error("Queue is null won't be able to resend messages");
- }
- else
- {
- _queue.subscriberHasPendingResend(true, this, msg);
- }
- }
-
- public Object getSendLock()
- {
- return _sendLock;
- }
-
- public AMQChannel getChannel()
- {
- return channel;
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionManager.java
deleted file mode 100644
index 4df88baebc..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionManager.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;
-
-import java.util.List;
-
-/**
- * Abstraction of actor that will determine the subscriber to whom
- * a message will be sent.
- */
-public interface SubscriptionManager
-{
- public List<Subscription> getSubscriptions();
- public boolean hasActiveSubscribers();
- public Subscription nextSubscriber(AMQMessage msg);
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionSet.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionSet.java
deleted file mode 100644
index b500247fa4..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/SubscriptionSet.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.server.queue;
-
-import java.util.List;
-import java.util.ListIterator;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-
-/** Holds a set of subscriptions for a queue and manages the round robin-ing of deliver etc. */
-class SubscriptionSet implements WeightedSubscriptionManager
-{
- private static final Logger _log = Logger.getLogger(SubscriptionSet.class);
-
- /** List of registered subscribers */
- private List<Subscription> _subscriptions = new CopyOnWriteArrayList<Subscription>();
-
- /** Used to control the round robin delivery of content */
- private int _currentSubscriber;
- private final Object _subscriptionsChange = new Object();
-
-
- /** Accessor for unit tests. */
- int getCurrentSubscriber()
- {
- return _currentSubscriber;
- }
-
- public void addSubscriber(Subscription subscription)
- {
- synchronized (_subscriptionsChange)
- {
- _subscriptions.add(subscription);
- }
- }
-
- /**
- * Remove the subscription, returning it if it was found
- *
- * @param subscription
- *
- * @return null if no match was found
- */
- public Subscription removeSubscriber(Subscription subscription)
- {
- // TODO: possibly need O(1) operation here.
-
- Subscription sub = null;
- synchronized (_subscriptionsChange)
- {
- int subIndex = _subscriptions.indexOf(subscription);
-
- if (subIndex != -1)
- {
- //we can't just return the passed in subscription as it is a new object
- // and doesn't contain the stored state we need.
- //NOTE while this may be removed now anyone with an iterator will still have it in the list!!
- sub = _subscriptions.remove(subIndex);
- }
- else
- {
- _log.error("Unable to remove from index(" + subIndex + ")subscription:" + subscription);
- }
- }
- if (sub != null)
- {
- return sub;
- }
- else
- {
- debugDumpSubscription(subscription);
- return null;
- }
- }
-
- private void debugDumpSubscription(Subscription subscription)
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Subscription " + subscription + " not found. Dumping subscriptions:");
- for (Subscription s : _subscriptions)
- {
- _log.debug("Subscription: " + s);
- }
- _log.debug("Subscription dump complete");
- }
- }
-
- /**
- * Return the next unsuspended subscription or null if not found. <p/> Performance note: This method can scan all
- * items twice when looking for a subscription that is not suspended. The worst case occcurs when all subscriptions
- * are suspended. However, it is does this without synchronisation and subscriptions may be added and removed
- * concurrently. Also note that because of race conditions and when subscriptions are removed between calls to
- * nextSubscriber, the IndexOutOfBoundsException also causes the scan to start at the beginning.
- */
- public Subscription nextSubscriber(AMQMessage msg)
- {
- if (_subscriptions.isEmpty())
- {
- return null;
- }
-
- try
- {
- final Subscription result = nextSubscriberImpl(msg);
- if (result == null)
- {
- _currentSubscriber = 0;
- return nextSubscriberImpl(msg);
- }
- else
- {
- return result;
- }
- }
- catch (IndexOutOfBoundsException e)
- {
- _currentSubscriber = 0;
- return nextSubscriber(msg);
- }
- }
-
- private Subscription nextSubscriberImpl(AMQMessage msg)
- {
- final ListIterator<Subscription> iterator = _subscriptions.listIterator(_currentSubscriber);
- while (iterator.hasNext())
- {
- Subscription subscription = iterator.next();
- ++_currentSubscriber;
- subscriberScanned();
-
- if (!(subscription.isSuspended() || subscription.wouldSuspend(msg)))
- {
- if (subscription.hasInterest(msg))
- {
- // if the queue is not empty then this client is ready to receive a message.
- //FIXME the queue could be full of sent messages.
- // Either need to clean all PDQs after sending a message
- // OR have a clean up thread that runs the PDQs expunging the messages.
- if (!subscription.filtersMessages() || subscription.getPreDeliveryQueue().isEmpty())
- {
- return subscription;
- }
- }
- }
- }
-
- return null;
- }
-
- /** Overridden in test classes. */
- protected void subscriberScanned()
- {
- }
-
- public boolean isEmpty()
- {
- return _subscriptions.isEmpty();
- }
-
- public List<Subscription> getSubscriptions()
- {
- return _subscriptions;
- }
-
- public boolean hasActiveSubscribers()
- {
- for (Subscription s : _subscriptions)
- {
- if (!s.isSuspended())
- {
- return true;
- }
- }
- return false;
- }
-
- public int getWeight()
- {
- int count = 0;
- for (Subscription s : _subscriptions)
- {
- if (!s.isSuspended())
- {
- count++;
- }
- }
- return count;
- }
-
- /**
- * Notification that a queue has been deleted. This is called so that the subscription can inform the channel, which
- * in turn can update its list of unacknowledged messages.
- *
- * @param queue
- */
- public void queueDeleted(AMQQueue queue) throws AMQException
- {
- for (Subscription s : _subscriptions)
- {
- s.queueDeleted(queue);
- }
- }
-
- int size()
- {
- return _subscriptions.size();
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.java
deleted file mode 100644
index 79ee6b93a3..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/TransientMessageData.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.server.queue;
-
-import java.util.LinkedList;
-import java.util.List;
-
-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 = new LinkedList<AMQQueue>();
-
- public MessagePublishInfo getMessagePublishInfo()
- {
- return _messagePublishInfo;
- }
-
- public void setMessagePublishInfo(MessagePublishInfo messagePublishInfo)
- {
- _messagePublishInfo = messagePublishInfo;
- }
-
- public List<AMQQueue> getDestinationQueues()
- {
- return _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)
- {
- _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/Final/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.java
deleted file mode 100644
index 373a64e2eb..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/WeakReferenceMessageHandle.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 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.BasicContentHeaderProperties;
-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 long _arrivalTime;
-
-
- public WeakReferenceMessageHandle(MessageStore messageStore)
- {
- _messageStore = messageStore;
- }
-
- public ContentHeaderBody getContentHeaderBody(StoreContext context, Long messageId) throws AMQException
- {
- ContentHeaderBody chb = (_contentHeaderBody != null ? _contentHeaderBody.get() : null);
- if (chb == null)
- {
- MessageMetaData mmd = loadMessageMetaData(context, messageId);
- chb = mmd.getContentHeaderBody();
- }
- return chb;
- }
-
- private MessageMetaData loadMessageMetaData(StoreContext context, Long messageId)
- 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, Long messageId) 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, Long messageId) throws AMQException
- {
- return getContentHeaderBody(context, messageId).bodySize;
- }
-
- public ContentChunk getContentChunk(StoreContext context, Long messageId, 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 messageId
- * @param contentChunk
- * @param isLastContentBody
- * @throws AMQException
- */
- public void addContentBodyFrame(StoreContext storeContext, Long messageId, 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, Long messageId) throws AMQException
- {
- MessagePublishInfo bpb = (_messagePublishInfo != null ? _messagePublishInfo.get() : null);
- if (bpb == null)
- {
- MessageMetaData mmd = loadMessageMetaData(context, messageId);
-
- bpb = mmd.getMessagePublishInfo();
- }
- return bpb;
- }
-
- public boolean isRedelivered()
- {
- return _redelivered;
- }
-
- public void setRedelivered(boolean redelivered)
- {
- _redelivered = redelivered;
- }
-
- public boolean isPersistent(StoreContext context, Long messageId) throws AMQException
- {
- //todo remove literal values to a constant file such as AMQConstants in common
- ContentHeaderBody chb = getContentHeaderBody(context, messageId);
- return chb.properties instanceof BasicContentHeaderProperties &&
- ((BasicContentHeaderProperties) chb.properties).getDeliveryMode() == 2;
- }
-
- /**
- * This is called when all the content has been received.
- *
- * @param publishBody
- * @param contentHeaderBody
- * @throws AMQException
- */
- public void setPublishAndContentHeaderBody(StoreContext storeContext, Long messageId, 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, Long messageId) throws AMQException
- {
- _messageStore.removeMessage(storeContext, messageId);
- }
-
- public void enqueue(StoreContext storeContext, Long messageId, AMQQueue queue) throws AMQException
- {
- _messageStore.enqueueMessage(storeContext, queue.getName(), messageId);
- }
-
- public void dequeue(StoreContext storeContext, Long messageId, AMQQueue queue) throws AMQException
- {
- _messageStore.dequeueMessage(storeContext, queue.getName(), messageId);
- }
-
- public long getArrivalTime()
- {
- return _arrivalTime;
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/WeightedSubscriptionManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/queue/WeightedSubscriptionManager.java
deleted file mode 100644
index 6c71571807..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/queue/WeightedSubscriptionManager.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;
-
-public interface WeightedSubscriptionManager extends SubscriptionManager
-{
- public int getWeight();
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.java
deleted file mode 100644
index 22fa0fab23..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/registry/ApplicationRegistry.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.registry;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-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;
-
-/**
- * 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
-{
- private 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;
-
- static
- {
- Runtime.getRuntime().addShutdownHook(new Thread(new ShutdownService()));
- }
-
- private static class ShutdownService implements Runnable
- {
- public void run()
- {
- _logger.info("Shutting down application registries...");
- try
- {
- synchronized (ApplicationRegistry.class)
- {
- Iterator<IApplicationRegistry> keyIterator = _instanceMap.values().iterator();
-
- while (keyIterator.hasNext())
- {
- IApplicationRegistry instance = keyIterator.next();
-
- instance.close();
- }
- }
- }
- catch (Exception e)
- {
- _logger.error("Error shutting down message store: " + e, e);
- }
- }
- }
-
- 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);
- }
- }
-
- public static void remove(int instanceID)
- {
- try
- {
- _instanceMap.get(instanceID).close();
- }
- catch (Exception e)
- {
-
- }
- finally
- {
- _instanceMap.remove(instanceID);
- }
- }
-
-
- 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
- {
- for(VirtualHost virtualHost : getVirtualHostRegistry().getVirtualHosts())
- {
- virtualHost.close();
- }
-
- // close the rmi registry(if any) started for management
- if (getInstance().getManagedObjectRegistry() != null)
- {
- getInstance().getManagedObjectRegistry().close();
- }
- }
-
- public Configuration getConfiguration()
- {
- return _configuration;
- }
-
- 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;
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.java
deleted file mode 100644
index 1cca259a8d..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/registry/ConfigurationFileApplicationRegistry.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.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.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.AccessManager;
-import org.apache.qpid.server.security.access.AccessManagerImpl;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-import org.apache.qpid.AMQException;
-
-public class ConfigurationFileApplicationRegistry extends ApplicationRegistry
-{
-
- private ManagedObjectRegistry _managedObjectRegistry;
-
- private AuthenticationManager _authenticationManager;
-
- private AccessManager _accessManager;
-
- private PrincipalDatabaseManager _databaseManager;
-
- private VirtualHostRegistry _virtualHostRegistry;
-
-
- private final Map<String, VirtualHost> _virtualHosts = new ConcurrentHashMap<String, VirtualHost>();
-
-
- 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 = new AccessManagerImpl("default", _configuration);
-
- _databaseManager = new ConfigurationFilePrincipalDatabaseManager();
-
- _authenticationManager = new PrincipalDatabaseAuthenticationManager(null, null);
-
- _databaseManager.initialiseManagement(_configuration);
-
- _managedObjectRegistry.start();
-
- 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 VirtualHostRegistry getVirtualHostRegistry()
- {
- return _virtualHostRegistry;
- }
-
- public AccessManager getAccessManager()
- {
- return _accessManager;
- }
-
- public ManagedObjectRegistry getManagedObjectRegistry()
- {
- return _managedObjectRegistry;
- }
-
- public PrincipalDatabaseManager getDatabaseManager()
- {
- return _databaseManager;
- }
-
- public AuthenticationManager getAuthenticationManager()
- {
- return _authenticationManager;
- }
-
- public Collection<String> getVirtualHostNames()
- {
- return getConfiguration().getList("virtualhosts.virtualhost.name");
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.java
deleted file mode 100644
index 5a48431288..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/registry/IApplicationRegistry.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.registry;
-
-import java.util.Collection;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.qpid.server.management.ManagedObjectRegistry;
-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.AccessManager;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-
-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;
-
- 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();
-
- AccessManager getAccessManager();
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AMQUserManagementMBean.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AMQUserManagementMBean.java
deleted file mode 100644
index 2dc7fcbc1e..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AMQUserManagementMBean.java
+++ /dev/null
@@ -1,467 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.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.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);
-
- // 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/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessManager.java
deleted file mode 100644
index d70a6dc8f4..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessManager.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.access;
-
-import java.security.Principal;
-
-public interface AccessManager
-{
- AccessResult isAuthorized(Accessable accessObject, Principal username, AccessRights.Rights rights);
-
- @Deprecated
- AccessResult isAuthorized(Accessable accessObject, String username);
-
- String getName();
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessManagerImpl.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessManagerImpl.java
deleted file mode 100644
index 35d036d20f..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessManagerImpl.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.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.auth.sasl.UsernamePrincipal;
-import org.apache.qpid.configuration.PropertyUtils;
-import org.apache.log4j.Logger;
-
-import java.util.List;
-import java.lang.reflect.Method;
-import java.security.Principal;
-
-public class AccessManagerImpl implements AccessManager
-{
- private static final Logger _logger = Logger.getLogger(AccessManagerImpl.class);
-
- AccessManager _accessManager;
-
- public AccessManagerImpl(String name, Configuration hostConfig) throws ConfigurationException
- {
- if (hostConfig == null)
- {
- _logger.warn("No Configuration specified. Using default access controls for VirtualHost:'" + name + "'");
- return;
- }
-
- String accessClass = hostConfig.getString("security.access.class");
- if (accessClass == null)
- {
- _logger.warn("No access control specified. Using default access controls for VirtualHost:'" + name + "'");
- return;
- }
-
- Object o;
- try
- {
- o = Class.forName(accessClass).newInstance();
- }
- catch (Exception e)
- {
- throw new ConfigurationException("Error initialising access control: " + e, e);
- }
-
- if (!(o instanceof AccessManager))
- {
- throw new ConfigurationException("Access control must implement the VirtualHostAccess interface");
- }
-
- initialiseAccessControl((AccessManager) o, hostConfig);
-
- _accessManager = (AccessManager) o;
-
- _logger.info("Initialised access control for virtualhost '" + name + "' successfully");
-
- }
-
-
- private void initialiseAccessControl(AccessManager accessManager, Configuration config)
- throws ConfigurationException
- {
- 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;
- }
- }
- }
-
- public AccessResult isAuthorized(Accessable accessObject, String username)
- {
- return isAuthorized(accessObject, new UsernamePrincipal(username), AccessRights.Rights.READ);
- }
-
- public AccessResult isAuthorized(Accessable accessObject, Principal user, AccessRights.Rights rights)
- {
- if (_accessManager == null)
- {
- if (ApplicationRegistry.getInstance().getAccessManager() == this)
- {
- _logger.warn("No Default access manager specified DENYING ALL ACCESS");
- return new AccessResult(this, AccessResult.AccessStatus.REFUSED);
- }
- else
- {
- return ApplicationRegistry.getInstance().getAccessManager().isAuthorized(accessObject, user, rights);
- }
- }
- else
- {
- return _accessManager.isAuthorized(accessObject, user, rights);
- }
- }
-
- public String getName()
- {
- return "AccessManagerImpl";
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessResult.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessResult.java
deleted file mode 100644
index b8d8fc605a..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessResult.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.access;
-
-public class AccessResult
-{
- public enum AccessStatus
- {
- GRANTED, REFUSED
- }
-
- StringBuilder _authorizer;
- AccessStatus _status;
-
- public AccessResult(AccessManager authorizer, AccessStatus status)
- {
- _status = status;
- _authorizer = new StringBuilder(authorizer.getName());
- }
-
- public void setAuthorizer(AccessManager authorizer)
- {
- _authorizer.append(authorizer.getName());
- }
-
- public String getAuthorizer()
- {
- return _authorizer.toString();
- }
-
- public void setStatus(AccessStatus status)
- {
- _status = status;
- }
-
- public AccessStatus getStatus()
- {
- return _status;
- }
-
- public void addAuthorizer(AccessManager accessManager)
- {
- _authorizer.insert(0, "->");
- _authorizer.insert(0, accessManager.getName());
- }
-
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessRights.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AccessRights.java
deleted file mode 100644
index 1b79a5a0e0..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/Accessable.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/Accessable.java
deleted file mode 100644
index f51cf24caa..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AllowAll.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AllowAll.java
deleted file mode 100644
index 1ddca3a64e..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/AllowAll.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.security.access;
-
-import java.security.Principal;
-
-public class AllowAll implements AccessManager
-{
-
- public AccessResult isAuthorized(Accessable accessObject, Principal username, AccessRights.Rights rights)
- {
- return new AccessResult(this, AccessResult.AccessStatus.GRANTED);
- }
-
- public AccessResult isAuthorized(Accessable accessObject, String username)
- {
- return new AccessResult(this, AccessResult.AccessStatus.GRANTED);
- }
-
- public String getName()
- {
- return "AllowAll";
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/DenyAll.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/DenyAll.java
deleted file mode 100644
index bf40eeba4e..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/DenyAll.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.security.access;
-
-import java.security.Principal;
-
-public class DenyAll implements AccessManager
-{
- public AccessResult isAuthorized(Accessable accessObject, Principal username, AccessRights.Rights rights)
- {
- return new AccessResult(this, AccessResult.AccessStatus.REFUSED);
- }
-
- public AccessResult isAuthorized(Accessable accessObject, String username)
- {
- return new AccessResult(this, AccessResult.AccessStatus.REFUSED);
- }
-
- public String getName()
- {
- return "DenyAll";
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/FileAccessManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/FileAccessManager.java
deleted file mode 100644
index 291bc714ed..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/FileAccessManager.java
+++ /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.
- *
- *
- */
-package org.apache.qpid.server.security.access;
-
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
-import org.apache.log4j.Logger;
-
-import java.io.IOException;
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.FileNotFoundException;
-import java.io.File;
-import java.util.regex.Pattern;
-import java.security.Principal;
-
-/**
- * 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 FileAccessManager implements AccessManager
-{
- private static final Logger _logger = Logger.getLogger(FileAccessManager.class);
-
- protected File _accessFile;
-
- protected Pattern _regexp = Pattern.compile(":");
-
- private static final short USER_INDEX = 0;
- private static final short VIRTUALHOST_INDEX = 1;
-
- public void setAccessFile(String accessFile) throws FileNotFoundException
- {
- File f = new File(accessFile);
- _logger.info("FileAccessManager using file " + f.getAbsolutePath());
- _accessFile = f;
- if (!f.exists())
- {
- throw new FileNotFoundException("Cannot find access file " + f);
- }
- if (!f.canRead())
- {
- throw new FileNotFoundException("Cannot read access file " + f +
- ". Check permissions.");
- }
- }
-
- /**
- * Looks up the virtual hosts for a specified user in the access file.
- *
- * @param user The user to lookup
- *
- * @return a list of virtualhosts
- */
- private VirtualHostAccess[] lookupVirtualHost(String user)
- {
- String[] results = lookup(user, VIRTUALHOST_INDEX);
- VirtualHostAccess vhosts[] = new VirtualHostAccess[results.length];
-
- for (int index = 0; index < results.length; index++)
- {
- vhosts[index] = new VirtualHostAccess(results[index]);
- }
-
- return vhosts;
- }
-
-
- private String[] lookup(String user, int index)
- {
- try
- {
- BufferedReader reader = null;
- try
- {
- reader = new BufferedReader(new FileReader(_accessFile));
- String line;
-
- while ((line = reader.readLine()) != null)
- {
- String[] result = _regexp.split(line);
- if (result == null || result.length < (index + 1))
- {
- continue;
- }
-
- if (user.equals(result[USER_INDEX]))
- {
- return result[index].split(",");
- }
- }
- return null;
- }
- finally
- {
- if (reader != null)
- {
- reader.close();
- }
- }
- }
- catch (IOException ioe)
- {
- //ignore
- }
- return null;
- }
-
- public AccessResult isAuthorized(Accessable accessObject, String username)
- {
- return isAuthorized(accessObject, new UsernamePrincipal(username), AccessRights.Rights.READ);
- }
-
- public AccessResult isAuthorized(Accessable accessObject, Principal user, AccessRights.Rights rights)
- {
- if (accessObject instanceof VirtualHost)
- {
- VirtualHostAccess[] hosts = lookupVirtualHost(user.getName());
-
- if (hosts != null)
- {
- for (VirtualHostAccess host : hosts)
- {
- if (accessObject.getAccessableName().equals(host.getVirtualHost()))
- {
- if (host.getAccessRights().allows(rights))
- {
- return new AccessResult(this, AccessResult.AccessStatus.GRANTED);
- }
- else
- {
- return new AccessResult(this, AccessResult.AccessStatus.REFUSED);
- }
- }
- }
- }
- }
-// else if (accessObject instanceof AMQQueue)
-// {
-// String[] queues = lookupQueue(username, ((AMQQueue) accessObject).getVirtualHost());
-//
-// if (queues != null)
-// {
-// for (String queue : queues)
-// {
-// if (accessObject.getAccessableName().equals(queue))
-// {
-// return new AccessResult(this, AccessResult.AccessStatus.GRANTED);
-// }
-// }
-// }
-// }
-
- return new AccessResult(this, AccessResult.AccessStatus.REFUSED);
- }
-
- public String getName()
- {
- return "FileAccessManager";
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/PrincipalDatabaseAccessManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/PrincipalDatabaseAccessManager.java
deleted file mode 100644
index 6ccadb2e7d..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/PrincipalDatabaseAccessManager.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.security.access;
-
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.security.auth.database.PrincipalDatabase;
-import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
-import org.apache.log4j.Logger;
-
-import java.security.Principal;
-
-public class PrincipalDatabaseAccessManager implements AccessManager
-{
- private static final Logger _logger = Logger.getLogger(PrincipalDatabaseAccessManager.class);
-
- PrincipalDatabase _database;
- AccessManager _default;
-
- public PrincipalDatabaseAccessManager()
- {
- _default = null;
- }
-
- public void setDefaultAccessManager(String defaultAM)
- {
- if (defaultAM.equals("AllowAll"))
- {
- _default = new AllowAll();
- }
-
- if (defaultAM.equals("DenyAll"))
- {
- _default = new DenyAll();
- }
- }
-
- public void setPrincipalDatabase(String database)
- {
- _database = ApplicationRegistry.getInstance().getDatabaseManager().getDatabases().get(database);
- if (!(_database instanceof AccessManager))
- {
- _logger.warn("Database '" + database + "' cannot perform access management");
- }
- }
-
-
- public AccessResult isAuthorized(Accessable accessObject, String username)
- {
- return isAuthorized(accessObject, new UsernamePrincipal(username), AccessRights.Rights.READ);
- }
-
- public AccessResult isAuthorized(Accessable accessObject, Principal username, AccessRights.Rights rights)
- {
- AccessResult result;
-
- if (_database == null)
- {
- if (_default != null)
- {
- result = _default.isAuthorized(accessObject, username, rights);
- }
- else
- {
- throw new RuntimeException("Principal Database and default Access Manager are both null unable to perform Access Control");
- }
- }
- else
- {
- if (!(_database instanceof AccessManager))
- {
- _logger.warn("Specified PrincipalDatabase is not an AccessManager so using default AccessManager");
- result = _default.isAuthorized(accessObject, username, rights);
- }
- else
- {
- result = ((AccessManager) _database).isAuthorized(accessObject, username, rights);
- }
- }
-
- result.addAuthorizer(this);
-
- return result;
- }
-
- public String getName()
- {
- return "PrincipalDatabaseFileAccessManager";
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/UserManagement.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/UserManagement.java
deleted file mode 100644
index b8762aa43b..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/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;
-
-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/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/VirtualHostAccess.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/access/VirtualHostAccess.java
deleted file mode 100644
index 13151a66b8..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.java
deleted file mode 100644
index 0e3aea4de0..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/AuthenticationResult.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;
-
-public class AuthenticationResult
-{
- public enum AuthenticationStatus
- {
- SUCCESS, CONTINUE, ERROR
- }
-
- public AuthenticationStatus status;
- public byte[] challenge;
-
- public AuthenticationResult(byte[] challenge, AuthenticationStatus status)
- {
- this.status = status;
- this.challenge = challenge;
- }
-
- public AuthenticationResult(AuthenticationStatus status)
- {
- this.status = status;
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java
deleted file mode 100644
index 10adfdd9fc..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/Base64MD5PasswordFilePrincipalDatabase.java
+++ /dev/null
@@ -1,599 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.crammd5.CRAMMD5HashedInitialiser;
-import org.apache.qpid.server.security.access.AMQUserManagementMBean;
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.codec.EncoderException;
-
-import javax.security.auth.callback.PasswordCallback;
-import javax.security.auth.login.AccountNotFoundException;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.UnsupportedEncodingException;
-import java.io.PrintStream;
-import java.util.regex.Pattern;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.List;
-import java.util.LinkedList;
-import java.util.concurrent.locks.ReentrantLock;
-import java.security.Principal;
-import java.security.NoSuchAlgorithmException;
-import java.security.MessageDigest;
-
-/**
- * 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;
- private static final String DEFAULT_ENCODING = "utf-8";
- private Map<String, User> _users = new HashMap<String, User>();
- 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
- *
- * @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);
-
- int index = 0;
- boolean verified = true;
-
- while (verified & index < password.length)
- {
- verified = (pwd[index] == password[index]);
- index++;
- }
- return verified;
- }
-
- public boolean updatePassword(Principal principal, char[] password) throws AccountNotFoundException
- {
- User 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;
- }
-
- User user = new User(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
- {
- User 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)
- {
- User 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;
- }
-
- User user = new User(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));
- continue;
- }
-
- User 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.getEncodePassword();
-
- 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 (User user : _users.values())
- {
- if (user.isModified())
- {
- byte[] encodedPassword;
- try
- {
- encodedPassword = user.getEncodePassword();
- 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();
- }
- }
- }
-
- private class User implements Principal
- {
- String _name;
- char[] _password;
- byte[] _encodedPassword = null;
- private boolean _modified = false;
- private boolean _deleted = false;
-
- User(String[] data) throws UnsupportedEncodingException
- {
- if (data.length != 2)
- {
- throw new IllegalArgumentException("User Data should be lenght 2, username, password");
- }
-
- _name = data[0];
-
- byte[] encoded_password = data[1].getBytes(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 User(String name, char[] password)
- {
- _name = name;
- setPassword(password);
- }
-
- public String getName()
- {
- return _name;
- }
-
- public String toString()
- {
- if (_logger.isDebugEnabled())
- {
- return getName() + ((_encodedPassword == null) ? "" : ":" + new String(_encodedPassword));
- }
- else
- {
- return _name;
- }
- }
-
- char[] getPassword()
- {
- return _password;
- }
-
- void setPassword(char[] password)
- {
- _password = password;
- _modified = true;
- _encodedPassword = null;
- }
-
-
- byte[] getEncodePassword() 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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.java
deleted file mode 100644
index 2d3f5e5131..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/ConfigurationFilePrincipalDatabaseManager.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.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.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() throws Exception
- {
- _logger.info("Initialising PrincipleDatabase authentication manager");
- _databases = initialisePrincipalDatabases();
- }
-
- private Map<String, PrincipalDatabase> initialisePrincipalDatabases() throws Exception
- {
- Configuration config = ApplicationRegistry.getInstance().getConfiguration();
- List<String> databaseNames = config.getList(_base + ".name");
- List<String> databaseClasses = config.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, config, 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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordFilePrincipalDatabase.java
deleted file mode 100644
index 352d41a0ba..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordVhostFilePrincipalDatabase.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordVhostFilePrincipalDatabase.java
deleted file mode 100644
index 5c372f6c2c..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PlainPasswordVhostFilePrincipalDatabase.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.server.security.auth.database;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.security.access.AccessManager;
-import org.apache.qpid.server.security.access.AccessResult;
-import org.apache.qpid.server.security.access.AccessRights;
-import org.apache.qpid.server.security.access.Accessable;
-import org.apache.qpid.server.security.auth.sasl.UsernamePrincipal;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.io.BufferedReader;
-import java.io.FileReader;
-import java.io.IOException;
-import java.security.Principal;
-
-/**
- * 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 PlainPasswordVhostFilePrincipalDatabase extends PlainPasswordFilePrincipalDatabase implements AccessManager
-{
- private static final Logger _logger = Logger.getLogger(PlainPasswordVhostFilePrincipalDatabase.class);
-
- /**
- * Looks up the virtual hosts for a specified user in the password file.
- *
- * @param user The user to lookup
- *
- * @return a list of virtualhosts
- */
- private String[] lookupVirtualHost(String user)
- {
- try
- {
- 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 < 3)
- {
- continue;
- }
-
- if (user.equals(result[0]))
- {
- return result[2].split(",");
- }
- }
- }
- return null;
- }
- finally
- {
- if (reader != null)
- {
- reader.close();
- }
- }
- }
- catch (IOException ioe)
- {
- //ignore
- }
- return null;
- }
-
-
- public AccessResult isAuthorized(Accessable accessObject, String username)
- {
- return isAuthorized(accessObject, new UsernamePrincipal(username), AccessRights.Rights.READ);
- }
-
- public AccessResult isAuthorized(Accessable accessObject, Principal user, AccessRights.Rights rights)
- {
-
- if (accessObject instanceof VirtualHost)
- {
- String[] hosts = lookupVirtualHost(user.getName());
-
- if (hosts != null)
- {
- for (String host : hosts)
- {
- if (accessObject.getAccessableName().equals(host))
- {
- return new AccessResult(this, AccessResult.AccessStatus.GRANTED);
- }
- }
- }
- }
-
- return new AccessResult(this, AccessResult.AccessStatus.REFUSED);
- }
-
- public String getName()
- {
- return "PlainPasswordVhostFile";
- }
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabase.java
deleted file mode 100644
index a82f9ed40b..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PrincipalDatabaseManager.java
deleted file mode 100644
index 2c553ae76a..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabase.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabase.java
deleted file mode 100644
index 73d58ca489..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabase.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.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");
- }
- char[] pwd = _users.getProperty(principal.getName()).toCharArray();
- 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
- {
- //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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/database/PropertiesPrincipalDatabaseManager.java
deleted file mode 100644
index 6b86a46bd2..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.java
deleted file mode 100644
index bb94e0b7bf..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/AuthenticationManager.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.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);
-
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.java
deleted file mode 100644
index ce5e0cd748..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/manager/PrincipalDatabaseAuthenticationManager.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.server.security.auth.manager;
-
-import org.apache.log4j.Logger;
-import org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.ConfigurationException;
-import org.apache.commons.configuration.SubsetConfiguration;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-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;
-
- 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)
- {
-
- if (hostConfig instanceof SubsetConfiguration)
- {
- _logger.warn("No authentication specified for '" + ((SubsetConfiguration) hostConfig).getPrefix() + "'. Using Default authentication manager");
- }
- else
- {
- _logger.warn("No authentication specified. Using Default authentication manager");
- }
- _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(providerMap), 1) == -1)
- {
- _logger.warn("Unable to set order of providers.");
- }
- }
- 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);
- }
- }
-
- public AuthenticationResult isAuthorize(VirtualHost vhost, String username)
- {
- return new AuthenticationResult(AuthenticationResult.AuthenticationStatus.ERROR);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/AuthenticationProviderInitialiser.java
deleted file mode 100644
index 89e545d6f5..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/JCAProvider.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/JCAProvider.java
deleted file mode 100644
index fd4ad86055..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/JCAProvider.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.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(Map<String, Class<? extends SaslServerFactory>> 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<? extends SaslServerFactory>> providerMap)
- {
- for (Map.Entry<String, Class<? extends SaslServerFactory>> me :
- providerMap.entrySet())
- {
- put("SaslServerFactory." + me.getKey(), me.getValue().getName());
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePasswordInitialiser.java
deleted file mode 100644
index dd0bd096c3..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePrincipal.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/UsernamePrincipal.java
deleted file mode 100644
index d7c8383690..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainInitialiser.java
deleted file mode 100644
index 7acc6322d1..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.java
deleted file mode 100644
index 7842f376fb..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServer.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.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");
- passwordCb.setPassword(pwd.toCharArray());
- AuthorizeCallback authzCb = new AuthorizeCallback(username, username);
- Callback[] callbacks = new Callback[]{nameCb, passwordCb, authzCb};
- _cbh.handle(callbacks);
- _complete = true;
- if (authzCb.isAuthorized())
- {
- _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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/amqplain/AmqPlainSaslServerFactory.java
deleted file mode 100644
index 67d20136bf..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedInitialiser.java
deleted file mode 100644
index 97f9a4e91a..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedSaslServer.java
deleted file mode 100644
index f6cab084ea..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5HashedServerFactory.java
deleted file mode 100644
index 5298b5cc63..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/crammd5/CRAMMD5Initialiser.java
deleted file mode 100644
index 264832888d..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainInitialiser.java
deleted file mode 100644
index 1d16cd8755..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.java
deleted file mode 100644
index 36aeb77fe1..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServer.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.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);
- // 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...
- int passwordLen = response.length - authcidNullPosition - 1;
- String pwd = new String(response, authcidNullPosition + 1, passwordLen, "utf8");
- passwordCb.setPassword(pwd.toCharArray());
- AuthorizeCallback authzCb = new AuthorizeCallback(authzid, authzid);
- Callback[] callbacks = new Callback[]{nameCb, passwordCb, authzCb};
- _cbh.handle(callbacks);
- _complete = true;
- if (authzCb.isAuthorized())
- {
- _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/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java b/Final/java/broker/src/main/java/org/apache/qpid/server/security/auth/sasl/plain/PlainSaslServerFactory.java
deleted file mode 100644
index f0dd9eeb6d..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/state/AMQState.java b/Final/java/broker/src/main/java/org/apache/qpid/server/state/AMQState.java
deleted file mode 100644
index f427cc7206..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java b/Final/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.java
deleted file mode 100644
index f96900d0a9..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/state/AMQStateManager.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.
- *
- */
-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.framing.AMQMethodBody;
-import org.apache.qpid.framing.BasicAckBody;
-import org.apache.qpid.framing.BasicCancelBody;
-import org.apache.qpid.framing.BasicConsumeBody;
-import org.apache.qpid.framing.BasicGetBody;
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.BasicQosBody;
-import org.apache.qpid.framing.BasicRecoverBody;
-import org.apache.qpid.framing.BasicRejectBody;
-import org.apache.qpid.framing.ChannelCloseBody;
-import org.apache.qpid.framing.ChannelCloseOkBody;
-import org.apache.qpid.framing.ChannelFlowBody;
-import org.apache.qpid.framing.ChannelOpenBody;
-import org.apache.qpid.framing.ConnectionCloseBody;
-import org.apache.qpid.framing.ConnectionCloseOkBody;
-import org.apache.qpid.framing.ConnectionOpenBody;
-import org.apache.qpid.framing.ConnectionSecureOkBody;
-import org.apache.qpid.framing.ConnectionStartOkBody;
-import org.apache.qpid.framing.ConnectionTuneOkBody;
-import org.apache.qpid.framing.ExchangeBoundBody;
-import org.apache.qpid.framing.ExchangeDeclareBody;
-import org.apache.qpid.framing.ExchangeDeleteBody;
-import org.apache.qpid.framing.QueueBindBody;
-import org.apache.qpid.framing.QueueDeclareBody;
-import org.apache.qpid.framing.QueueDeleteBody;
-import org.apache.qpid.framing.QueuePurgeBody;
-import org.apache.qpid.framing.TxCommitBody;
-import org.apache.qpid.framing.TxRollbackBody;
-import org.apache.qpid.framing.TxSelectBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.protocol.AMQMethodListener;
-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)
- {
- this(AMQState.CONNECTION_NOT_STARTED, true, virtualHostRegistry, protocolSession);
- }
-
- protected AMQStateManager(AMQState initial, boolean register, VirtualHostRegistry virtualHostRegistry,
- AMQProtocolSession protocolSession)
- {
- _virtualHostRegistry = virtualHostRegistry;
- _protocolSession = protocolSession;
- _currentState = initial;
- if (register)
- {
- registerListeners();
- }
- }
-
- protected void registerListeners()
- {
- Map<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>> frame2handlerMap;
-
- frame2handlerMap = new HashMap<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>();
- frame2handlerMap.put(ConnectionStartOkBody.class, ConnectionStartOkMethodHandler.getInstance());
- _state2HandlersMap.put(AMQState.CONNECTION_NOT_STARTED, frame2handlerMap);
-
- frame2handlerMap = new HashMap<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>();
- frame2handlerMap.put(ConnectionSecureOkBody.class, ConnectionSecureOkMethodHandler.getInstance());
- _state2HandlersMap.put(AMQState.CONNECTION_NOT_AUTH, frame2handlerMap);
-
- frame2handlerMap = new HashMap<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>();
- frame2handlerMap.put(ConnectionTuneOkBody.class, ConnectionTuneOkMethodHandler.getInstance());
- _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>>();
- frame2handlerMap.put(ChannelOpenBody.class, ChannelOpenHandler.getInstance());
- frame2handlerMap.put(ChannelCloseBody.class, ChannelCloseHandler.getInstance());
- frame2handlerMap.put(ChannelCloseOkBody.class, ChannelCloseOkHandler.getInstance());
- frame2handlerMap.put(ConnectionCloseBody.class, ConnectionCloseMethodHandler.getInstance());
- frame2handlerMap.put(ExchangeDeclareBody.class, ExchangeDeclareHandler.getInstance());
- frame2handlerMap.put(ExchangeDeleteBody.class, ExchangeDeleteHandler.getInstance());
- frame2handlerMap.put(ExchangeBoundBody.class, ExchangeBoundHandler.getInstance());
- frame2handlerMap.put(BasicAckBody.class, BasicAckMethodHandler.getInstance());
- frame2handlerMap.put(BasicRecoverBody.class, BasicRecoverMethodHandler.getInstance());
- frame2handlerMap.put(BasicConsumeBody.class, BasicConsumeMethodHandler.getInstance());
- frame2handlerMap.put(BasicGetBody.class, BasicGetMethodHandler.getInstance());
- frame2handlerMap.put(BasicCancelBody.class, BasicCancelMethodHandler.getInstance());
- frame2handlerMap.put(BasicPublishBody.class, BasicPublishMethodHandler.getInstance());
- frame2handlerMap.put(BasicQosBody.class, BasicQosHandler.getInstance());
- frame2handlerMap.put(QueueBindBody.class, QueueBindHandler.getInstance());
- frame2handlerMap.put(QueueDeclareBody.class, QueueDeclareHandler.getInstance());
- frame2handlerMap.put(QueueDeleteBody.class, QueueDeleteHandler.getInstance());
- frame2handlerMap.put(QueuePurgeBody.class, QueuePurgeHandler.getInstance());
- frame2handlerMap.put(ChannelFlowBody.class, ChannelFlowHandler.getInstance());
- frame2handlerMap.put(TxSelectBody.class, TxSelectHandler.getInstance());
- frame2handlerMap.put(TxCommitBody.class, TxCommitHandler.getInstance());
- frame2handlerMap.put(TxRollbackBody.class, TxRollbackHandler.getInstance());
- frame2handlerMap.put(BasicRejectBody.class, BasicRejectMethodHandler.getInstance());
-
- _state2HandlersMap.put(AMQState.CONNECTION_OPEN, frame2handlerMap);
-
- frame2handlerMap = new HashMap<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>();
- frame2handlerMap.put(ConnectionCloseOkBody.class, ConnectionCloseOkMethodHandler.getInstance());
- _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
- {
- StateAwareMethodListener<B> handler = findStateTransitionHandler(_currentState, evt.getMethod());
- if (handler != null)
- {
-
- checkChannel(evt, _protocolSession);
-
- handler.methodReceived(this, evt);
-
- return true;
- }
-
- return false;
- }
-
- 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/Final/java/broker/src/main/java/org/apache/qpid/server/state/IllegalStateTransitionException.java b/Final/java/broker/src/main/java/org/apache/qpid/server/state/IllegalStateTransitionException.java
deleted file mode 100644
index cec67a8a6d..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/state/StateAwareMethodListener.java b/Final/java/broker/src/main/java/org/apache/qpid/server/state/StateAwareMethodListener.java
deleted file mode 100644
index e3af0bc486..0000000000
--- a/Final/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, AMQMethodEvent<B> evt) throws AMQException;
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/state/StateListener.java b/Final/java/broker/src/main/java/org/apache/qpid/server/state/StateListener.java
deleted file mode 100644
index 00fc09867b..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java b/Final/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.java
deleted file mode 100644
index 8ccb0be0a8..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/store/MemoryMessageStore.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.store;
-
-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.AtomicLong;
-
-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.AMQQueue;
-import org.apache.qpid.server.queue.MessageMetaData;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.exchange.Exchange;
-
-/**
- * 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);
-
- 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
- {
- if (_metaDataMap != null)
- {
- _metaDataMap.clear();
- _metaDataMap = null;
- }
- if (_contentBodyMap != null)
- {
- _contentBodyMap.clear();
- _contentBodyMap = null;
- }
- }
-
- public void removeMessage(StoreContext context, Long messageId)
- {
- 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 required to do anything
- }
-
- public void removeQueue(AMQShortString name) throws AMQException
- {
- // Not required to do anything
- }
-
- public void enqueueMessage(StoreContext context, AMQShortString name, Long messageId) throws AMQException
- {
- // Not required to do anything
- }
-
- public void dequeueMessage(StoreContext context, AMQShortString name, 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
- {
- 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
- {
- _metaDataMap.put(messageId, messageMetaData);
- }
-
- public MessageMetaData getMessageMetaData(StoreContext context,Long messageId) throws AMQException
- {
- return _metaDataMap.get(messageId);
- }
-
- public ContentChunk getContentBodyChunk(StoreContext context, Long messageId, int index) throws AMQException
- {
- List<ContentChunk> bodyList = _contentBodyMap.get(messageId);
- return bodyList.get(index);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java b/Final/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java
deleted file mode 100644
index 2a83d9b649..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/store/MessageStore.java
+++ /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.
- *
- */
-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.AMQQueue;
-import org.apache.qpid.server.queue.MessageMetaData;
-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;
-
- /**
- * Removes the specified queue from the persistent store.
- *
- * @param name The queue to remove.
- *
- * @throws AMQException If the operation fails for any reason.
- */
- void removeQueue(AMQShortString name) throws AMQException;
-
- /**
- * Places a message onto a specified queue, in a given transactional context.
- *
- * @param context The transactional context for the operation.
- * @param name The name of 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, AMQShortString name, 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 name The name of the queue to take the message from.
- * @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, AMQShortString name, 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;
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/store/StoreContext.java b/Final/java/broker/src/main/java/org/apache/qpid/server/store/StoreContext.java
deleted file mode 100644
index 3ee49d58cf..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/store/StoreContext.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.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 = super.toString();
- }
-
- public StoreContext(String name)
- {
- _name = name;
- }
-
- public Object getPayload()
- {
- return _payload;
- }
-
- public void setPayload(Object payload)
- {
- _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/Final/java/broker/src/main/java/org/apache/qpid/server/transport/ConnectorConfiguration.java b/Final/java/broker/src/main/java/org/apache/qpid/server/transport/ConnectorConfiguration.java
deleted file mode 100644
index a4ed859fa7..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/transport/ConnectorConfiguration.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.transport;
-
-import org.apache.mina.common.IoAcceptor;
-import org.apache.mina.util.NewThreadExecutor;
-import org.apache.qpid.configuration.Configured;
-
-public class ConnectorConfiguration
-{
- 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;
-
- public IoAcceptor createAcceptor()
- {
- return new org.apache.mina.transport.socket.nio.SocketAcceptor(processors, new NewThreadExecutor());
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java b/Final/java/broker/src/main/java/org/apache/qpid/server/transport/ThreadPoolFilter.java
deleted file mode 100644
index bdd27f2d1c..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/txn/CleanupMessageOperation.java b/Final/java/broker/src/main/java/org/apache/qpid/server/txn/CleanupMessageOperation.java
deleted file mode 100644
index 988f589339..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/txn/CleanupMessageOperation.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.txn;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.NoConsumersException;
-import org.apache.qpid.server.store.StoreContext;
-
-import java.util.List;
-
-/**
- * @author Apache Software Foundation
- */
-public class CleanupMessageOperation implements TxnOp
-{
- private static final Logger _log = Logger.getLogger(CleanupMessageOperation.class);
-
- private final AMQMessage _msg;
-
- private final List<RequiredDeliveryException> _returns;
-
- public CleanupMessageOperation(AMQMessage msg, List<RequiredDeliveryException> returns)
- {
- _msg = msg;
- _returns = returns;
- }
-
- public void prepare(StoreContext context) throws AMQException
- { }
-
- public void undoPrepare()
- {
- // don't need to do anything here, if the store's txn failed
- // when processing prepare then the message was not stored
- // or enqueued on any queues and can be discarded
- }
-
- public void commit(StoreContext context)
- {
- // No-op can't be done here has this is before the message has been attempted to be delivered.
- /*try
- {
- _msg.checkDeliveredToConsumer();
- }
- catch (NoConsumersException e)
- {
- _returns.add(e);
- }*/
- }
-
- public void rollback(StoreContext context)
- {
- // NO OP
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/txn/LocalTransactionalContext.java b/Final/java/broker/src/main/java/org/apache/qpid/server/txn/LocalTransactionalContext.java
deleted file mode 100644
index 9068f871cb..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/txn/LocalTransactionalContext.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.txn;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.RequiredDeliveryException;
-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.AMQMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.NoConsumersException;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.StoreContext;
-
-import java.util.LinkedList;
-import java.util.List;
-
-/** 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<DeliveryDetails> _postCommitDeliveryList = new LinkedList<DeliveryDetails>();
-
- /**
- * 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 List<RequiredDeliveryException> _returnMessages;
-
- private final MessageStore _messageStore;
-
- private final StoreContext _storeContext;
-
- private boolean _inTran = false;
-
- /** Are there messages to deliver. NOT Has the message been delivered */
- private boolean _messageDelivered = false;
-
- private static class DeliveryDetails
- {
- public AMQMessage message;
- public AMQQueue queue;
- private boolean deliverFirst;
-
- public DeliveryDetails(AMQMessage message, AMQQueue queue, boolean deliverFirst)
- {
- this.message = message;
- this.queue = queue;
- this.deliverFirst = deliverFirst;
- }
- }
-
- public LocalTransactionalContext(MessageStore messageStore, StoreContext storeContext,
- List<RequiredDeliveryException> returnMessages)
- {
- _messageStore = messageStore;
- _storeContext = storeContext;
- _returnMessages = returnMessages;
- // _txnBuffer.enlist(new StoreMessageOperation(messageStore));
- }
-
- public StoreContext getStoreContext()
- {
- return _storeContext;
- }
-
- public void rollback() throws AMQException
- {
- _txnBuffer.rollback(_storeContext);
- // Hack to deal with uncommitted non-transactional writes
- if (_messageStore.inTran(_storeContext))
- {
- _messageStore.abortTran(_storeContext);
- _inTran = false;
- }
-
- _postCommitDeliveryList.clear();
- }
-
- public void deliver(AMQMessage message, AMQQueue queue, boolean deliverFirst) 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. Finally a cleanup op will be added to decrement
- // the reference associated with the routing.
- // message.incrementReference();
- _postCommitDeliveryList.add(new DeliveryDetails(message, queue, deliverFirst));
- _messageDelivered = true;
- _txnBuffer.enlist(new CleanupMessageOperation(message, _returnMessages));
- /*_txnBuffer.enlist(new DeliverMessageOperation(message, queue));
- if (_log.isDebugEnabled())
- {
- _log.debug("Incrementing ref count on message and enlisting cleanup operation - id " +
- message.getMessageId());
- }
- message.incrementReference();
- _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)
- {
- beginTranIfNecessary();
- _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);
- }
- }
-
- 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);
- }
-
- _messageStore.beginTran(_storeContext);
- _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(_messageStore));
- }
- // fixme fail commit here ... QPID-440
- try
- {
- _txnBuffer.commit(_storeContext);
- }
- finally
- {
- _messageDelivered = false;
- _inTran = _messageStore.inTran(_storeContext);
- }
-
- try
- {
- postCommitDelivery(_returnMessages);
- }
- catch (AMQException e)
- {
- // OK so what do we do now...?
- _log.error("Failed to deliver messages following txn commit: " + e, e);
- }
- }
-
- private void postCommitDelivery(List<RequiredDeliveryException> returnMessages) throws AMQException
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Performing post commit delivery");
- }
-
- try
- {
- for (DeliveryDetails dd : _postCommitDeliveryList)
- {
- dd.queue.process(_storeContext, dd.message, dd.deliverFirst);
-
- try
- {
- dd.message.checkDeliveredToConsumer();
- }
- catch (NoConsumersException nce)
- {
- returnMessages.add(nce);
- }
- }
- }
- finally
- {
- _postCommitDeliveryList.clear();
- }
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/txn/NonTransactionalContext.java b/Final/java/broker/src/main/java/org/apache/qpid/server/txn/NonTransactionalContext.java
deleted file mode 100644
index b3d69543d4..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/txn/NonTransactionalContext.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.txn;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-
-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.UnacknowledgedMessage;
-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.AMQQueue;
-import org.apache.qpid.server.queue.NoConsumersException;
-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 Set<Long> _browsedAcks;
-
- private final MessageStore _messageStore;
-
- private StoreContext _storeContext;
-
- /** Whether we are in a transaction */
- private boolean _inTran;
-
- public NonTransactionalContext(MessageStore messageStore, StoreContext storeContext, AMQChannel channel,
- List<RequiredDeliveryException> returnMessages, Set<Long> browsedAcks)
- {
- _channel = channel;
- _storeContext = storeContext;
- _returnMessages = returnMessages;
- _messageStore = messageStore;
- _browsedAcks = browsedAcks;
- }
-
-
- 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(AMQMessage message, AMQQueue queue, boolean deliverFirst) throws AMQException
- {
- try
- {
- queue.process(_storeContext, message, deliverFirst);
- //following check implements the functionality
- //required by the 'immediate' flag:
- message.checkDeliveredToConsumer();
- }
- catch (NoConsumersException e)
- {
- _returnMessages.add(e);
- }
- }
-
- public void acknowledgeMessage(final long deliveryTag, long lastDeliveryTag,
- boolean multiple, final UnacknowledgedMessageMap unacknowledgedMessageMap)
- throws AMQException
- {
- 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(UnacknowledgedMessage message) throws AMQException
- {
- if (!_browsedAcks.contains(deliveryTag))
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Discarding message: " + message.message.getMessageId());
- }
-
- //Message has been ack so discard it. This will dequeue and decrement the reference.
- message.discard(_storeContext);
- }
- else
- {
- _browsedAcks.remove(deliveryTag);
- }
- 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");
- }
-
- LinkedList<UnacknowledgedMessage> acked = new LinkedList<UnacknowledgedMessage>();
- unacknowledgedMessageMap.drainTo(acked, deliveryTag);
- for (UnacknowledgedMessage msg : acked)
- {
- if (!_browsedAcks.contains(deliveryTag))
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Discarding message: " + msg.message.getMessageId());
- }
-
- //Message has been ack so discard it. This will dequeue and decrement the reference.
- msg.discard(_storeContext);
- }
- else
- {
- _browsedAcks.remove(deliveryTag);
- }
- }
- }
- }
- else
- {
- UnacknowledgedMessage msg;
- msg = unacknowledgedMessageMap.remove(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 (!_browsedAcks.contains(deliveryTag))
- {
- if (_log.isDebugEnabled())
- {
- _log.debug("Discarding message: " + msg.message.getMessageId());
- }
-
- //Message has been ack so discard it. This will dequeue and decrement the reference.
- msg.discard(_storeContext);
- }
- else
- {
- _browsedAcks.remove(deliveryTag);
- }
-
- if (_log.isDebugEnabled())
- {
- _log.debug("Received non-multiple ack for messaging with delivery tag " + deliveryTag + " msg id " +
- msg.message.getMessageId());
- }
- }
- }
-
- public void messageFullyReceived(boolean persistent) throws AMQException
- {
- if (persistent)
- {
- _messageStore.commitTran(_storeContext);
- _inTran = false;
- }
- }
-
- public void messageProcessed(AMQProtocolSession protocolSession) throws AMQException
- {
- _channel.processReturns(protocolSession);
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/txn/StoreMessageOperation.java b/Final/java/broker/src/main/java/org/apache/qpid/server/txn/StoreMessageOperation.java
deleted file mode 100644
index 0e4d6c2030..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/txn/TransactionalContext.java b/Final/java/broker/src/main/java/org/apache/qpid/server/txn/TransactionalContext.java
deleted file mode 100644
index fee25c07df..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/txn/TransactionalContext.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.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.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. A 'deliverFirst' flag may be set if the message is a
- * redelivery, and should be placed on the front of the queue.
- *
- * <p/>This is an 'enqueue' operation.
- *
- * @param message The message to deliver.
- * @param queue The queue to deliver the message to.
- * @param deliverFirst <tt>true</tt> to place the message on the front of the queue for redelivery, <tt>false</tt>
- * for normal FIFO message ordering.
- *
- * @throws AMQException If the message cannot be delivered for any reason.
- */
- void deliver(AMQMessage message, AMQQueue queue, boolean deliverFirst) 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/Final/java/broker/src/main/java/org/apache/qpid/server/txn/TxnBuffer.java b/Final/java/broker/src/main/java/org/apache/qpid/server/txn/TxnBuffer.java
deleted file mode 100644
index 46a68b6a23..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/txn/TxnOp.java b/Final/java/broker/src/main/java/org/apache/qpid/server/txn/TxnOp.java
deleted file mode 100644
index 919c078cf0..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/util/CircularBuffer.java b/Final/java/broker/src/main/java/org/apache/qpid/server/util/CircularBuffer.java
deleted file mode 100644
index e730e2f3c3..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/util/ConcurrentLinkedQueueNoSize.java b/Final/java/broker/src/main/java/org/apache/qpid/server/util/ConcurrentLinkedQueueNoSize.java
deleted file mode 100644
index cf5e71a6e2..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/util/LoggingProxy.java b/Final/java/broker/src/main/java/org/apache/qpid/server/util/LoggingProxy.java
deleted file mode 100644
index eda97e0ed2..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.java
deleted file mode 100644
index 150b98b424..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/util/NullApplicationRegistry.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.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.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.AccessManager;
-import org.apache.qpid.server.security.access.AllowAll;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-
-public class NullApplicationRegistry extends ApplicationRegistry
-{
- private ManagedObjectRegistry _managedObjectRegistry;
-
- private AuthenticationManager _authenticationManager;
-
- private VirtualHostRegistry _virtualHostRegistry;
-
- private AccessManager _accessManager;
-
- private PrincipalDatabaseManager _databaseManager;
-
-
- public NullApplicationRegistry()
- {
- super(new MapConfiguration(new HashMap()));
- }
-
- public void initialise() throws Exception
- {
- _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");
-
- _configuration.addProperty("heartbeat.delay", 10 * 60); // 10 minutes
-
- }
-
- public Configuration getConfiguration()
- {
- return _configuration;
- }
-
-
- public ManagedObjectRegistry getManagedObjectRegistry()
- {
- return _managedObjectRegistry;
- }
-
- public PrincipalDatabaseManager getDatabaseManager()
- {
- return _databaseManager;
- }
-
- public AuthenticationManager getAuthenticationManager()
- {
- return _authenticationManager;
- }
-
- public Collection<String> getVirtualHostNames()
- {
- String[] hosts = {"test"};
- return Arrays.asList(hosts);
- }
-
- public VirtualHostRegistry getVirtualHostRegistry()
- {
- return _virtualHostRegistry;
- }
-
- public AccessManager getAccessManager()
- {
- return _accessManager;
- }
-}
-
-
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java b/Final/java/broker/src/main/java/org/apache/qpid/server/virtualhost/ManagedVirtualHost.java
deleted file mode 100644
index 85d804457e..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java b/Final/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.java
deleted file mode 100644
index b95772b680..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHost.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.server.virtualhost;
-
-import javax.management.NotCompliantMBeanException;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.AMQBrokerManagerMBean;
-import org.apache.qpid.server.security.access.AccessManager;
-import org.apache.qpid.server.security.access.AccessManagerImpl;
-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.registry.ApplicationRegistry;
-import org.apache.qpid.server.store.MessageStore;
-
-public class VirtualHost implements Accessable
-{
- private static final Logger _logger = Logger.getLogger(VirtualHost.class);
-
-
- private final String _name;
-
- private QueueRegistry _queueRegistry;
-
- private ExchangeRegistry _exchangeRegistry;
-
- private ExchangeFactory _exchangeFactory;
-
- private MessageStore _messageStore;
-
- protected VirtualHostMBean _virtualHostMBean;
-
- private AMQBrokerManagerMBean _brokerMBean;
-
- private AuthenticationManager _authenticationManager;
-
- private AccessManager _accessManager;
-
-
- public void setAccessableName(String name)
- {
- _logger.warn("Setting Accessable Name for VirualHost is not allowed. ("
- + name + ") ignored remains :" + getAccessableName());
- }
-
- public String getAccessableName()
- {
- return _name;
- }
-
-
- /**
- * 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, null, store);
- }
-
- /**
- * Normal Constructor
- * @param name
- * @param hostConfig
- * @throws Exception
- */
- public VirtualHost(String name, Configuration hostConfig) throws Exception
- {
- this(name, hostConfig, null);
- }
-
- private VirtualHost(String name, Configuration hostConfig, MessageStore store) throws Exception
- {
- _name = name;
-
- _virtualHostMBean = new VirtualHostMBean();
- // This isn't needed to be registered
- //_virtualHostMBean.register();
-
- _queueRegistry = new DefaultQueueRegistry(this);
- _exchangeFactory = new DefaultExchangeFactory(this);
- _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 = new AccessManagerImpl(name, hostConfig);
-
- _brokerMBean = new AMQBrokerManagerMBean(_virtualHostMBean);
- _brokerMBean.register();
- }
-
- 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 AccessManager getAccessManager()
- {
- return _accessManager;
- }
-
- public void close() throws Exception
- {
- if (_messageStore != null)
- {
- _messageStore.close();
- }
- }
-
- public ManagedObject getBrokerMBean()
- {
- return _brokerMBean;
- }
-
- public ManagedObject getManagedObject()
- {
- return _virtualHostMBean;
- }
-}
diff --git a/Final/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java b/Final/java/broker/src/main/java/org/apache/qpid/server/virtualhost/VirtualHostRegistry.java
deleted file mode 100644
index 27917fac8a..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/MessageStoreTool.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/MessageStoreTool.java
deleted file mode 100644
index edc900f401..0000000000
--- a/Final/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.queue.AMQQueue;
-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.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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/AbstractCommand.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/AbstractCommand.java
deleted file mode 100644
index 5444197cb4..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Clear.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Clear.java
deleted file mode 100644
index b0006b3fe6..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Command.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Command.java
deleted file mode 100644
index bfa775a34a..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Copy.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Copy.java
deleted file mode 100644
index a5b3a87616..0000000000
--- a/Final/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.server.queue.AMQQueue;
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-
-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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Dump.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Dump.java
deleted file mode 100644
index eea53252c6..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Dump.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.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<AMQMessage> 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 (AMQMessage msg : messages)
- {
- 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<AMQMessage> single = new LinkedList<AMQMessage>();
- single.add(msg);
-
- 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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Help.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Help.java
deleted file mode 100644
index 0f9546541b..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/List.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/List.java
deleted file mode 100644
index df8b59ec19..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Load.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Load.java
deleted file mode 100644
index 244a311c30..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Move.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Move.java
deleted file mode 100644
index 25cff27445..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Move.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.tools.messagestore.commands;
-
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-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<AMQMessage> messages = fromQueue.getMessagesOnTheQueue();
- if (messages != null)
- {
- for (AMQMessage msg : messages)
- {
- ids.add(msg.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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Purge.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Purge.java
deleted file mode 100644
index f187e26593..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Purge.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.tools.messagestore.commands;
-
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-
-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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Quit.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Quit.java
deleted file mode 100644
index a81bc07c38..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Select.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Select.java
deleted file mode 100644
index fd7d4c3f13..0000000000
--- a/Final/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.queue.AMQQueue;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-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/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Show.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Show.java
deleted file mode 100644
index 5988cdabfc..0000000000
--- a/Final/java/broker/src/main/java/org/apache/qpid/tools/messagestore/commands/Show.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.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.AMQQueue;
-import org.apache.qpid.tools.messagestore.MessageStoreTool;
-import org.apache.qpid.tools.utils.Console;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-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<AMQMessage> 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<AMQMessage> 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 (AMQMessage msg : messages)
- {
- 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/Final/java/broker/src/main/java/org/apache/qpid/tools/security/Passwd.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/security/Passwd.java
deleted file mode 100644
index c27c52eb8e..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/tools/utils/CommandParser.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/utils/CommandParser.java
deleted file mode 100644
index 986fea32cc..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/tools/utils/Console.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/utils/Console.java
deleted file mode 100644
index cf457d1ea5..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleCommandParser.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleCommandParser.java
deleted file mode 100644
index 09444ccdd7..0000000000
--- a/Final/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/Final/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleConsole.java b/Final/java/broker/src/main/java/org/apache/qpid/tools/utils/SimpleConsole.java
deleted file mode 100644
index ec080a4611..0000000000
--- a/Final/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/Final/java/broker/src/test/java/org/apache/qpid/server/RunBrokerWithCommand.java b/Final/java/broker/src/test/java/org/apache/qpid/server/RunBrokerWithCommand.java
deleted file mode 100644
index b8803206e0..0000000000
--- a/Final/java/broker/src/test/java/org/apache/qpid/server/RunBrokerWithCommand.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.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 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.out.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.out.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.out.println("Waiting for process to exit: " + args[0]);
- task.waitFor();
- System.out.println("Done Proccess: " + args[0]);
-
- }
- catch (IOException e)
- {
- System.out.println("Proccess had problems: " + e.getMessage());
- exit(1);
- }
- catch (InterruptedException e)
- {
- System.out.println("Proccess had problems: " + e.getMessage());
-
- 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/Final/java/broker/src/test/java/org/apache/qpid/server/configuration/TestPropertyUtils.java b/Final/java/broker/src/test/java/org/apache/qpid/server/configuration/TestPropertyUtils.java
deleted file mode 100644
index 3b83190e42..0000000000
--- a/Final/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/Final/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java b/Final/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java
deleted file mode 100644
index 0a3bc93763..0000000000
--- a/Final/java/broker/src/test/java/org/apache/qpid/server/exchange/DestWildExchangeTest.java
+++ /dev/null
@@ -1,607 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.AMQQueue;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.queue.MessageHandleFactory;
-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.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-
-import java.util.HashSet;
-import java.util.List;
-import java.util.LinkedList;
-
-public class DestWildExchangeTest extends TestCase
-{
-
- DestWildExchange _exchange;
-
- VirtualHost _vhost;
- MessageStore _store;
- StoreContext _context;
-
-
- public void setUp() throws AMQException
- {
- _exchange = new DestWildExchange();
- _vhost = ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHosts().iterator().next();
- _store = new MemoryMessageStore();
- _context = new StoreContext();
- }
-
-
- public void testNoRoute() throws AMQException
- {
- AMQQueue queue = new AMQQueue(new AMQShortString("a*#b"), false, null, false, _vhost);
- _exchange.registerQueue(new AMQShortString("a.*.#.b"), queue, null);
-
-
- MessagePublishInfo info = new PublishInfo(new AMQShortString("a.b"));
-
- AMQMessage message = new AMQMessage(0L, info, null);
-
- try
- {
- _exchange.route(message);
- fail("Message has no route and shouldn't be routed");
- }
- catch (NoRouteException nre)
- {
- //normal
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
- }
-
- public void testDirectMatch() throws AMQException
- {
- AMQQueue queue = new AMQQueue(new AMQShortString("ab"), false, null, false, _vhost);
- _exchange.registerQueue(new AMQShortString("a.b"), queue, null);
-
-
- AMQMessage message = createMessage("a.b");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a.c");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- 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 = new AMQQueue(new AMQShortString("a*"), false, null, false, _vhost);
- _exchange.registerQueue(new AMQShortString("a.*"), queue, null);
-
-
- AMQMessage message = createMessage("a.b");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a.c");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- 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 = new AMQQueue(new AMQShortString("a#"), false, null, false, _vhost);
- _exchange.registerQueue(new AMQShortString("a.#"), queue, null);
-
-
- AMQMessage message = createMessage("a.b.c");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a.b");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a.c");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- message = createMessage("a");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("b");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- 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 = new AMQQueue(new AMQShortString("a"), false, null, false, _vhost);
- _exchange.registerQueue(new AMQShortString("a.*.#.b"), queue, null);
-
-
- AMQMessage message = createMessage("a.c.d.b");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has no route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- message = createMessage("a.c.b");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has no route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
- public void testMatchafterHash() throws AMQException
- {
- AMQQueue queue = new AMQQueue(new AMQShortString("a#"), false, null, false, _vhost);
- _exchange.registerQueue(new AMQShortString("a.*.#.b.c"), queue, null);
-
-
- AMQMessage message = createMessage("a.c.b.b");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- fail("Message has route and should not be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
-
-
- message = createMessage("a.a.b.c");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has no route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- message = createMessage("a.b.c.b");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- 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
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has no route and should be routed");
-
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
-
- public void testHashAfterHash() throws AMQException
- {
- AMQQueue queue = new AMQQueue(new AMQShortString("a#"), false, null, false, _vhost);
- _exchange.registerQueue(new AMQShortString("a.*.#.b.c.#.d"), queue, null);
-
-
- AMQMessage message = createMessage("a.c.b.b.c");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- 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
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has no route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
- public void testHashHash() throws AMQException
- {
- AMQQueue queue = new AMQQueue(new AMQShortString("a#"), false, null, false, _vhost);
- _exchange.registerQueue(new AMQShortString("a.#.*.#.d"), queue, null);
-
-
- AMQMessage message = createMessage("a.c.b.b.c");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- 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
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- }
- catch (AMQException nre)
- {
- fail("Message has no route and should be routed");
- }
-
- Assert.assertEquals(1, queue.getMessageCount());
-
- Assert.assertEquals("Wrong message recevied", message, queue.getMessagesOnTheQueue().get(0));
-
- queue.deleteMessageFromTop(_context);
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
- public void testSubMatchFails() throws AMQException
- {
- AMQQueue queue = new AMQQueue(new AMQShortString("a"), false, null, false, _vhost);
- _exchange.registerQueue(new AMQShortString("a.b.c.d"), queue, null);
-
-
- AMQMessage message = createMessage("a.b.c");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- fail("Message has route and should not be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
- public void testMoreRouting() throws AMQException
- {
- AMQQueue queue = new AMQQueue(new AMQShortString("a"), false, null, false, _vhost);
- _exchange.registerQueue(new AMQShortString("a.b"), queue, null);
-
-
- AMQMessage message = createMessage("a.b.c");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- fail("Message has route and should not be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
- public void testMoreQueue() throws AMQException
- {
- AMQQueue queue = new AMQQueue(new AMQShortString("a"), false, null, false, _vhost);
- _exchange.registerQueue(new AMQShortString("a.b"), queue, null);
-
-
- AMQMessage message = createMessage("a");
-
- try
- {
- _exchange.route(message);
- message.routingComplete(_store, _context, new MessageHandleFactory());
- fail("Message has route and should not be routed");
- }
- catch (AMQException nre)
- {
- }
-
- Assert.assertEquals(0, queue.getMessageCount());
-
- }
-
- private AMQMessage createMessage(String s) throws AMQException
- {
- MessagePublishInfo info = new PublishInfo(new AMQShortString(s));
-
- TransactionalContext trancontext = new NonTransactionalContext(_store, _context, null,
- new LinkedList<RequiredDeliveryException>(),
- new HashSet<Long>());
-
- AMQMessage message = new AMQMessage(0L, info, trancontext);
- message.setContentHeaderBody(new ContentHeaderBody());
-
- return message;
- }
-
-
- class PublishInfo implements MessagePublishInfo
- {
- AMQShortString _routingkey;
-
- PublishInfo(AMQShortString routingkey)
- {
- _routingkey = routingkey;
- }
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- public boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return true;
- }
-
- public AMQShortString getRoutingKey()
- {
- return _routingkey;
- }
- }
-}
diff --git a/Final/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java b/Final/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.java
deleted file mode 100644
index 18d8592817..0000000000
--- a/Final/java/broker/src/test/java/org/apache/qpid/server/exchange/ExchangeMBeanTest.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.exchange;
-
-import junit.framework.TestCase;
-import org.apache.qpid.server.queue.AMQQueue;
-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.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.CompositeData;
-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
- {
- DestNameExchange exchange = new DestNameExchange();
- 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
- {
- DestWildExchange exchange = new DestWildExchange();
- 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();
- _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
- _queueRegistry = _virtualHost.getQueueRegistry();
- _queue = new AMQQueue(new AMQShortString("testQueue"), false, new AMQShortString("ExchangeMBeanTest"), false, _virtualHost);
- _queueRegistry.registerQueue(_queue);
- }
-}
diff --git a/Final/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java b/Final/java/broker/src/test/java/org/apache/qpid/server/exchange/HeadersBindingTest.java
deleted file mode 100644
index 86ba96bf5d..0000000000
--- a/Final/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/Final/java/broker/src/test/java/org/apache/qpid/server/protocol/TestIoSession.java b/Final/java/broker/src/test/java/org/apache/qpid/server/protocol/TestIoSession.java
deleted file mode 100644
index ff4d3ed9fb..0000000000
--- a/Final/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/Final/java/broker/src/test/java/org/apache/qpid/server/protocol/TestMinaProtocolSession.java b/Final/java/broker/src/test/java/org/apache/qpid/server/protocol/TestMinaProtocolSession.java
deleted file mode 100644
index 0c0d8f471e..0000000000
--- a/Final/java/broker/src/test/java/org/apache/qpid/server/protocol/TestMinaProtocolSession.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.AMQException;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.output.ProtocolOutputConverter;
-import org.apache.qpid.server.output.ProtocolOutputConverterRegistry;
-
-public class TestMinaProtocolSession extends AMQMinaProtocolSession
-{
- public TestMinaProtocolSession() throws AMQException
- {
- super(new TestIoSession(),
- ApplicationRegistry.getInstance().getVirtualHostRegistry(),
- new AMQCodecFactory(true));
- }
-
- public ProtocolOutputConverter getProtocolOutputConverter()
- {
- return ProtocolOutputConverterRegistry.getConverter(this);
- }
-
- public byte getProtocolMajorVersion()
- {
- return (byte)8;
- }
-
- public byte getProtocolMinorVersion()
- {
- return (byte)0;
- }
-}
diff --git a/Final/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java b/Final/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.java
deleted file mode 100644
index b718b9c861..0000000000
--- a/Final/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueAlertTest.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.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.protocol.TestMinaProtocolSession;
-import org.apache.qpid.server.protocol.AMQMinaProtocolSession;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-
-import javax.management.Notification;
-import java.util.LinkedList;
-import java.util.HashSet;
-
-/** 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 = null;
- private MessageStore _messageStore = new MemoryMessageStore();
- private StoreContext _storeContext = new StoreContext();
- private TransactionalContext _transactionalContext = new NonTransactionalContext(_messageStore, _storeContext,
- null,
- new LinkedList<RequiredDeliveryException>(),
- new HashSet<Long>());
-
- /**
- * Tests if the alert gets thrown when message count increases the threshold limit
- *
- * @throws Exception
- */
- public void testMessageCountAlert() throws Exception
- {
- _queue = new AMQQueue(new AMQShortString("testQueue1"), false, new AMQShortString("AMQueueAlertTest"),
- false, _virtualHost);
- _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 = new AMQQueue(new AMQShortString("testQueue2"), false, new AMQShortString("AMQueueAlertTest"),
- false, _virtualHost);
- _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 = new AMQQueue(new AMQShortString("testQueue3"), false, new AMQShortString("AMQueueAlertTest"),
- false, _virtualHost);
- _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 = new AMQQueue(new AMQShortString("testQueue4"), false, new AMQShortString("AMQueueAlertTest"),
- false, _virtualHost);
- _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.
- The QueueDepth should decrease when messages are delivered from the queue (QPID-408)
- */
- public void testQueueDepthAlertWithSubscribers() throws Exception
- {
- protocolSession = new TestMinaProtocolSession();
- AMQChannel channel = new AMQChannel(protocolSession, 2, _messageStore, null);
- protocolSession.addChannel(channel);
-
- // Create queue
- _queue = getNewQueue();
- _queue.registerProtocolSession(protocolSession, channel.getChannelId(),
- new AMQShortString("consumer_tag"), true, null, false, 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(0), 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.unregisterProtocolSession(protocolSession, channel.getChannelId(), new AMQShortString("consumer_tag"));
- 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.
- _queue.registerProtocolSession(protocolSession, channel.getChannelId(),
- new AMQShortString("consumer_tag"), true, null, false, false);
- _queue.deliverAsync();
- while (_queue.getMessageCount() != 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.unregisterProtocolSession(protocolSession, channel.getChannelId(), new AMQShortString("consumer_tag"));
- 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()));
- }
-
- protected AMQMessage message(final boolean immediate, long size) throws AMQException
- {
- MessagePublishInfo publish = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- public boolean isImmediate()
- {
- return immediate;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return null;
- }
- };
-
- ContentHeaderBody contentHeaderBody = new ContentHeaderBody();
- contentHeaderBody.bodySize = size; // in bytes
- AMQMessage message = new AMQMessage(_messageStore.getNewMessageId(), publish, _transactionalContext);
- message.setContentHeaderBody(contentHeaderBody);
- message.setPublisher(protocolSession);
- return message;
- }
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance();
- _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
- }
-
- private void sendMessages(long messageCount, long size) throws AMQException
- {
- AMQMessage[] messages = new AMQMessage[(int) messageCount];
- for (int i = 0; i < messages.length; i++)
- {
- messages[i] = message(false, size);
- messages[i].enqueue(_queue);
- messages[i].routingComplete(_messageStore, _storeContext, new MessageHandleFactory());
- }
-
- for (int i = 0; i < messageCount; i++)
- {
- _queue.process(_storeContext, messages[i], false);
- }
- }
-
- private AMQQueue getNewQueue() throws AMQException
- {
- return new AMQQueue(new AMQShortString("testQueue" + Math.random()),
- false,
- new AMQShortString("AMQueueAlertTest"),
- false,
- _virtualHost);
- }
-}
diff --git a/Final/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java b/Final/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.java
deleted file mode 100644
index 3caf6ad73d..0000000000
--- a/Final/java/broker/src/test/java/org/apache/qpid/server/queue/AMQQueueMBeanTest.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.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.server.AMQChannel;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.protocol.TestMinaProtocolSession;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-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.LinkedList;
-import java.util.HashSet;
-
-/**
- * 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;
-
- 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();
- assertTrue(_queueMBean.getMessageCount() == 0);
- 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
- {
- SubscriptionManager mgr = _queue.getSubscribers();
- assertFalse(mgr.hasActiveSubscribers());
- assertTrue(_queueMBean.getActiveConsumerCount() == 0);
-
-
- TestMinaProtocolSession protocolSession = new TestMinaProtocolSession();
- AMQChannel channel = new AMQChannel(protocolSession, 1, _messageStore, null);
- protocolSession.addChannel(channel);
-
- _queue.registerProtocolSession(protocolSession, 1, new AMQShortString("test"), false, null, false, false);
- assertTrue(_queueMBean.getActiveConsumerCount() == 1);
-
- SubscriptionSet _subscribers = (SubscriptionSet) mgr;
- SubscriptionFactory subscriptionFactory = new SubscriptionImpl.Factory();
- Subscription s1 = subscriptionFactory.createSubscription(channel.getChannelId(),
- protocolSession,
- new AMQShortString("S1"),
- false,
- null,
- true,
- _queue);
-
- Subscription s2 = subscriptionFactory.createSubscription(channel.getChannelId(),
- protocolSession,
- new AMQShortString("S2"),
- false,
- null,
- true,
- _queue);
- _subscribers.addSubscriber(s1);
- _subscribers.addSubscriber(s2);
- assertTrue(_queueMBean.getActiveConsumerCount() == 3);
- assertTrue(_queueMBean.getConsumerCount() == 3);
-
- s1.close();
- assertTrue(_queueMBean.getActiveConsumerCount() == 2);
- 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)
- {
-
- }
-
- AMQMessage msg = message(false, false);
- long id = msg.getMessageId();
- _queue.clearQueue(_storeContext);
-
- msg.enqueue(_queue);
- msg.routingComplete(_messageStore, _storeContext, new MessageHandleFactory());
- _queue.process(_storeContext, msg, false);
- _queueMBean.viewMessageContent(id);
- try
- {
- _queueMBean.viewMessageContent(id + 1);
- fail();
- }
- catch (JMException ex)
- {
-
- }
- }
-
- private AMQMessage message(final boolean immediate, boolean persistent) throws AMQException
- {
- MessagePublishInfo publish = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- 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));
- return new AMQMessage(_messageStore.getNewMessageId(), publish, _transactionalContext, contentHeaderBody);
- }
-
- @Override
- protected void setUp() throws Exception
- {
- super.setUp();
- IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance();
- _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
- _messageStore = _virtualHost.getMessageStore();
-
- _transactionalContext = new NonTransactionalContext(_messageStore, _storeContext,
- null,
- new LinkedList<RequiredDeliveryException>(),
- new HashSet<Long>());
-
- _queue = new AMQQueue(new AMQShortString("testQueue"), false, new AMQShortString("AMQueueMBeanTest"), false, _virtualHost);
- _queueMBean = new AMQQueueMBean(_queue);
-
- _protocolSession = new TestMinaProtocolSession();
- }
-
- private void sendMessages(int messageCount, boolean persistent) throws AMQException
- {
- for (int i = 0; i < messageCount; i++)
- {
- AMQMessage currentMessage = message(false, persistent);
- currentMessage.enqueue(_queue);
-
- // route header
- currentMessage.routingComplete(_messageStore, _storeContext, new MessageHandleFactory());
-
- // Add the body so we have somthing to test later
- currentMessage.addContentBodyFrame(_storeContext,
- _protocolSession.getRegistry()
- .getProtocolVersionMethodConverter()
- .convertToContentChunk(
- new ContentBody(ByteBuffer.allocate((int) MESSAGE_SIZE),
- MESSAGE_SIZE)));
-
-
- }
- }
-}
diff --git a/Final/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java b/Final/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java
deleted file mode 100644
index 48d808142c..0000000000
--- a/Final/java/broker/src/test/java/org/apache/qpid/server/store/TestableMemoryMessageStore.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.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 TestableMemoryMessageStore extends MemoryMessageStore
-{
-
- MemoryMessageStore _mms = null;
-
- 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;
- }
- }
-}
diff --git a/Final/java/broker/src/test/java/org/apache/qpid/server/util/LoggingProxyTest.java b/Final/java/broker/src/test/java/org/apache/qpid/server/util/LoggingProxyTest.java
deleted file mode 100644
index c7db51016e..0000000000
--- a/Final/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/Final/java/client-java14/README.txt b/Final/java/client-java14/README.txt
deleted file mode 100644
index 66621c7eb2..0000000000
--- a/Final/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/Final/java/client-java14/etc/sasl.properties b/Final/java/client-java14/etc/sasl.properties
deleted file mode 100644
index 04519e2a30..0000000000
--- a/Final/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/Final/java/client-java14/pom.xml b/Final/java/client-java14/pom.xml
deleted file mode 100644
index a2da7800e6..0000000000
--- a/Final/java/client-java14/pom.xml
+++ /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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client-java14</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid Client for Java 1.4</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- <java.source.version>1.4</java.source.version>
- <qpid.version>${pom.version}</qpid.version>
- <qpid.targetDir>${project.build.directory}</qpid.targetDir>
- <!--<qpid.root>${basedir}/..</qpid.root>-->
- <sasl.properties>${basedir}/etc/sasl.properties</sasl.properties>
-
- <!-- This is a dummy value to ensure this property exists, override in your settings.xml to your real 1.4 jdk location to run tests. -->
- <jvm.1.4.bin>path/to/java1.4</jvm.1.4.bin>
- </properties>
-
- <dependencies>
-
- <!-- These dependencies have to be re-declared here, because exluding the normal (non 1.4) client and common from the distribution takes out
- these transitive dependencies too. -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.mina</groupId>
- <artifactId>mina-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
-
- <!-- Use the java 1.4 retrotranslated client. -->
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client</artifactId>
- <type>jar</type>
- <version>${pom.version}</version>
- <classifier>java14</classifier>
- </dependency>
-
- <!-- Use the java 1.4 retrotranslated common library. -->
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-common</artifactId>
- <type>jar</type>
- <version>${pom.version}</version>
- <classifier>java14</classifier>
- </dependency>
-
- <!-- Use the java 1.4 retrotranslated integration tests. -->
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-integrationtests</artifactId>
- <type>jar</type>
- <version>${pom.version}</version>
- <classifier>java14</classifier>
- <!--<scope>test</scope>-->
- </dependency>
-
- <dependency>
- <groupId>net.sf.retrotranslator</groupId>
- <artifactId>retrotranslator-runtime</artifactId>
- <scope>package</scope>
- </dependency>
-
- <!-- Test dependencies. -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
-
- <!-- Sets up the compiler plugin to compile on 1.4 -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>${java.source.version}</source>
- <target>${java.source.version}</target>
- </configuration>
- </plugin>
-
- <!-- Sets up the assembly plugin to use the assembly directions to build a 1.4 compatable client. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${assembly.version}</version>
-
- <executions>
-
- <!-- Produces the distribution. -->
- <execution>
- <id>assembly-dist</id>
- <phase>package</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/client-java14-bin.xml</descriptor>
- </descriptors>
- <finalName>qpid-${pom.version}</finalName>
- <outputDirectory>${qpid.targetDir}</outputDirectory>
- <tarLongFileMode>gnu</tarLongFileMode>
- </configuration>
- </execution>
-
- <!-- Produces a jar with all test dependencies in it. For convenience in running tests from command line. -->
- <!-- Todo: Replace this with a manifest only jar, its much quicker to build that. -->
- <execution>
- <id>assembly-alltestdeps</id>
- <phase>package</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/jar-with-dependencies.xml</descriptor>
- </descriptors>
- <outputDirectory>target</outputDirectory>
- <workDirectory>target/assembly/work</workDirectory>
- </configuration>
- </execution>
-
- </executions>
- </plugin>
-
- <!-- Sets up surefire to run during the integration-test phase instead of the test phase. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- <executions>
- <execution>
- <id>surefire-it</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>true</skip>
- <forkMode>once</forkMode>
- <jvm>${jvm.1.4.bin}</jvm>
- <systemProperties>
- <property>
- <name>amqj.logging.level</name>
- <value>${amqj.logging.level}</value>
- </property>
- <property>
- <name>log4j.configuration</name>
- <value>${log4j.configuration}</value>
- </property>
- <property>
- <name>amq.dynamicsaslregistrar.properties</name>
- <value>${sasl.properties}</value>
- </property>
- </systemProperties>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
- </build>
-</project>
diff --git a/Final/java/client-java14/src/main/assembly/client-java14-bin.xml b/Final/java/client-java14/src/main/assembly/client-java14-bin.xml
deleted file mode 100644
index 91e1f23975..0000000000
--- a/Final/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/Final/java/client-java14/src/main/assembly/jar-with-dependencies.xml b/Final/java/client-java14/src/main/assembly/jar-with-dependencies.xml
deleted file mode 100644
index 091fd46427..0000000000
--- a/Final/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/Final/java/client-java14/src/main/java/org/apache/qpid/sasl/ClientFactoryImpl.java b/Final/java/client-java14/src/main/java/org/apache/qpid/sasl/ClientFactoryImpl.java
deleted file mode 100644
index 691020307a..0000000000
--- a/Final/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/Final/java/client-java14/src/main/java/org/apache/qpid/sasl/CramMD5Client.java b/Final/java/client-java14/src/main/java/org/apache/qpid/sasl/CramMD5Client.java
deleted file mode 100644
index 7d15f03329..0000000000
--- a/Final/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/Final/java/client-java14/src/main/java/org/apache/qpid/sasl/PlainClient.java b/Final/java/client-java14/src/main/java/org/apache/qpid/sasl/PlainClient.java
deleted file mode 100644
index 97e607c57e..0000000000
--- a/Final/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/Final/java/client-java14/src/main/java/org/apache/qpid/sasl/Provider.java b/Final/java/client-java14/src/main/java/org/apache/qpid/sasl/Provider.java
deleted file mode 100644
index f9a5c42c3d..0000000000
--- a/Final/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/Final/java/client-java14/src/test/java/org/apache/qpid/test/integration/client/ConnectionTest.java b/Final/java/client-java14/src/test/java/org/apache/qpid/test/integration/client/ConnectionTest.java
deleted file mode 100644
index 468beda5b5..0000000000
--- a/Final/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/Final/java/client/distribution/pom.xml b/Final/java/client/distribution/pom.xml
deleted file mode 100644
index bd97463d15..0000000000
--- a/Final/java/client/distribution/pom.xml
+++ /dev/null
@@ -1,156 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT 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 xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client-distribution</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid Client Distributions</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- <java.source.version>1.5</java.source.version>
- <qpid.version>${pom.version}</qpid.version>
- <qpid.targetDir>${project.build.directory}</qpid.targetDir>
- <qpid.root>${basedir}/..</qpid.root>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client</artifactId>
- <type>jar</type>
- <version>${pom.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>${java.source.version}</source>
- <target>${java.source.version}</target>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${assembly.version}</version>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/client-bin.xml</descriptor>
- </descriptors>
- <finalName>qpid-${pom.version}</finalName>
- <outputDirectory>${qpid.targetDir}</outputDirectory>
- <tarLongFileMode>gnu</tarLongFileMode>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <finalName>qpid-incubating</finalName>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- </manifest>
- </archive>
- </configuration>
- </plugin>
-
- </plugins>
- </pluginManagement>
-
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>distribution-package</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/client-bin.xml</descriptor>
- <descriptor>src/main/assembly/client-src.xml</descriptor>
- </descriptors>
- <finalName>qpid-${pom.version}</finalName>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- </build>
-
-<profiles>
- <profile>
- <id>tests</id>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client</artifactId>
- <type>test-jar</type>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>distribution-package</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/client-bin-tests.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-</profiles>
-
-</project>
diff --git a/Final/java/client/distribution/src/main/assembly/client-bin-tests.xml b/Final/java/client/distribution/src/main/assembly/client-bin-tests.xml
deleted file mode 100644
index ec4df1c9a7..0000000000
--- a/Final/java/client/distribution/src/main/assembly/client-bin-tests.xml
+++ /dev/null
@@ -1,107 +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>
- <id>java-client-bin-with-tests</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>
-
- <!-- Include easy access to test source-->
- <fileSet>
- <directory>../src/test</directory>
- <outputDirectory>qpid-${qpid.version}/src</outputDirectory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
-
- <!-- fileSet> Client contains a readme.txt as does qpid root.
- Which will cause problems on windows as the zip will
- contain: readme.txt and README.txt
- < Client local documentation>
- <directory>..</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- <includes>
- <include>*.txt</include>
- </includes>
- </fileSet-->
-
- <!-- Configuration -->
- <fileSet>
- <directory>../test/etc</directory>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <includes>
- <include>**/*</include>
- </includes>
- </fileSet>
-
- <!-- Execution Scripts -->
- <fileSet>
- <directory>../test/bin</directory>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <includes>
- <include>**/*</include>
- </includes>
- <fileMode>777</fileMode> <!-- RWX -->
- </fileSet>
-
- <!-- Metadata Jar -->
- <fileSet>
- <directory>target</directory>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <includes>
- <include>qpid-incubating.jar</include>
- </includes>
- </fileSet>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <unpack>false</unpack>
- <excludes>
- <exclude>org.apache.qpid:qpid-client-distribution</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
-</assembly>
diff --git a/Final/java/client/distribution/src/main/assembly/client-bin.xml b/Final/java/client/distribution/src/main/assembly/client-bin.xml
deleted file mode 100644
index 70874b09a4..0000000000
--- a/Final/java/client/distribution/src/main/assembly/client-bin.xml
+++ /dev/null
@@ -1,78 +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>
- <id>java-client-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>
- < Client local documentation>
- <directory>..</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- <includes>
- <include>*.txt</include>
- </includes>
- </fileSet-->
-
- <fileSet>
- <directory>../../release-docs</directory>
- <outputDirectory>qpid-${qpid.version}/docs</outputDirectory>
- <includes>
- <include>RELEASE_NOTES.txt</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>target</directory>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <includes>
- <include>qpid-incubating.jar</include>
- </includes>
- </fileSet>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <unpack>false</unpack>
- <excludes>
- <exclude>org.apache.qpid:qpid-client:jar:java14</exclude>
- <exclude>org.apache.qpid:qpid-common:jar:java14</exclude>
- <exclude>org.apache.qpid:qpid-client-distribution</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
-</assembly>
diff --git a/Final/java/client/distribution/src/main/assembly/client-java1.4-bin.xml b/Final/java/client/distribution/src/main/assembly/client-java1.4-bin.xml
deleted file mode 100644
index 6a2dd17c5c..0000000000
--- a/Final/java/client/distribution/src/main/assembly/client-java1.4-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-java1.4-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>
-
- <fileSet>
- <directory>target</directory>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <includes>
- <include>qpid-incubating.jar</include>
- </includes>
- </fileSet>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <unpack>false</unpack>
- <excludes>
- <exclude>org.apache.qpid:qpid-client:jar</exclude>
- <exclude>org.apache.qpid:qpid-common:jar</exclude>
- <exclude>org.apache.qpid:qpid-client-distribution</exclude>
- <exclude>org.apache.mina:mina-java5</exclude>
- <exclude>org.apache.mina:mina-filter-ssl</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
-</assembly>
-
-
diff --git a/Final/java/client/distribution/src/main/assembly/client-src.xml b/Final/java/client/distribution/src/main/assembly/client-src.xml
deleted file mode 100644
index b5055f05d7..0000000000
--- a/Final/java/client/distribution/src/main/assembly/client-src.xml
+++ /dev/null
@@ -1,62 +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>
- <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
- <id>java-client-src</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}-src</outputDirectory>
- <includes>
- <include>DISCLAIMER</include>
- <include>LICENSE.txt</include>
- <include>NOTICE.txt</include>
- <include>README.txt</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>..</directory>
- <outputDirectory>qpid-${qpid.version}-src</outputDirectory>
- <includes>
- <include>src/main/**</include>
- <include>src/test/**</include>
- <include>test/main/**</include>
- <include>test/test/**</include>
- <include>pom.xml</include>
- <include>distribution/**</include>
- </includes>
- <excludes>
- <exclude>**/target</exclude>
- <exclude>**/target/**/*</exclude>
- <exclude>**/build</exclude>
- <exclude>**/build/**/*</exclude>
- </excludes>
- </fileSet>
- </fileSets>
-</assembly>
diff --git a/Final/java/client/example/bin/set_classpath.bat b/Final/java/client/example/bin/set_classpath.bat
deleted file mode 100644
index d528967024..0000000000
--- a/Final/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/Final/java/client/example/bin/set_classpath.sh b/Final/java/client/example/bin/set_classpath.sh
deleted file mode 100755
index 89e9bc8242..0000000000
--- a/Final/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/Final/java/client/example/pom.xml b/Final/java/client/example/pom.xml
deleted file mode 100644
index 3d4cf21a2d..0000000000
--- a/Final/java/client/example/pom.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 xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-example</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid Example</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>../..</topDirectoryLocation>
- <amqj.logging.level>warn</amqj.logging.level>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-common</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client</artifactId>
- </dependency>
-
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </dependency>
-
- <dependency>
- <groupId>jmscts</groupId>
- <artifactId>jmscts</artifactId>
- <version>0.5-b2</version>
- <scope>test</scope>
- <exclusions>
- <exclusion>
- <groupId>jms</groupId>
- <artifactId>jms</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemProperties>
- <property>
- <name>amqj.noAutoCreateVMBroker</name>
- <value>true</value>
- </property>
- <property>
- <name>amqj.logging.level</name>
- <value>${amqj.logging.level}</value>
- </property>
- <property>
- <name>log4j.configuration</name>
- <value>file:///${basedir}/src/main/java/log4j.properties</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
-
- <!-- Build a zip file with the source in it, this had to be done with the assembly plugin as the source plugin did not provide a way
- to exclude the .svn directories. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-SNAPSHOT</version>
- <configuration>
- <descriptors>
- <descriptor>source-jar.xml</descriptor>
- </descriptors>
- <outputDirectory>target</outputDirectory>
- <workDirectory>target/assembly/work</workDirectory>
- </configuration>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>attached</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- Publish the source as a build artifact. -->
- <!--
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
- <file>target/${project.build.finalName}-source.jar</file>
- <type>jar</type>
- <classifier>source</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
- -->
-
- </plugins>
- </build>
-</project>
diff --git a/Final/java/client/example/source-jar.xml b/Final/java/client/example/source-jar.xml
deleted file mode 100644
index 60451448b8..0000000000
--- a/Final/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/Final/java/client/example/src/main/java/org/apache/qpid/example/log4j.xml b/Final/java/client/example/src/main/java/org/apache/qpid/example/log4j.xml
deleted file mode 100644
index de64423a51..0000000000
--- a/Final/java/client/example/src/main/java/org/apache/qpid/example/log4j.xml
+++ /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.
- -
- -->
-<!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="ams_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>
-
- <root>
- <priority value="debug"/>
- <appender-ref ref="STDOUT"/>
- <appender-ref ref="FileAppender"/>
- </root>
-</log4j:configuration> \ No newline at end of file
diff --git a/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageDispatcher.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageDispatcher.java
deleted file mode 100644
index 6a7626c51d..0000000000
--- a/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageDispatcher.java
+++ /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.
- *
- */
-package org.apache.qpid.example.publisher;
-
-import java.io.File;
-
-import javax.jms.JMSException;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.example.shared.FileUtils;
-import org.apache.qpid.example.shared.Statics;
-
-/**
- * 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 = Logger.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/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageFactory.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageFactory.java
deleted file mode 100644
index f3b21e3c64..0000000000
--- a/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/FileMessageFactory.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.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());
- mfe.initCause(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/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.java
deleted file mode 100644
index 0a4231c977..0000000000
--- a/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/MessageFactoryException.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.example.publisher;
-
-public class MessageFactoryException extends Exception
-{
-
- private int _errorCode;
-
- public MessageFactoryException(String message)
- {
- super(message);
- }
-
- public MessageFactoryException(String msg, Throwable t)
- {
- super(msg, t);
- }
-
- public MessageFactoryException(int errorCode, String msg, Throwable t)
- {
- super(msg + " [error code " + errorCode + ']', t);
- _errorCode = errorCode;
- }
-
- public MessageFactoryException(int errorCode, String msg)
- {
- super(msg + " [error code " + errorCode + ']');
- _errorCode = errorCode;
- }
-
- public int getErrorCode()
- {
- return _errorCode;
- }
-}
diff --git a/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorMessageDispatcher.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorMessageDispatcher.java
deleted file mode 100644
index b6544db995..0000000000
--- a/Final/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.apache.log4j.BasicConfigurator;
-import org.apache.log4j.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 = Logger.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
- *
- * @param args
- */
- public static void main(String[] args)
- {
- //Switch on logging appropriately for your app
- BasicConfigurator.configure();
-
- 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/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorPublisher.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorPublisher.java
deleted file mode 100644
index a67b602e58..0000000000
--- a/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/MonitorPublisher.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.example.publisher;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.client.BasicMessageProducer;
-
-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 = Logger.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(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(e);
- e.printStackTrace();
- throw new UndeliveredMessageException("Cannot deliver immediate message", e);
- }
-
- _log.info(_name + " finished sending message: " + message);
- return true;
- }
-}
diff --git a/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/Publisher.java
deleted file mode 100644
index 2bde4ec35c..0000000000
--- a/Final/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.log4j.Logger;
-
-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;
-
-public class Publisher
-{
- private static final Logger _log = Logger.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(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(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/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.java
deleted file mode 100644
index 399cbc9427..0000000000
--- a/Final/java/client/example/src/main/java/org/apache/qpid/example/publisher/UndeliveredMessageException.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.publisher;
-
-/**
- * Exception thrown by monitor when cannot send a message marked for immediate delivery
- */
-public class UndeliveredMessageException extends Exception
-{
-
- private int _errorCode;
-
- public UndeliveredMessageException(String message)
- {
- super(message);
- }
-
- public UndeliveredMessageException(String msg, Throwable t)
- {
- super(msg, t);
- }
-
- public UndeliveredMessageException(int errorCode, String msg, Throwable t)
- {
- super(msg + " [error code " + errorCode + ']', t);
- _errorCode = errorCode;
- }
-
- public UndeliveredMessageException(int errorCode, String msg)
- {
- super(msg + " [error code " + errorCode + ']');
- _errorCode = errorCode;
- }
-
- public int getErrorCode()
- {
- return _errorCode;
- }
-}
diff --git a/Final/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Client.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Client.java
deleted file mode 100644
index e32ee0ba73..0000000000
--- a/Final/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/Final/java/client/example/src/main/java/org/apache/qpid/example/pubsub/ConnectionSetup.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/pubsub/ConnectionSetup.java
deleted file mode 100644
index c4edd9034f..0000000000
--- a/Final/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/Final/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Publisher.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Publisher.java
deleted file mode 100644
index dd936e429f..0000000000
--- a/Final/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/Final/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Subscriber.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/pubsub/Subscriber.java
deleted file mode 100644
index f2d736701f..0000000000
--- a/Final/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/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.java
deleted file mode 100644
index 6eb847ea9d..0000000000
--- a/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/ConnectionException.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.example.shared;
-
-public class ConnectionException extends Exception
-{
-
- private int _errorCode;
-
- public ConnectionException(String message)
- {
- super(message);
- }
-
- public ConnectionException(String msg, Throwable t)
- {
- super(msg, t);
- }
-
- public ConnectionException(int errorCode, String msg, Throwable t)
- {
- super(msg + " [error code " + errorCode + ']', t);
- _errorCode = errorCode;
- }
-
- public ConnectionException(int errorCode, String msg)
- {
- super(msg + " [error code " + errorCode + ']');
- _errorCode = errorCode;
- }
-
- public int getErrorCode()
- {
- return _errorCode;
- }
-}
diff --git a/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.java
deleted file mode 100644
index bf805ab817..0000000000
--- a/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/ContextException.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.example.shared;
-
-public class ContextException extends Exception
-{
-
- private int _errorCode;
-
- public ContextException(String message)
- {
- super(message);
- }
-
- public ContextException(String msg, Throwable t)
- {
- super(msg, t);
- }
-
- public ContextException(int errorCode, String msg, Throwable t)
- {
- super(msg + " [error code " + errorCode + ']', t);
- _errorCode = errorCode;
- }
-
- public ContextException(int errorCode, String msg)
- {
- super(msg + " [error code " + errorCode + ']');
- _errorCode = errorCode;
- }
-
- public int getErrorCode()
- {
- return _errorCode;
- }
-}
diff --git a/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/FileUtils.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/FileUtils.java
deleted file mode 100644
index 54446cb6a7..0000000000
--- a/Final/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/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.java
deleted file mode 100644
index 98a2c0d497..0000000000
--- a/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/InitialContextHelper.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.example.shared;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.apache.log4j.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 = Logger.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/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/Statics.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/Statics.java
deleted file mode 100644
index c056f8a7da..0000000000
--- a/Final/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/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/example.properties b/Final/java/client/example/src/main/java/org/apache/qpid/example/shared/example.properties
deleted file mode 100644
index a60e3964ad..0000000000
--- a/Final/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/Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriber.java
deleted file mode 100644
index 1d2e5e0e66..0000000000
--- a/Final/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.log4j.Logger;
-import org.apache.qpid.example.shared.Statics;
-
-import javax.jms.*;
-
-/**
- * Subclass of Subscriber which consumes a heartbeat message
- */
-
-public class MonitoredSubscriber extends Subscriber
-{
- protected String _monitorDestinationName;
-
- private static final Logger _logger = Logger.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/Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriptionWrapper.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriptionWrapper.java
deleted file mode 100644
index d2f27da052..0000000000
--- a/Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/MonitoredSubscriptionWrapper.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.example.subscriber;
-
-import org.apache.log4j.BasicConfigurator;
-
-/**
- * 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[])
- {
- //switch on logging
- BasicConfigurator.configure();
-
- _subscriber = new MonitoredSubscriber();
-
- _subscriber.subscribe();
- }
-
- /**
- * Stop subscribing now ...
- */
- public static void stop()
- {
- _subscriber.stop();
- }
-}
diff --git a/Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.java
deleted file mode 100644
index d443dca828..0000000000
--- a/Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/Subscriber.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.subscriber;
-
-import org.apache.log4j.Logger;
-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;
-
-/**
- * Subscriber which consumes messages from a queue
- */
-
-public class Subscriber
-{
- private static final Logger _log = Logger.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(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/Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/SubscriptionWrapper.java b/Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/SubscriptionWrapper.java
deleted file mode 100644
index 32a0ef685c..0000000000
--- a/Final/java/client/example/src/main/java/org/apache/qpid/example/subscriber/SubscriptionWrapper.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.example.subscriber;
-
-import org.apache.log4j.BasicConfigurator;
-
-/**
- * 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[])
- {
- //switch on logging
- BasicConfigurator.configure();
-
- _subscriber = new Subscriber();
-
- _subscriber.subscribe();
- }
-
- /**
- * Stop subscribing now ...
- */
- public static void stop()
- {
- _subscriber.stop();
- }
-}
diff --git a/Final/java/client/pom.xml b/Final/java/client/pom.xml
deleted file mode 100644
index 0f0757e9a3..0000000000
--- a/Final/java/client/pom.xml
+++ /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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid Client</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- <java.source.version>1.5</java.source.version>
- <qpid.version>${pom.version}</qpid.version>
- <qpid.targetDir>${project.build.directory}</qpid.targetDir>
- </properties>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-common</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.4.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- </dependency>
-
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- </dependency>
-
-
- <!-- Test Dependencies -->
-
- <dependency> <!-- for inVm Broker -->
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-broker</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>uk.co.thebadgerset</groupId>
- <artifactId>junit-toolkit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- These need to be included at compile time only, for the retrotranslator verification to find them. -->
- <dependency>
- <groupId>net.sf.retrotranslator</groupId>
- <artifactId>retrotranslator-runtime</artifactId>
- <scope>provided</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
-
- <plugin>
- <artifactId>minijar-maven-plugin</artifactId>
- <groupId>org.codehaus.mojo</groupId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>ueberjar</goal>
- </goals>
- <configuration>
- <stripUnusedClasses>false</stripUnusedClasses>
- <name>[artifactId]-[version]-single.jar</name>
- <classifier>single</classifier>
- <attach>true</attach>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>attach-artifacts</id>
- <phase>package</phase>
- <goals>
- <goal>attach-artifact</goal>
- </goals>
- <configuration>
- <artifacts>
- <artifact>
- <file>target/${artifactId}-${version}-single.jar</file>
- <type>jar</type>
- <classifier>single</classifier>
- </artifact>
- </artifacts>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <systemProperties>
- <property>
- <name>amqj.logging.level</name>
- <value>${amqj.logging.level}</value>
- </property>
- <property>
- <name>log4j.configuration</name>
- <value>${log4j.configuration}</value>
- </property>
- <property>
- <name>amqj.noAutoCreateVMBroker</name>
- <value>true</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <phase>package</phase>
- <goals>
- <goal>test-jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- Backports the module to Java 1.4. This is done during the packaging phase as a transformation of the Jar. -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>retrotranslator-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>retro-client</id>
- <goals>
- <goal>translate-project</goal>
- </goals>
- <configuration>
- <destjar>${project.build.directory}/${project.build.finalName}-java14.jar</destjar>
- <verify>${retrotranslator.verify}</verify>
- <verifyClasspath>
- <element>${retrotranslator.1.4-rt-path}</element>
- <element>${retrotranslator.1.4-jce-path}</element>
- <element>${retrotranslator.1.4-jsse-path}</element>
- <element>${retrotranslator.1.4-sasl-path}</element>
- </verifyClasspath>
- <failonwarning>false</failonwarning>
- <classifier>java14</classifier>
- <attach>true</attach>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
-
- <testResources>
- <testResource>
- <targetPath>META-INF/</targetPath>
- <filtering>false</filtering>
- <directory>../resources/META-INF</directory>
- <includes>
- <include>**</include>
- </includes>
- </testResource>
-
- <!--
- <testResource>
- <targetPath>src/</targetPath>
- <filtering>false</filtering>
- <directory>src/test/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </testResource>
- -->
-
- <testResource>
- <targetPath></targetPath>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>client.log4j</include>
- </includes>
- </testResource>
- </testResources>
-
- </build>
-
-</project>
diff --git a/Final/java/client/src/main/java/client.log4j b/Final/java/client/src/main/java/client.log4j
deleted file mode 100644
index 525433e9a9..0000000000
--- a/Final/java/client/src/main/java/client.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/Final/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.java
deleted file mode 100644
index b6fbb6c6bf..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/AMQAuthenticationException.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;
-
-/**
- * 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)
- {
- super(error, msg);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
deleted file mode 100644
index c04380ba8c..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/AMQBrokerDetails.java
+++ /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.
- *
- */
-package org.apache.qpid.client;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-
-import org.apache.qpid.jms.BrokerDetails;
-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 HashMap<String, String> _options;
-
- private SSLConfiguration _sslConfiguration;
-
- public AMQBrokerDetails()
- {
- _options = new HashMap<String, String>();
- }
-
- public AMQBrokerDetails(String url) throws URLSyntaxException
- {
- this();
- // 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("vm") ||
- transport.equalsIgnoreCase("tcp"))))
- {
- 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
- {
- //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;
- //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
- {
- 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 getOption(String key)
- {
- return _options.get(key);
- }
-
- public void setOption(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 void setTimeout(long timeout)
- {
- setOption(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);
- }
-
- 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;
- }
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
deleted file mode 100644
index 9abc94b3df..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/AMQConnection.java
+++ /dev/null
@@ -1,1289 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.AMQUndeliveredException;
-import org.apache.qpid.AMQUnresolvedAddressException;
-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.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-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.TxSelectBody;
-import org.apache.qpid.framing.TxSelectOkBody;
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.jms.ChannelLimitReachedException;
-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.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.net.ConnectException;
-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
-{
- private static final Logger _logger = LoggerFactory.getLogger(AMQConnection.class);
-
- private 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.
- */
- private 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.
- */
- private AMQProtocolHandler _protocolHandler;
-
- /** Maps from session id (Integer) to AMQSession instance */
- private final Map<Integer, AMQSession> _sessions = new LinkedHashMap<Integer, AMQSession>();
-
- 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;
-
- private 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.
- */
- private boolean _started;
-
- /** Policy dictating how to failover */
- private FailoverPolicy _failoverPolicy;
-
- /*
- * _Connected should be refactored with a suitable wait object.
- */
- private boolean _connected;
-
- /*
- * The last error code that occured on the connection. Used to return the correct exception to the client
- */
- private AMQException _lastAMQException = null;
-
- /*
- * 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;
-
- /**
- * @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);
- }
-
- public AMQConnection(ConnectionURL connectionURL, SSLConfiguration sslConfig) throws AMQException
- {
- 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();
- }
-
- _failoverPolicy = new FailoverPolicy(connectionURL);
-
- _protocolHandler = new AMQProtocolHandler(this);
-
- // We are not currently connected
- _connected = false;
-
- Exception lastException = new Exception();
- lastException.initCause(new ConnectException());
-
- while (!_connected && _failoverPolicy.failoverAllowed())
- {
- try
- {
- makeBrokerConnection(_failoverPolicy.getNextBrokerDetails());
- lastException = null;
- _connected = true;
- }
- catch (Exception e)
- {
- lastException = e;
-
- //We need to change protocol handler here as an error during the connect will not
- // cause the StateManager to be replaced. So the state is out of sync on reconnect
- // This can be seen when a exception occurs during connection. i.e. log4j NoSuchMethod. (using < 1.2.12)
- _protocolHandler.setStateManager(new AMQStateManager());
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("Unable to connect to broker at " + _failoverPolicy.getCurrentBrokerDetails(),
- e.getCause());
- }
- }
- }
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Are we connected:" + _connected);
- }
-
- if (!_connected)
- {
- String message = null;
-
- if (lastException != null)
- {
- if (lastException.getCause() != null)
- {
- message = lastException.getCause().getMessage();
- }
- else
- {
- message = lastException.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:" + lastException.getClass();
- }
- }
-
- AMQException e = new AMQConnectionFailureException(message);
-
- if (lastException != null)
- {
- if (lastException instanceof UnresolvedAddressException)
- {
- e = new AMQUnresolvedAddressException(message, _failoverPolicy.getCurrentBrokerDetails().toString());
- }
-
- e.initCause(lastException);
- }
-
- throw e;
- }
-
- _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));
- }
-
- 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.startsWith("/"))
- {
- virtualHost = virtualHost.substring(1);
- }
-
- _virtualHost = virtualHost;
- }
-
- private void makeBrokerConnection(BrokerDetails brokerDetail) throws IOException, AMQException
- {
- try
- {
- TransportConnection.getInstance(brokerDetail).connect(_protocolHandler, brokerDetail);
- // this blocks until the connection has been set up or when an error
- // has prevented the connection being set up
- _protocolHandler.attainState(AMQState.CONNECTION_OPEN);
- _failoverPolicy.attainedConnection();
-
- // Again this should be changed to a suitable notify
- _connected = true;
- }
- catch (AMQException e)
- {
- _lastAMQException = e;
- throw e;
- }
- }
-
- 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;
- }
-
- /**
- * 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, AMQSession.DEFAULT_PREFETCH_HIGH_MARK);
- }
-
- 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();
-
- if (channelLimitReached())
- {
- throw new ChannelLimitReachedException(_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 = _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(AMQConnection.this, channelId, transacted, acknowledgeMode, prefetchHigh,
- prefetchLow);
- // _protocolHandler.addSessionByChannel(channelId, session);
- 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)
- {
- deregisterSession(channelId);
- }
- }
-
- if (_started)
- {
- try
- {
- session.start();
- }
- catch (AMQException e)
- {
- throw new JMSAMQException(e);
- }
- }
-
- return session;
- }
- }, this).execute();
- }
- }
-
- private void createChannelOverWire(int channelId, int prefetchHigh, int prefetchLow, boolean transacted)
- throws AMQException, FailoverException
- {
-
- // TODO: Be aware of possible changes to parameter order as versions change.
-
- _protocolHandler.syncWrite(ChannelOpenBody.createAMQFrame(channelId, _protocolHandler.getProtocolMajorVersion(),
- _protocolHandler.getProtocolMinorVersion(), null), // outOfBand
- ChannelOpenOkBody.class);
-
- // todo send low water mark when protocol allows.
- // todo Be aware of possible changes to parameter order as versions change.
- _protocolHandler.syncWrite(BasicQosBody.createAMQFrame(channelId, _protocolHandler.getProtocolMajorVersion(),
- _protocolHandler.getProtocolMinorVersion(), false, // global
- prefetchHigh, // prefetchCount
- 0), // prefetchSize
- BasicQosOkBody.class);
-
- if (transacted)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Issuing TxSelect for " + channelId);
- }
-
- // TODO: Be aware of possible changes to parameter order as versions change.
- _protocolHandler.syncWrite(TxSelectBody.createAMQFrame(channelId, _protocolHandler.getProtocolMajorVersion(),
- _protocolHandler.getProtocolMinorVersion()), 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("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));
- }
-
- private 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.
- throw new IllegalStateException("Client name cannot be changed after being set");
- }
-
- 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)
- {
- final Iterator it = _sessions.entrySet().iterator();
- while (it.hasNext())
- {
- final AMQSession s = (AMQSession) ((Map.Entry) it.next()).getValue();
- try
- {
- s.start();
- }
- catch (AMQException e)
- {
- throw new JMSAMQException(e);
- }
- }
-
- _started = true;
- }
- }
-
- 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
- {
- synchronized(_sessionCreationLock)
- {
- if(!sessions.isEmpty())
- {
- AMQSession session = sessions.remove(0);
- synchronized(session.getMessageDeliveryLock())
- {
- close(sessions, timeout);
- }
- }
- else
- {
- synchronized (getFailoverMutex())
- {
- if (!_closed.getAndSet(true))
- {
- try
- {
- long startCloseTime = System.currentTimeMillis();
-
- _taskPool.shutdown();
- closeAllSessions(null, timeout, startCloseTime);
-
- 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);
-
- _protocolHandler.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)
- {
- 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 Map 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;
- }
-
- /**
- * 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
- {
- if (cause instanceof AMQException)
- {
- je =
- new JMSException(Integer.toString(((AMQException) cause).getErrorCode().getCode()),
- "Exception thrown against " + toString() + ": " + cause);
- }
- else
- {
- je = new JMSException("Exception thrown against " + toString() + ": " + cause);
- }
-
- if (cause instanceof Exception)
- {
- je.setLinkedException((Exception) 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 instanceof IOException)
- {
- _closed.set(true);
- }
-
- if (_exceptionListener != null)
- {
- _exceptionListener.onException(je);
- }
- else
- {
- _logger.error("Throwable Received but no listener set: " + cause.getMessage());
- }
-
- if (!(cause instanceof AMQUndeliveredException) && !(cause instanceof AMQAuthenticationException))
- {
- try
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Closing AMQConnection due to :" + cause.getMessage());
- }
-
- _closed.set(true);
- 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());
- }
- }
-
- void registerSession(int channelId, AMQSession session)
- {
- _sessions.put(channelId, session);
- }
-
- void deregisterSession(int channelId)
- {
- _sessions.remove(channelId);
- }
-
- /**
- * 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(_sessions.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();
- }
- }
-
- 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);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.java
deleted file mode 100644
index 7c0803a61a..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/AMQConnectionFactory.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 java.net.InetAddress;
-import java.net.UnknownHostException;
-import java.util.Hashtable;
-import java.util.UUID;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.JMSException;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.TopicConnection;
-import javax.jms.TopicConnectionFactory;
-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
-{
- private String _host;
- private int _port;
- private String _defaultUsername;
- private String _defaultPassword;
- private String _virtualPath;
-
- private ConnectionURL _connectionDetails;
- private SSLConfiguration _sslConfig;
-
- public AMQConnectionFactory()
- {
- }
-
- public AMQConnectionFactory(String url) throws URLSyntaxException
- {
- _connectionDetails = new AMQConnectionURL(url);
- }
-
- public AMQConnectionFactory(ConnectionURL url)
- {
- _connectionDetails = url;
- }
-
- 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 + "'"));
- }
-
- public AMQConnectionFactory(String host, int port, String virtualPath)
- {
- this(host, port, "guest", "guest", virtualPath);
- }
-
- 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;
- }
-
- 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
- {
- try
- {
- if (_connectionDetails != null)
- {
- _connectionDetails.setUsername(userName);
- _connectionDetails.setPassword(password);
-
- if (_connectionDetails.getClientName() == null || _connectionDetails.getClientName().equals(""))
- {
- _connectionDetails.setClientName(getUniqueClientID());
- }
- return new AMQConnection(_connectionDetails, _sslConfig);
- }
- else
- {
- return new AMQConnection(_host, _port, userName, password, 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(new AMQConnectionURL((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
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/AMQConnectionURL.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQConnectionURL.java
deleted file mode 100644
index 24f5ead2d0..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/AMQConnectionURL.java
+++ /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.
- *
- */
-package org.apache.qpid.client;
-
-import org.apache.qpid.framing.AMQShortString;
-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;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-public class AMQConnectionURL implements ConnectionURL
-{
- private static final Logger _logger = LoggerFactory.getLogger(AMQConnectionURL.class);
-
- private String _url;
- private String _failoverMethod;
- private HashMap<String, String> _failoverOptions;
- private HashMap<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
- {
- _url = fullURL;
- _options = new HashMap<String, String>();
- _brokers = new LinkedList<BrokerDetails>();
- _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.getScheme() == null) || !(connection.getScheme().equalsIgnoreCase(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
- {
- setClientName(uid);
- }
-
- }
- else
- {
- 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(AMQ_PROTOCOL.length() + 3, "User information not found on url", fullURL);
- }
- else
- {
- parseUserInfo(userInfo);
- }
-
- String virtualHost = connection.getPath();
-
- if ((virtualHost != null) && (!virtualHost.equals("")))
- {
- setVirtualHost(virtualHost);
- }
- else
- {
- int authLength = connection.getAuthority().length();
- int start = 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(_options, 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(AMQ_PROTOCOL.length() + 3, userinfo.length(),
- "Null password in user information not allowed.", _url);
- }
- else
- {
- setUsername(userinfo.substring(0, colonIndex));
- setPassword(userinfo.substring(colonIndex + 1));
- }
-
- }
-
- private void processOptions() throws URLSyntaxException
- {
- if (_options.containsKey(OPTIONS_BROKERLIST))
- {
- String brokerlist = _options.get(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();
-
- _brokers.add(new AMQBrokerDetails(broker));
- }
-
- _options.remove(OPTIONS_BROKERLIST);
- }
-
- if (_options.containsKey(OPTIONS_FAILOVER))
- {
- String failover = _options.get(OPTIONS_FAILOVER);
-
- // failover='method?option='value',option='value''
-
- int methodIndex = failover.indexOf('?');
-
- if (methodIndex > -1)
- {
- _failoverMethod = failover.substring(0, methodIndex);
- URLHelper.parseOptions(_failoverOptions, failover.substring(methodIndex + 1));
- }
- else
- {
- _failoverMethod = failover;
- }
-
- _options.remove(OPTIONS_FAILOVER);
- }
-
- if (_options.containsKey(OPTIONS_DEFAULT_TOPIC_EXCHANGE))
- {
- _defaultTopicExchangeName = new AMQShortString(_options.get(OPTIONS_DEFAULT_TOPIC_EXCHANGE));
- }
-
- if (_options.containsKey(OPTIONS_DEFAULT_QUEUE_EXCHANGE))
- {
- _defaultQueueExchangeName = new AMQShortString(_options.get(OPTIONS_DEFAULT_QUEUE_EXCHANGE));
- }
-
- if (_options.containsKey(OPTIONS_TEMPORARY_QUEUE_EXCHANGE))
- {
- _temporaryQueueExchangeName = new AMQShortString(_options.get(OPTIONS_TEMPORARY_QUEUE_EXCHANGE));
- }
-
- if (_options.containsKey(OPTIONS_TEMPORARY_TOPIC_EXCHANGE))
- {
- _temporaryTopicExchangeName = new AMQShortString(_options.get(OPTIONS_TEMPORARY_TOPIC_EXCHANGE));
- }
- }
-
- public String getURL()
- {
- return _url;
- }
-
- public String getFailoverMethod()
- {
- return _failoverMethod;
- }
-
- 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 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 AMQShortString getDefaultTopicExchangeName()
- {
- return _defaultTopicExchangeName;
- }
-
- public AMQShortString getTemporaryQueueExchangeName()
- {
- return _temporaryQueueExchangeName;
- }
-
- public AMQShortString getTemporaryTopicExchangeName()
- {
- return _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(':');
- if (_logger.isDebugEnabled())
- {
- sb.append(_password);
- }
- else
- {
- 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?brokerlist='tcp://localhost:5672;jcp://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/Final/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java
deleted file mode 100644
index cc5af07b20..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/AMQDestination.java
+++ /dev/null
@@ -1,451 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.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;
-import org.apache.qpid.url.URLSyntaxException;
-
-
-public abstract class AMQDestination implements Destination, Referenceable
-{
- protected final AMQShortString _exchangeName;
-
- protected final AMQShortString _exchangeClass;
-
- protected final AMQShortString _destinationName;
-
- protected final boolean _isDurable;
-
- protected final boolean _isExclusive;
-
- protected final boolean _isAutoDelete;
-
- private AMQShortString _queueName;
-
- private String _url;
- private AMQShortString _urlAsShortString;
-
- private boolean _validated;
-
- 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 Integer QUEUE_TYPE = Integer.valueOf(1);
- public static final Integer TOPIC_TYPE = Integer.valueOf(2);
- public static final Integer UNKNOWN_TYPE = Integer.valueOf(3);
-
- protected AMQDestination(String url) throws URLSyntaxException
- {
- this(new AMQBindingURL(url));
- }
-
- protected AMQDestination(BindingURL binding)
- {
- _exchangeName = binding.getExchangeName();
- _exchangeClass = binding.getExchangeClass();
- _destinationName = binding.getDestinationName();
-
- _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 : new AMQShortString(binding.getQueueName());
- }
-
- protected AMQDestination(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString destinationName, AMQShortString queueName)
- {
- this(exchangeName, exchangeClass, destinationName, false, false, queueName);
- }
-
- protected AMQDestination(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString destinationName)
- {
- this(exchangeName, exchangeClass, destinationName, false, false, null);
- }
-
- protected AMQDestination(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString destinationName, boolean isExclusive,
- boolean isAutoDelete, AMQShortString queueName)
- {
- this(exchangeName, exchangeClass, destinationName, isExclusive, isAutoDelete, queueName, false);
- }
-
- protected AMQDestination(AMQShortString exchangeName, AMQShortString exchangeClass, AMQShortString destinationName, boolean isExclusive,
- boolean isAutoDelete, AMQShortString queueName, boolean isDurable)
- {
- if (destinationName == null)
- {
- throw new IllegalArgumentException("Destination exchange must not be null");
- }
- if (exchangeName == null)
- {
- throw new IllegalArgumentException("Exchange exchange must not be null");
- }
- if (exchangeClass == null)
- {
- throw new IllegalArgumentException("Exchange class must not be null");
- }
- _exchangeName = exchangeName;
- _exchangeClass = exchangeClass;
- _destinationName = destinationName;
- _isExclusive = isExclusive;
- _isAutoDelete = isAutoDelete;
- _queueName = queueName;
- _isDurable = isDurable;
- }
-
- 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 AMQShortString getDestinationName()
- {
- return _destinationName;
- }
-
- 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 abstract AMQShortString getRoutingKey();
-
- public boolean isExclusive()
- {
- return _isExclusive;
- }
-
- public boolean isAutoDelete()
- {
- return _isAutoDelete;
- }
-
- public abstract boolean isNameRequired();
-
- public String toString()
- {
- return toURL();
-
- }
-
- public boolean isValidated()
- {
- return _validated;
- }
-
- public void setValidated(boolean validated)
- {
- _validated = validated;
- }
-
- public String toURL()
- {
- String url = _url;
- if(url == null)
- {
-
-
- StringBuffer sb = new StringBuffer();
-
- sb.append(_exchangeClass);
- sb.append("://");
- sb.append(_exchangeName);
-
- sb.append('/');
-
- if (_destinationName != null)
- {
- sb.append(_destinationName);
- }
-
- sb.append('/');
-
- if (_queueName != null)
- {
- sb.append(_queueName);
- }
-
- sb.append('?');
-
- 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 +
- (_destinationName == null ? 0 : _destinationName.length()) + 1 +
- (_queueName == null ? 0 : _queueName.length()) + 1 +
- 1;
- encoding = new byte[size];
- int pos = 0;
-
- pos = _exchangeClass.writeToByteArray(encoding, pos);
- pos = _exchangeName.writeToByteArray(encoding, pos);
- if(_destinationName == null)
- {
- encoding[pos++] = (byte)0;
- }
- else
- {
- pos = _destinationName.writeToByteArray(encoding,pos);
- }
- 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 (!_destinationName.equals(that._destinationName))
- {
- return false;
- }
- 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 destinationName;
- 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;
- destinationName = AMQShortString.readFromByteArray(byteEncodedDestination, pos);
- pos+= (destinationName == null ? 0 : destinationName.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,destinationName,queueName,isExclusive,isAutoDelete,isDurable);
- }
- else if (exchangeClass.equals(ExchangeDefaults.TOPIC_EXCHANGE_CLASS))
- {
- return new AMQTopic(exchangeName,destinationName,isAutoDelete,queueName,isDurable);
- }
- else if (exchangeClass.equals(ExchangeDefaults.HEADERS_EXCHANGE_CLASS))
- {
- return new AMQHeadersExchange(destinationName);
- }
- 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
- {
- throw new IllegalArgumentException("Unknown Exchange Class:" + type + " in binding:" + binding);
- }
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.java
deleted file mode 100644
index 1a2fe0d355..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/AMQHeadersExchange.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;
-
-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 AMQShortString getRoutingKey()
- {
- return getDestinationName();
- }
-
- 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 false;
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/AMQNoConsumersException.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQNoConsumersException.java
deleted file mode 100644
index 54d5a0426f..0000000000
--- a/Final/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)
- {
- super(AMQConstant.NO_CONSUMERS, msg, bounced);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/AMQNoRouteException.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQNoRouteException.java
deleted file mode 100644
index a314101acf..0000000000
--- a/Final/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)
- {
- super(AMQConstant.NO_ROUTE, msg, bounced);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/AMQQueue.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQQueue.java
deleted file mode 100644
index 9185bc87e8..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/AMQQueue.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;
-
-import javax.jms.Queue;
-import javax.jms.Connection;
-
-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); }
-
-
- /**
- * 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 destinationName the queue name
- * @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 destinationName, AMQShortString queueName, boolean exclusive, boolean autoDelete)
- {
- this(exchangeName, destinationName, queueName, exclusive, autoDelete, false);
- }
-
-
- public AMQQueue(AMQShortString exchangeName, AMQShortString destinationName, AMQShortString queueName, boolean exclusive, boolean autoDelete, boolean durable)
- {
- super(exchangeName, ExchangeDefaults.DIRECT_EXCHANGE_CLASS, destinationName, exclusive,
- autoDelete, queueName, durable);
- }
-
-
-
- public AMQShortString getRoutingKey()
- {
- return getAMQQueueName();
- }
-
- 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/Final/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.java
deleted file mode 100644
index 28e5992b26..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/AMQQueueBrowser.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;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-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);
- 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.receive();
-
- 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();
- _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/Final/java/client/src/main/java/org/apache/qpid/client/AMQQueueSessionAdaptor.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQQueueSessionAdaptor.java
deleted file mode 100644
index a8c83d8868..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/AMQSession.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
deleted file mode 100644
index a0b79b135d..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/AMQSession.java
+++ /dev/null
@@ -1,2800 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.AMQInvalidArgumentException;
-import org.apache.qpid.AMQInvalidRoutingKeyException;
-import org.apache.qpid.AMQUndeliveredException;
-import org.apache.qpid.AMQDisconnectedException;
-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.AbstractJMSMessage;
-import org.apache.qpid.client.message.JMSBytesMessage;
-import org.apache.qpid.client.message.JMSMapMessage;
-import org.apache.qpid.client.message.JMSObjectMessage;
-import org.apache.qpid.client.message.JMSStreamMessage;
-import org.apache.qpid.client.message.JMSTextMessage;
-import org.apache.qpid.client.message.MessageFactoryRegistry;
-import org.apache.qpid.client.message.UnprocessedMessage;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.util.FlowControllingBlockingQueue;
-import org.apache.qpid.common.AMQPFilterTypes;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicAckBody;
-import org.apache.qpid.framing.BasicConsumeBody;
-import org.apache.qpid.framing.BasicConsumeOkBody;
-import org.apache.qpid.framing.BasicRecoverBody;
-import org.apache.qpid.framing.BasicRecoverOkBody;
-import org.apache.qpid.framing.BasicRejectBody;
-import org.apache.qpid.framing.ChannelCloseBody;
-import org.apache.qpid.framing.ChannelCloseOkBody;
-import org.apache.qpid.framing.ChannelFlowBody;
-import org.apache.qpid.framing.ChannelFlowOkBody;
-import org.apache.qpid.framing.ExchangeBoundBody;
-import org.apache.qpid.framing.ExchangeBoundOkBody;
-import org.apache.qpid.framing.ExchangeDeclareBody;
-import org.apache.qpid.framing.ExchangeDeclareOkBody;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.FieldTableFactory;
-import org.apache.qpid.framing.QueueBindBody;
-import org.apache.qpid.framing.QueueBindOkBody;
-import org.apache.qpid.framing.QueueDeclareBody;
-import org.apache.qpid.framing.QueueDeclareOkBody;
-import org.apache.qpid.framing.QueueDeleteBody;
-import org.apache.qpid.framing.QueueDeleteOkBody;
-import org.apache.qpid.framing.TxCommitBody;
-import org.apache.qpid.framing.TxCommitOkBody;
-import org.apache.qpid.framing.TxRollbackBody;
-import org.apache.qpid.framing.TxRollbackOkBody;
-import org.apache.qpid.jms.Session;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.url.AMQBindingURL;
-import org.apache.qpid.url.URLSyntaxException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-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 java.io.Serializable;
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * <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 class AMQSession extends Closeable implements Session, QueueSession, TopicSession
-{
- /** Used for debugging. */
- private static final Logger _logger = LoggerFactory.getLogger(AMQSession.class);
-
- /** Used for debugging in the dispatcher. */
- private static final Logger _dispatcherLogger = LoggerFactory.getLogger(Dispatcher.class);
-
- /** The default maximum number of prefetched message at which to suspend the channel. */
- public static final int DEFAULT_PREFETCH_HIGH_MARK = 5000;
-
- /** The default minimum number of prefetched messages at which to resume the channel. */
- public static final int DEFAULT_PREFETCH_LOW_MARK = 2500;
-
- /**
- * 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. */
- private AMQConnection _connection;
-
- /** Used to indicate whether or not this is a transactional session. */
- private boolean _transacted;
-
- /** Holds the sessions acknowledgement mode. */
- private int _acknowledgeMode;
-
- /** Holds this session unique identifier, used to distinguish it from other sessions. */
- private int _channelId;
-
- /** @todo This does not appear to be set? */
- private int _ticket;
-
- /** Holds the high mark for prefetched message, at which the session is suspended. */
- private int _defaultPrefetchHighMark = DEFAULT_PREFETCH_HIGH_MARK;
-
- /** Holds the low mark for prefetched messages, below which the session is resumed. */
- private int _defaultPrefetchLowMark = DEFAULT_PREFETCH_LOW_MARK;
-
- /** 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.
- */
- private 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.
- */
- private final ConcurrentHashMap<BasicMessageConsumer, String> _reverseSubscriptionMap =
- new ConcurrentHashMap<BasicMessageConsumer, String>();
-
- /**
- * Used to hold incoming messages.
- *
- * @todo Weaken the type once {@link FlowControllingBlockingQueue} implements Queue.
- */
- private final FlowControllingBlockingQueue _queue;
-
- /** Holds the highest received delivery tag. */
- private final AtomicLong _highestDeliveryTag = new AtomicLong(-1);
-
- /** Holds the dispatcher thread for this session. */
- private Dispatcher _dispatcher;
-
- /** Holds the message factory factory for this session. */
- private 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.
- */
- private Map<AMQShortString, BasicMessageConsumer> _consumers =
- new ConcurrentHashMap<AMQShortString, BasicMessageConsumer>();
-
- /** 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.
- */
- private final AtomicBoolean _firstDispatcher = new AtomicBoolean(true);
-
- /** Used to indicate that the session should start pre-fetching messages as soon as it is started. */
- private final boolean _immediatePrefetch;
-
- /** Indicates that warnings should be generated on violations of the strict AMQP. */
- private final boolean _strictAMQP;
-
- /** Indicates that runtime exceptions should be generated on vilations of the strict AMQP. */
- private final boolean _strictAMQPFATAL;
- private final Object _messageDeliveryLock = new Object();
-
- /**
- * 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(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()
- {
- public void aboveThreshold(int currentValue)
- {
- if (_acknowledgeMode == NO_ACKNOWLEDGE)
- {
- _logger.debug(
- "Above threshold(" + _defaultPrefetchHighMark
- + ") so suspending channel. Current value is " + currentValue);
- new Thread(new SuspenderRunner(true)).start();
- }
- }
-
- public void underThreshold(int currentValue)
- {
- if (_acknowledgeMode == NO_ACKNOWLEDGE)
- {
- _logger.debug(
- "Below threshold(" + _defaultPrefetchLowMark
- + ") so unsuspending channel. Current value is " + currentValue);
- new Thread(new SuspenderRunner(false)).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 BytesMessage createBytesMessage() throws JMSException
- {
- checkNotClosed();
- return new JMSBytesMessage();
- }
-
- /**
- * 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");
- }
-
- for (BasicMessageConsumer consumer : _consumers.values())
- {
- consumer.acknowledge();
- }
- }
-
- /**
- * 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 void acknowledgeMessage(long deliveryTag, boolean multiple)
- {
- final AMQFrame ackFrame =
- BasicAckBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(), deliveryTag,
- multiple);
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Sending ack for delivery tag " + deliveryTag + " on channel " + _channelId);
- }
-
- getProtocolHandler().writeFrame(ackFrame);
- }
-
- /**
- * 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) throws AMQException
- {
- /*new FailoverRetrySupport<Object, AMQException>(new FailoverProtectedOperation<Object, AMQException>()*/
- new FailoverNoopSupport<Object, AMQException>(new FailoverProtectedOperation<Object, AMQException>()
- {
- public Object execute() throws AMQException, FailoverException
- {
- AMQFrame queueBind =
- QueueBindBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(),
- arguments, // arguments
- exchangeName, // exchange
- false, // nowait
- queueName, // queue
- routingKey, // routingKey
- getTicket()); // ticket
-
- getProtocolHandler().syncWrite(queueBind, QueueBindOkBody.class);
-
- return null;
- }
- }, _connection).execute();
- }
-
- /**
- * 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));
- }
-
- synchronized (_connection.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)
- {
- // Ensure we only try and close an open session.
- if (!_closed.getAndSet(true))
- {
- // we pass null since this is not an error case
- closeProducersAndConsumers(null);
-
- try
- {
-
- getProtocolHandler().closeSession(this);
-
- final AMQFrame frame =
- ChannelCloseBody.createAMQFrame(getChannelId(), getProtocolMajorVersion(), getProtocolMinorVersion(),
- 0, // classId
- 0, // methodId
- AMQConstant.REPLY_SUCCESS.getCode(), // replyCode
- new AMQShortString("JMS client closing channel")); // replyText
-
- getProtocolHandler().syncWrite(frame, ChannelCloseOkBody.class, timeout);
-
- // When control resumes at this point, a reply will have been received that
- // indicates the broker has closed the channel successfully.
- }
- 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);
- }
- }
- }
- }
- }
-
- /**
- * 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
- {
- synchronized (_connection.getFailoverMutex())
- {
- if (e instanceof AMQDisconnectedException)
- {
- if (_dispatcher != null)
- {
- // Failover failed and ain't coming back. Knife the dispatcher.
- _dispatcher.interrupt();
- }
- }
- 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
- _closed.set(true);
- 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
- {
- // Acknowledge up to message last delivered (if any) for each consumer.
- // need to send ack for messages delivered to consumers so far
- for (Iterator<BasicMessageConsumer> i = _consumers.values().iterator(); i.hasNext();)
- {
- // Sends acknowledgement to server
- i.next().acknowledgeLastDelivered();
- }
-
- // Commits outstanding messages sent and outstanding acknowledgements.
- final AMQProtocolHandler handler = getProtocolHandler();
-
- handler.syncWrite(TxCommitBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion()),
- TxCommitOkBody.class);
- }
- 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 void confirmConsumerCancelled(AMQShortString consumerTag)
- {
-
- // Remove the consumer from the map
- BasicMessageConsumer consumer = (BasicMessageConsumer) _consumers.get(consumerTag);
- if (consumer != null)
- {
- // fixme this isn't right.. needs to check if _queue contains data for this consumer
- if (consumer.isAutoClose()) // && _queue.isEmpty())
- {
- consumer.closeWhenNoMessages(true);
- }
-
- if (!consumer.isNoConsume())
- {
- // 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");
- startDistpatcherIfNecessary(true);
- }
-
- _dispatcher.rejectPending(consumer);
- }
- else
- {
- // 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();
- }
- }
- else
- {
- _logger.warn("Unable to confirm cancellation of consumer (" + consumerTag + "). Not found in consumer map.");
- }
-
- }
-
- 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, false, null, null,
- false, false);
- }
-
- public MessageConsumer createConsumer(Destination destination, String messageSelector) throws JMSException
- {
- checkValidDestination(destination);
-
- return createConsumerImpl(destination, _defaultPrefetchHighMark, _defaultPrefetchLowMark, false, false,
- messageSelector, null, false, false);
- }
-
- public MessageConsumer createConsumer(Destination destination, String messageSelector, boolean noLocal)
- throws JMSException
- {
- checkValidDestination(destination);
-
- return createConsumerImpl(destination, _defaultPrefetchHighMark, _defaultPrefetchLowMark, noLocal, false,
- 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, 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, 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 TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException
- {
-
- checkNotClosed();
- AMQTopic origTopic = checkValidTopic(topic);
- AMQTopic dest = AMQTopic.createDurableTopic(origTopic, name, _connection);
- TopicSubscriberAdaptor 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).getDestinationName();
- }
- 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;
- }
-
- /** Note, currently this does not handle reuse of the same name with different topics correctly. */
- public TopicSubscriber createDurableSubscriber(Topic topic, String name, String messageSelector, boolean noLocal)
- throws JMSException
- {
- checkNotClosed();
- checkValidTopic(topic);
- AMQTopic dest = AMQTopic.createDurableTopic((AMQTopic) topic, name, _connection);
- BasicMessageConsumer consumer = (BasicMessageConsumer) createConsumer(dest, messageSelector, noLocal);
- TopicSubscriberAdaptor 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();
- }
-
- public javax.jms.Message createMessage() throws JMSException
- {
- return createBytesMessage();
- }
-
- public ObjectMessage createObjectMessage() throws JMSException
- {
- checkNotClosed();
- return (ObjectMessage) new JMSObjectMessage();
- }
-
- public ObjectMessage createObjectMessage(Serializable object) throws JMSException
- {
- ObjectMessage msg = createObjectMessage();
- msg.setObject(object);
-
- return msg;
- }
-
- public BasicMessageProducer createProducer(Destination destination) throws JMSException
- {
- return createProducerImpl(destination, DEFAULT_MANDATORY, DEFAULT_IMMEDIATE);
- }
-
- public BasicMessageProducer createProducer(Destination destination, boolean immediate) throws JMSException
- {
- return createProducerImpl(destination, DEFAULT_MANDATORY, immediate);
- }
-
- public BasicMessageProducer createProducer(Destination destination, boolean mandatory, boolean immediate)
- throws JMSException
- {
- return createProducerImpl(destination, mandatory, immediate);
- }
-
- public BasicMessageProducer 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((BasicMessageProducer) createProducer(topic), 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 (URLSyntaxException 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
- {
- new FailoverRetrySupport<Object, AMQException>(new FailoverProtectedOperation<Object, AMQException>()
- {
- public Object execute() throws AMQException, FailoverException
- {
- AMQFrame queueDeclare =
- QueueDeclareBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(),
- null, // arguments
- autoDelete, // autoDelete
- durable, // durable
- exclusive, // exclusive
- false, // nowait
- false, // passive
- name, // queue
- getTicket()); // ticket
-
- getProtocolHandler().syncWrite(queueDeclare, QueueDeclareOkBody.class);
-
- return null;
- }
- }, _connection).execute();
- }
-
- /**
- * 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;
- BasicMessageConsumer consumer = (BasicMessageConsumer) 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;
- BasicMessageConsumer consumer = (BasicMessageConsumer) 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;
- BasicMessageConsumer consumer = (BasicMessageConsumer) 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;
- BasicMessageConsumer consumer = (BasicMessageConsumer) 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
- {
- synchronized (_connection.getFailoverMutex())
- {
- checkNotClosed();
-
- return new JMSStreamMessage();
- }
- }
-
- /**
- * 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, (BasicMessageConsumer) createConsumer(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, (BasicMessageConsumer) createConsumer(dest, messageSelector, noLocal));
- }
-
- public TemporaryQueue createTemporaryQueue() throws JMSException
- {
- checkNotClosed();
-
- return new AMQTemporaryQueue(this);
- }
-
- public TemporaryTopic createTemporaryTopic() throws JMSException
- {
- checkNotClosed();
-
- return new AMQTemporaryTopic(this);
- }
-
- public TextMessage createTextMessage() throws JMSException
- {
- synchronized (_connection.getFailoverMutex())
- {
- checkNotClosed();
-
- return new JMSTextMessage();
- }
- }
-
- 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 (URLSyntaxException 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;
- }
-
- /**
- * 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.getDeliverBody() == null) ? ("B:" + message.getBounceBody()) : ("D:" + message.getDeliverBody()))
- + "] received in session with channel id " + _channelId);
- }
-
- if (message.getDeliverBody() == null)
- {
- // Return of the bounced message.
- returnBouncedMessage(message);
- }
- else
- {
- _highestDeliveryTag.set(message.getDeliverBody().deliveryTag);
- _queue.add(message);
- }
- }
-
- /**
- * 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);
- }
-
- for (BasicMessageConsumer consumer : _consumers.values())
- {
- consumer.clearUnackedMessages();
- }
-
- if (_dispatcher != null)
- {
- _dispatcher.rollback();
- }
-
- if (isStrictAMQP())
- {
- // We can't use the BasicRecoverBody-OK method as it isn't part of the spec.
- _connection.getProtocolHandler().writeFrame(BasicRecoverBody.createAMQFrame(_channelId,
- getProtocolMajorVersion(), getProtocolMinorVersion(), false)); // requeue
- _logger.warn("Session Recover cannot be guaranteed with STRICT_AMQP. Messages may arrive out of order.");
- }
- else
- {
-
- _connection.getProtocolHandler().syncWrite(
- BasicRecoverBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(), false) // requeue
- , BasicRecoverOkBody.class);
- }
-
- 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);
- }
- }
-
- public void rejectMessage(UnprocessedMessage message, boolean requeue)
- {
-
- if (_logger.isTraceEnabled())
- {
- _logger.trace("Rejecting Unacked message:" + message.getDeliverBody().deliveryTag);
- }
-
- rejectMessage(message.getDeliverBody().deliveryTag, requeue);
- }
-
- public void rejectMessage(AbstractJMSMessage message, boolean requeue)
- {
- if (_logger.isTraceEnabled())
- {
- _logger.trace("Rejecting Abstract message:" + message.getDeliveryTag());
- }
-
- rejectMessage(message.getDeliveryTag(), requeue);
-
- }
-
- 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());
- }
-
- AMQFrame basicRejectBody =
- BasicRejectBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(), deliveryTag,
- requeue);
-
- _connection.getProtocolHandler().writeFrame(basicRejectBody);
- }
- }
-
- /**
- * 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);
- }
-
- if (_dispatcher != null)
- {
- _dispatcher.rollback();
- }
-
- _connection.getProtocolHandler().syncWrite(TxRollbackBody.createAMQFrame(_channelId,
- getProtocolMajorVersion(), getProtocolMinorVersion()), TxRollbackOkBody.class);
-
- 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 void run()
- {
- throw new java.lang.UnsupportedOperationException();
- }
-
- public void setMessageListener(MessageListener listener) throws JMSException
- {
- // checkNotClosed();
- //
- // if (_dispatcher != null && !_dispatcher.connectionStopped())
- // {
- // throw new javax.jms.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.jms.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
- {
-
- if (isQueueBound(getDefaultTopicExchangeName(), AMQTopic.getDurableTopicQueueName(name, _connection)))
- {
- deleteQueue(AMQTopic.getDurableTopicQueueName(name, _connection));
- }
- else
- {
- throw new InvalidDestinationException("Unknown subscription exchange:" + name);
- }
- }
- }
- }
-
- protected MessageConsumer 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<MessageConsumer, JMSException>(
- new FailoverProtectedOperation<MessageConsumer, JMSException>()
- {
- public MessageConsumer 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());
- if (rawSelector != null)
- {
- ft.addAll(rawSelector);
- }
-
- BasicMessageConsumer consumer =
- new BasicMessageConsumer(_channelId, _connection, amqd, messageSelector, noLocal,
- _messageFactoryRegistry, AMQSession.this, protocolHandler, ft, prefetchHigh, prefetchLow,
- exclusive, _acknowledgeMode, 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);
-
- if (_logger.isDebugEnabled())
- {
- e.printStackTrace();
- }
-
- ex.setLinkedException(e);
- throw ex;
- }
-
- synchronized (destination)
- {
- _destinationConsumerCount.putIfAbsent(destination, new AtomicInteger());
- _destinationConsumerCount.get(destination).incrementAndGet();
- }
-
- return consumer;
- }
- }, _connection).execute();
- }
-
- /**
- * Called by the MessageConsumer when closing, to deregister the consumer from the map from consumerTag to consumer
- * instance.
- *
- * @param consumer the consum
- */
- void deregisterConsumer(BasicMessageConsumer 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);
- }
- }
- }
- }
-
- 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.
- */
- 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 =
- ExchangeBoundBody.createAMQFrame(_channelId, getProtocolMajorVersion(),
- getProtocolMinorVersion(), exchangeName, // exchange
- queueName, // queue
- routingKey); // routingKey
-
- return getProtocolHandler().syncWrite(boundFrame, ExchangeBoundOkBody.class);
-
- }
- }, _connection).execute();
-
- // Extract and return the response code from the query.
- ExchangeBoundOkBody responseBody = (ExchangeBoundOkBody) response.getMethod();
-
- return (responseBody.replyCode == 0);
- }
- catch (AMQException e)
- {
- throw new JMSAMQException("Queue bound query failed: " + e.getMessage(), e);
- }
- }
-
- /**
- * 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
- {
- 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())
- {
- startDistpatcherIfNecessary();
- }
- }
-
- void startDistpatcherIfNecessary()
- {
- //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);
- }
- }
- }
-
- startDistpatcherIfNecessary(false);
- }
-
- synchronized void startDistpatcherIfNecessary(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");
- }
- }
- }
-
- private 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
- */
- private 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<BasicMessageConsumer> clonedConsumers = new ArrayList<BasicMessageConsumer>(_consumers.values());
-
- final Iterator<BasicMessageConsumer> it = clonedConsumers.iterator();
- while (it.hasNext())
- {
- final BasicMessageConsumer 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 BasicMessageProducer prod = (BasicMessageProducer) 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(BasicMessageConsumer consumer, AMQShortString queueName,
- AMQProtocolHandler protocolHandler, boolean nowait, String messageSelector) throws AMQException, FailoverException
- {
- // need to generate a consumer tag on the client so we can exploit the nowait flag
- AMQShortString tag = new AMQShortString(Integer.toString(_nextTag++));
-
- 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);
- }
-
- consumer.setConsumerTag(tag);
- // we must register the consumer in the map before we actually start listening
- _consumers.put(tag, consumer);
-
- try
- {
- // TODO: Be aware of possible changes to parameter order as versions change.
- AMQFrame jmsConsume =
- BasicConsumeBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(), arguments, // arguments
- tag, // consumerTag
- consumer.isExclusive(), // exclusive
- consumer.getAcknowledgeMode() == Session.NO_ACKNOWLEDGE, // noAck
- consumer.isNoLocal(), // noLocal
- nowait, // nowait
- queueName, // queue
- getTicket()); // ticket
-
- if (nowait)
- {
- protocolHandler.writeFrame(jmsConsume);
- }
- else
- {
- protocolHandler.syncWrite(jmsConsume, BasicConsumeOkBody.class);
- }
- }
- catch (AMQException e)
- {
- // clean-up the map in the event of an error
- _consumers.remove(tag);
- throw e;
- }
- }
-
- private BasicMessageProducer createProducerImpl(Destination destination, boolean mandatory, boolean immediate)
- throws JMSException
- {
- return createProducerImpl(destination, mandatory, immediate, false);
- }
-
- private BasicMessageProducer createProducerImpl(final Destination destination, final boolean mandatory,
- final boolean immediate, final boolean waitUntilSent) throws JMSException
- {
- return new FailoverRetrySupport<BasicMessageProducer, JMSException>(
- new FailoverProtectedOperation<BasicMessageProducer, JMSException>()
- {
- public BasicMessageProducer execute() throws JMSException, FailoverException
- {
- checkNotClosed();
- long producerId = getNextProducerId();
- BasicMessageProducer producer =
- new BasicMessageProducer(_connection, (AMQDestination) destination, _transacted, _channelId,
- AMQSession.this, getProtocolHandler(), producerId, immediate, mandatory, waitUntilSent);
- registerProducer(producerId, producer);
-
- return producer;
- }
- }, _connection).execute();
- }
-
- private void declareExchange(AMQDestination amqd, AMQProtocolHandler protocolHandler, boolean nowait) throws AMQException
- {
- declareExchange(amqd.getExchangeName(), amqd.getExchangeClass(), protocolHandler, nowait);
- }
-
- /**
- * 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
- {
- AMQFrame exchangeDeclare =
- ExchangeDeclareBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(),
- null, // arguments
- false, // autoDelete
- false, // durable
- name, // exchange
- false, // internal
- nowait, // nowait
- false, // passive
- getTicket(), // ticket
- type); // type
-
- protocolHandler.syncWrite(exchangeDeclare, ExchangeDeclareOkBody.class);
-
- return null;
- }
- }, _connection).execute();
- }
-
- /**
- * 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.
- */
- private AMQShortString declareQueue(final AMQDestination amqd, final AMQProtocolHandler protocolHandler)
- 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());
- }
-
- AMQFrame queueDeclare =
- QueueDeclareBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(),
- null, // arguments
- amqd.isAutoDelete(), // autoDelete
- amqd.isDurable(), // durable
- amqd.isExclusive(), // exclusive
- false, // nowait
- false, // passive
- amqd.getAMQQueueName(), // queue
- getTicket()); // ticket
-
- protocolHandler.syncWrite(queueDeclare, QueueDeclareOkBody.class);
-
- return amqd.getAMQQueueName();
- }
- }, _connection).execute();
- }
-
- /**
- * 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.
- */
- private void deleteQueue(final AMQShortString queueName) throws JMSException
- {
- try
- {
- new FailoverRetrySupport<Object, AMQException>(new FailoverProtectedOperation<Object, AMQException>()
- {
- public Object execute() throws AMQException, FailoverException
- {
- AMQFrame queueDeleteFrame =
- QueueDeleteBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(),
- false, // ifEmpty
- false, // ifUnused
- true, // nowait
- queueName, // queue
- getTicket()); // ticket
-
- getProtocolHandler().syncWrite(queueDeleteFrame, QueueDeleteOkBody.class);
-
- return null;
- }
- }, _connection).execute();
- }
- catch (AMQException e)
- {
- throw new JMSAMQException("The queue deletion failed: " + e.getMessage(), e);
- }
- }
-
- private long getNextProducerId()
- {
- return ++_nextProducerId;
- }
-
- private AMQProtocolHandler getProtocolHandler()
- {
- return _connection.getProtocolHandler();
- }
-
- private byte getProtocolMajorVersion()
- {
- return getProtocolHandler().getProtocolMajorVersion();
- }
-
- private byte getProtocolMinorVersion()
- {
- return getProtocolHandler().getProtocolMinorVersion();
- }
-
- private 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<BasicMessageConsumer> clonedConsumers = new ArrayList<BasicMessageConsumer>(_consumers.values());
-
- final Iterator<BasicMessageConsumer> it = clonedConsumers.iterator();
- while (it.hasNext())
- {
- final BasicMessageConsumer 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);
- }
- }
-
- public void declareAndBind(AMQDestination amqd)
- throws
- AMQException
- {
- AMQProtocolHandler protocolHandler = getProtocolHandler();
- declareExchange(amqd, protocolHandler, false);
- AMQShortString queueName = declareQueue(amqd, protocolHandler);
- bindQueue(queueName, amqd.getRoutingKey(), new FieldTable(), amqd.getExchangeName());
- }
-
- /**
- * Callers must hold the failover mutex before calling this method.
- *
- * @param consumer
- *
- * @throws AMQException
- */
- private void registerConsumer(BasicMessageConsumer consumer, boolean nowait) throws AMQException // , FailoverException
- {
- AMQDestination amqd = consumer.getDestination();
-
- AMQProtocolHandler protocolHandler = getProtocolHandler();
-
- declareExchange(amqd, protocolHandler, false);
-
- AMQShortString queueName = declareQueue(amqd, protocolHandler);
-
- // bindQueue(amqd, queueName, protocolHandler, consumer.getRawSelectorFieldTable());
- bindQueue(queueName, amqd.getRoutingKey(), consumer.getRawSelectorFieldTable(), amqd.getExchangeName());
-
- // 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(e.getMessage(), e);
- }
- catch (FailoverException e)
- {
- throw new AMQException("Fail-over exception interrupted basic consume.", e);
- }
- }
-
- private void registerProducer(long producerId, MessageProducer producer)
- {
- _producers.put(new Long(producerId), producer);
- }
-
- /**
- * @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)
- */
-
- private void rejectMessagesForConsumerTag(AMQShortString consumerTag, boolean requeue)
- {
- 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 ((consumerTag == null) || message.getDeliverBody().consumerTag.equals(consumerTag))
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Removing message(" + System.identityHashCode(message) + ") from _queue DT:"
- + message.getDeliverBody().deliveryTag);
- }
-
- messages.remove();
-
- rejectMessage(message, requeue);
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Rejected the message(" + message.getDeliverBody() + ") for consumer :" + consumerTag);
- }
- }
- }
- }
-
- private void resubscribeConsumers() throws AMQException
- {
- ArrayList consumers = new ArrayList(_consumers.values());
- _consumers.clear();
-
- for (Iterator it = consumers.iterator(); it.hasNext();)
- {
- BasicMessageConsumer consumer = (BasicMessageConsumer) it.next();
- 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();)
- {
- BasicMessageProducer producer = (BasicMessageProducer) it.next();
- producer.resubscribe();
- }
- }
-
- private void returnBouncedMessage(final UnprocessedMessage message)
- {
- _connection.performConnectionTask(new Runnable()
- {
- public void run()
- {
- try
- {
- // Bounced message is processed here, away from the mina thread
- AbstractJMSMessage bouncedMessage =
- _messageFactoryRegistry.createMessage(0, false, message.getBounceBody().exchange,
- message.getBounceBody().routingKey, message.getContentHeader(), message.getBodies());
-
- AMQConstant errorCode = AMQConstant.getConstant(message.getBounceBody().replyCode);
- AMQShortString reason = message.getBounceBody().replyText;
- _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));
- }
- else if (errorCode == AMQConstant.NO_ROUTE)
- {
- _connection.exceptionReceived(new AMQNoRouteException("Error: " + reason, bouncedMessage));
- }
- else
- {
- _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);
- }
- }
- });
- }
-
- /**
- * 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.
- */
- private void suspendChannel(boolean suspend) throws AMQException // , FailoverException
- {
- synchronized (_suspensionLock)
- {
- try
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Setting channel flow : " + (suspend ? "suspended" : "unsuspended"));
- }
-
- _suspended = suspend;
-
- AMQFrame channelFlowFrame =
- ChannelFlowBody.createAMQFrame(_channelId, getProtocolMajorVersion(), getProtocolMinorVersion(),
- !suspend);
-
- _connection.getProtocolHandler().syncWrite(channelFlowFrame, ChannelFlowOkBody.class);
- }
- catch (FailoverException e)
- {
- throw new AMQException("Fail-over interrupted suspend/unsuspend channel.", e);
- }
- }
- }
-
- Object getMessageDeliveryLock()
- {
- return _messageDeliveryLock;
- }
-
- /** Responsible for decoding a message fragment and passing it to the appropriate message consumer. */
- private class Dispatcher extends Thread
- {
-
- /** Track the 'stopped' state of the dispatcher, a session starts in the stopped state. */
- private final AtomicBoolean _dispatcherClosed = new AtomicBoolean(false);
-
- private final Object _lock = new Object();
- private final AtomicLong _rollbackMark = new AtomicLong(-1);
- private String dispatcherID = "" + System.identityHashCode(this);
-
- public Dispatcher()
- {
- super("Dispatcher-Channel-" + _channelId);
- if (_dispatcherLogger.isInfoEnabled())
- {
- _dispatcherLogger.info(getName() + " created");
- }
- }
-
- public void close()
- {
- _dispatcherClosed.set(true);
- interrupt();
-
- // fixme awaitTermination
-
- }
-
- public void rejectPending(BasicMessageConsumer consumer)
- {
- synchronized (_lock)
- {
- boolean stopped = _dispatcher.connectionStopped();
-
- if (!stopped)
- {
- _dispatcher.setConnectionStopped(true);
- }
-
- // Reject messages on pre-receive queue
- consumer.rollback();
-
- // Reject messages on pre-dispatch queue
- rejectMessagesForConsumerTag(consumer.getConsumerTag(), true);
- //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 (BasicMessageConsumer consumer : _consumers.values())
- {
- if (!consumer.isNoConsume())
- {
- consumer.rollback();
- }
- else
- {
- // cClear the _SQ here.
- consumer.clearReceiveQueue();
- }
-
- }
-
- 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(2000);
- }
- catch (InterruptedException e)
- {
- // ignore
- }
- }
- }
-
- try
- {
- while (!_dispatcherClosed.get())
- {
- message = (UnprocessedMessage) _queue.poll(1000, TimeUnit.MILLISECONDS);
- if (message != null)
- {
- synchronized (_lock)
- {
-
- while (connectionStopped())
- {
- _lock.wait(2000);
- }
-
- if (message.getDeliverBody().deliveryTag <= _rollbackMark.get())
- {
- rejectMessage(message, true);
- }
- else
- {
- synchronized (_messageDeliveryLock)
- {
- dispatchMessage(message);
- }
- }
-
- }
- }
- }
- }
- 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)
- {
- if (message.getDeliverBody() != null)
- {
- final BasicMessageConsumer consumer =
- (BasicMessageConsumer) _consumers.get(message.getDeliverBody().consumerTag);
-
- if ((consumer == null) || consumer.isClosed())
- {
- if (_dispatcherLogger.isInfoEnabled())
- {
- if (consumer == null)
- {
- _dispatcherLogger.info("Dispatcher(" + dispatcherID + ")Received a message(" + System.identityHashCode(message) + ")" + "["
- + message.getDeliverBody().deliveryTag + "] from queue "
- + message.getDeliverBody().consumerTag + " )without a handler - rejecting(requeue)...");
- }
- else
- {
- _dispatcherLogger.info("Dispatcher(" + dispatcherID + ")Received a message(" + System.identityHashCode(message) + ") ["
- + message.getDeliverBody().deliveryTag + "] from queue consumer("
- + consumer.debugIdentity() + ") is closed rejecting(requeue)...");
- }
- }
- // Don't reject if we're already closing
- if (!_dispatcherClosed.get())
- {
- rejectMessage(message, true);
- }
- }
- else
- {
- consumer.notifyMessage(message, _channelId);
- }
- }
- }
- }
-
- /*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 boolean _suspend;
-
- public SuspenderRunner(boolean suspend)
- {
- _suspend = suspend;
- }
-
- public void run()
- {
- try
- {
- suspendChannel(_suspend);
- }
- catch (AMQException e)
- {
- _logger.warn("Unable to suspend channel");
- }
- }
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/AMQSessionAdapter.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQSessionAdapter.java
deleted file mode 100644
index 93f10761e2..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryQueue.java
deleted file mode 100644
index f54cb782c8..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryTopic.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQTemporaryTopic.java
deleted file mode 100644
index 7b5781530b..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQTopic.java
deleted file mode 100644
index 319e728edf..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/AMQTopic.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.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(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);
- }
-
- public static AMQTopic createDurableTopic(AMQTopic topic, String subscriptionName, AMQConnection connection)
- throws JMSException
- {
- return new AMQTopic(topic.getExchangeName(), topic.getDestinationName(), 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.getDestinationName().toString();
- }
-
- public AMQShortString getRoutingKey()
- {
- return getDestinationName();
- }
-
- public boolean isNameRequired()
- {
- // Topics always rely on a server generated queue name.
- return false;
- }
-
- /**
- * 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)
- {
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/AMQTopicSessionAdaptor.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQTopicSessionAdaptor.java
deleted file mode 100644
index f44f8414fa..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/AMQUndefinedDestination.java b/Final/java/client/src/main/java/org/apache/qpid/client/AMQUndefinedDestination.java
deleted file mode 100644
index 0f3723c58b..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/AMQUndefinedDestination.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.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 AMQShortString getRoutingKey()
- {
- return getDestinationName();
- }
-
- public boolean isNameRequired()
- {
- return getAMQQueueName() == null;
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java b/Final/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
deleted file mode 100644
index ddaf0cfd93..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/BasicMessageConsumer.java
+++ /dev/null
@@ -1,996 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.AbstractJMSMessage;
-import org.apache.qpid.client.message.MessageFactoryRegistry;
-import org.apache.qpid.client.message.UnprocessedMessage;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicCancelBody;
-import org.apache.qpid.framing.BasicCancelOkBody;
-import org.apache.qpid.framing.FieldTable;
-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.concurrent.ArrayBlockingQueue;
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
-
-public class BasicMessageConsumer extends Closeable implements MessageConsumer
-{
- private static final Logger _logger = LoggerFactory.getLogger(BasicMessageConsumer.class);
-
- /** The connection being used by this consumer */
- private AMQConnection _connection;
-
- private String _messageSelector;
-
- private boolean _noLocal;
-
- private 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 */
- private AMQShortString _consumerTag;
-
- /** We need to know the channel id when constructing frames */
- private 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
- */
- private final ArrayBlockingQueue _synchronousQueue;
-
- private MessageFactoryRegistry _messageFactory;
-
- private final AMQSession _session;
-
- private AMQProtocolHandler _protocolHandler;
-
- /** We need to store the "raw" field table so that we can resubscribe in the event of failover being required */
- private FieldTable _rawSelectorFieldTable;
-
- /**
- * We store the high water prefetch field in order to be able to reuse it when resubscribing in the event of
- * failover
- */
- private 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 int _prefetchLow;
-
- /** We store the exclusive field in order to be able to reuse it when resubscribing in the event of failover */
- private 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.
- */
- private 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;
-
- private ConcurrentLinkedQueue<Long> _unacknowledgedDeliveryTags = new ConcurrentLinkedQueue<Long>();
-
- /** 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 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;
-
- /**
- * 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 boolean _autoClose;
- private boolean _closeWhenNoMessages;
-
- private 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 rawSelectorFieldTable, 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;
- _rawSelectorFieldTable = rawSelectorFieldTable;
- _prefetchHigh = prefetchHigh;
- _prefetchLow = prefetchLow;
- _exclusive = exclusive;
- _acknowledgeMode = acknowledgeMode;
- _synchronousQueue = new ArrayBlockingQueue(prefetchHigh, true);
- _autoClose = autoClose;
- _noConsume = noConsume;
-
- // Force queue browsers not to use acknowledge modes.
- if (_noConsume)
- {
- _acknowledgeMode = Session.NO_ACKNOWLEDGE;
- }
- }
-
- 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;
- }
-
- private 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
-
- _messageListener.set(messageListener);
- _session.setHasMessageListeners();
- _session.startDistpatcherIfNecessary();
- }
- }
- }
-
- private void preApplicationProcessing(AbstractJMSMessage msg) throws JMSException
- {
-
- switch (_acknowledgeMode)
- {
-
- case Session.CLIENT_ACKNOWLEDGE:
- _unacknowledgedDeliveryTags.add(msg.getDeliveryTag());
- break;
-
- case Session.SESSION_TRANSACTED:
- if (isNoConsume())
- {
- _session.acknowledgeMessage(msg.getDeliveryTag(), false);
- }
- else
- {
- _logger.info("Recording tag for commit:" + msg.getDeliveryTag());
- _receivedDeliveryTags.add(msg.getDeliveryTag());
- }
-
- break;
- }
-
- _session.setInRecovery(false);
- }
-
- private void acquireReceiving() throws JMSException
- {
- 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();
- }
-
- private void releaseReceiving()
- {
- _receiving.set(false);
- _receivingThread = null;
- }
-
- public FieldTable getRawSelectorFieldTable()
- {
- return _rawSelectorFieldTable;
- }
-
- 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();
-
- acquireReceiving();
-
- _session.startDistpatcherIfNecessary();
-
- try
- {
- if (closeOnAutoClose())
- {
- return null;
- }
-
- Object o = null;
- if (l > 0)
- {
- long endtime = System.currentTimeMillis() + l;
- while (System.currentTimeMillis() < endtime && o == null)
- {
- try
- {
- o = _synchronousQueue.poll(endtime - System.currentTimeMillis(), TimeUnit.MILLISECONDS);
- }
- catch (InterruptedException e)
- {
- _logger.warn("Interrupted: " + e);
- if (isClosed())
- {
- return null;
- }
- }
- }
- }
- else
- {
- while (o == null)
- {
- try
- {
- o = _synchronousQueue.take();
- }
- catch (InterruptedException e)
- {
- _logger.warn("Interrupted: " + e);
- if (isClosed())
- {
- return null;
- }
- }
- }
- }
- final AbstractJMSMessage m = returnMessageOrThrow(o);
- if (m != null)
- {
- preApplicationProcessing(m);
- postDeliver(m);
- }
- return m;
- }
- finally
- {
- releaseReceiving();
- }
- }
-
- private boolean closeOnAutoClose() throws JMSException
- {
- if (isAutoClose() && _closeWhenNoMessages && _synchronousQueue.isEmpty())
- {
- close(false);
-
- return true;
- }
- else
- {
- return false;
- }
- }
-
- public Message receiveNoWait() throws JMSException
- {
- checkPreConditions();
-
- acquireReceiving();
-
- _session.startDistpatcherIfNecessary();
-
- try
- {
- if (closeOnAutoClose())
- {
- return null;
- }
-
- Object o = _synchronousQueue.poll();
- final AbstractJMSMessage m = returnMessageOrThrow(o);
- if (m != null)
- {
- preApplicationProcessing(m);
- postDeliver(m);
- }
-
- return m;
- }
- 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
- *
- * @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
- {
- return (AbstractJMSMessage) o;
- }
- }
-
- public void close() throws JMSException
- {
- close(true);
- }
-
- public void close(boolean sendClose) throws JMSException
- {
- // synchronized (_closed)
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("Closing consumer:" + debugIdentity());
- }
-
- synchronized (_connection.getFailoverMutex())
- {
- if (!_closed.getAndSet(true))
- {
- if (_logger.isTraceEnabled())
- {
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- if (_closedStack != null)
- {
- _logger.trace(_consumerTag + " previously:" + _closedStack.toString());
- }
- else
- {
- _closedStack = Arrays.asList(stackTrace).subList(3, stackTrace.length - 1);
- }
- }
-
- if (sendClose)
- {
- // TODO: Be aware of possible changes to parameter order as versions change.
- final AMQFrame cancelFrame =
- BasicCancelBody.createAMQFrame(_channelId, _protocolHandler.getProtocolMajorVersion(),
- _protocolHandler.getProtocolMinorVersion(), _consumerTag, // consumerTag
- false); // nowait
-
- try
- {
- _protocolHandler.syncWrite(cancelFrame, BasicCancelOkBody.class);
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("CancelOk'd for consumer:" + debugIdentity());
- }
-
- }
- catch (AMQException e)
- {
- throw new JMSAMQException("Error closing consumer: " + e, e);
- }
- catch (FailoverException e)
- {
- throw new JMSAMQException("FailoverException interrupted basic cancel.", e);
- }
- }
- else
- {
- // //fixme this probably is not right
- // if (!isNoConsume())
- { // done in BasicCancelOK Handler but not sending one so just deregister.
- deregisterConsumer();
- }
- }
-
- if ((_messageListener != null) && _receiving.get())
- {
- if (_logger.isInfoEnabled())
- {
- _logger.info("Interrupting thread: " + _receivingThread);
- }
-
- _receivingThread.interrupt();
- }
- }
- }
- }
-
- /**
- * 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.isTraceEnabled())
- {
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- if (_closedStack != null)
- {
- _logger.trace(_consumerTag + " markClosed():"
- + Arrays.asList(stackTrace).subList(3, stackTrace.length - 1));
- _logger.trace(_consumerTag + " previously:" + _closedStack.toString());
- }
- else
- {
- _closedStack = Arrays.asList(stackTrace).subList(3, stackTrace.length - 1);
- }
- }
- }
-
- 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
- */
- void notifyMessage(UnprocessedMessage messageFrame, int channelId)
- {
- final boolean debug = _logger.isDebugEnabled();
-
- if (debug)
- {
- _logger.debug("notifyMessage called with message number " + messageFrame.getDeliverBody().deliveryTag);
- }
-
- try
- {
- AbstractJMSMessage jmsMessage =
- _messageFactory.createMessage(messageFrame.getDeliverBody().deliveryTag,
- messageFrame.getDeliverBody().redelivered, messageFrame.getDeliverBody().exchange,
- messageFrame.getDeliverBody().routingKey, messageFrame.getContentHeader(), messageFrame.getBodies());
-
- if (debug)
- {
- _logger.debug("Message is of type: " + jmsMessage.getClass().getName());
- }
- // synchronized (_closed)
-
- {
- // if (!_closed.get())
- {
-
- jmsMessage.setConsumer(this);
-
- preDeliver(jmsMessage);
-
- notifyMessage(jmsMessage, channelId);
- }
- // 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);
- }
- }
- }
-
- /**
- * @param jmsMessage this message has already been processed so can't redo preDeliver
- * @param channelId
- */
- public void notifyMessage(AbstractJMSMessage jmsMessage, int channelId)
- {
- try
- {
- 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
- // synchronized (_closed)
- {
- // if (!_closed.get())
- {
-
- preApplicationProcessing(jmsMessage);
- getMessageListener().onMessage(jmsMessage);
- postDeliver(jmsMessage);
- }
- }
- }
- else
- {
- _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);
- }
- }
- }
-
- private 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;
- }
- }
-
- private void postDeliver(AbstractJMSMessage msg) throws JMSException
- {
- msg.setJMSDestination(_destination);
- switch (_acknowledgeMode)
- {
-
- case Session.CLIENT_ACKNOWLEDGE:
- if (isNoConsume())
- {
- _session.acknowledgeMessage(msg.getDeliveryTag(), false);
- }
-
- break;
-
- case Session.DUPS_OK_ACKNOWLEDGE:
- if (++_outstanding >= _prefetchHigh)
- {
- _dups_ok_acknowledge_send = true;
- }
-
- if (_outstanding <= _prefetchLow)
- {
- _dups_ok_acknowledge_send = false;
- }
-
- if (_dups_ok_acknowledge_send)
- {
- if (!_session.isInRecovery())
- {
- _session.acknowledgeMessage(msg.getDeliveryTag(), true);
- }
- }
-
- break;
-
- 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. */
- void acknowledgeLastDelivered()
- {
- if (!_receivedDeliveryTags.isEmpty())
- {
- long lastDeliveryTag = _receivedDeliveryTags.poll();
-
- while (!_receivedDeliveryTags.isEmpty())
- {
- lastDeliveryTag = _receivedDeliveryTags.poll();
- }
-
- assert _receivedDeliveryTags.isEmpty();
-
- _session.acknowledgeMessage(lastDeliveryTag, true);
- }
- }
-
- void notifyError(Throwable cause)
- {
- // synchronized (_closed)
- {
- _closed.set(true);
- if (_logger.isTraceEnabled())
- {
- StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
- if (_closedStack != null)
- {
- _logger.trace(_consumerTag + " notifyError():"
- + Arrays.asList(stackTrace).subList(3, stackTrace.length - 1));
- _logger.trace(_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 AMQShortString getConsumerTag()
- {
- return _consumerTag;
- }
-
- public void setConsumerTag(AMQShortString 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 void acknowledge() // throws JMSException
- {
- if (!isClosed())
- {
-
- Iterator<Long> tags = _unacknowledgedDeliveryTags.iterator();
- while (tags.hasNext())
- {
- _session.acknowledgeMessage(tags.next(), false);
- tags.remove();
- }
- }
- else
- {
- throw new IllegalStateException("Consumer is closed");
- }
- }
-
- /** Called on recovery to reset the list of delivery tags */
- public void clearUnackedMessages()
- {
- _unacknowledgedDeliveryTags.clear();
- }
-
- public boolean isAutoClose()
- {
- return _autoClose;
- }
-
- public boolean isNoConsume()
- {
- return _noConsume;
- }
-
- public void closeWhenNoMessages(boolean b)
- {
- _closeWhenNoMessages = b;
-
- if (_closeWhenNoMessages && _synchronousQueue.isEmpty() && _receiving.get() && (_messageListener != null))
- {
- _closed.set(true);
- _receivingThread.interrupt();
- }
-
- }
-
- public void rollback()
- {
- clearUnackedMessages();
-
- if (!_receivedDeliveryTags.isEmpty())
- {
- _logger.debug("Rejecting received messages in _receivedDTs (RQ)");
- }
-
- // rollback received but not committed messages
- while (!_receivedDeliveryTags.isEmpty())
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Rejecting the messages(" + _receivedDeliveryTags.size() + ") in _receivedDTs (RQ)"
- + "for consumer with tag:" + _consumerTag);
- }
-
- Long tag = _receivedDeliveryTags.poll();
-
- if (tag != null)
- {
- if (_logger.isTraceEnabled())
- {
- _logger.trace("Rejecting tag from _receivedDTs:" + tag);
- }
-
- _session.rejectMessage(tag, true);
- }
- }
-
- if (!_receivedDeliveryTags.isEmpty())
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Queue _receivedDTs (RQ) was not empty after rejection");
- }
- }
-
- // rollback pending messages
- 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.isTraceEnabled())
- {
- _logger.trace("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();
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java b/Final/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java
deleted file mode 100644
index 0ee4882ec2..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/BasicMessageProducer.java
+++ /dev/null
@@ -1,691 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.mina.common.ByteBuffer;
-
-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.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;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-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.Queue;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-
-import java.io.UnsupportedEncodingException;
-import java.util.UUID;
-
-public 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.
- */
- private 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;
-
- private AMQProtocolHandler _protocolHandler;
-
- /**
- * True if this producer was created from a transacted session
- */
- private boolean _transacted;
-
- private 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
- */
- private AMQSession _session;
-
- private final boolean _immediate;
-
- private final boolean _mandatory;
-
- private final boolean _waitUntilSent;
-
- private boolean _disableMessageId;
-
- 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)
- {
- declareDestination(destination);
- }
-
- _immediate = immediate;
- _mandatory = mandatory;
- _waitUntilSent = waitUntilSent;
- }
-
- void resubscribe() throws AMQException
- {
- if (_destination != null)
- {
- declareDestination(_destination);
- }
- }
-
- private void declareDestination(AMQDestination destination)
- {
- // Declare the exchange
- // Note that the durable and internal arguments are ignored since passive is set to false
- // TODO: Be aware of possible changes to parameter order as versions change.
- AMQFrame declare =
- ExchangeDeclareBody.createAMQFrame(_channelId, _protocolHandler.getProtocolMajorVersion(),
- _protocolHandler.getProtocolMinorVersion(), null, // arguments
- false, // autoDelete
- false, // durable
- destination.getExchangeName(), // exchange
- false, // internal
- true, // nowait
- false, // passive
- _session.getTicket(), // ticket
- destination.getExchangeClass()); // type
- _protocolHandler.writeFrame(declare);
- }
-
- 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((BytesMessage) message).getConvertedMessage();
- }
- else if (message instanceof MapMessage)
- {
- newMessage = new MessageConverter((MapMessage) message).getConvertedMessage();
- }
- else if (message instanceof ObjectMessage)
- {
- newMessage = new MessageConverter((ObjectMessage) message).getConvertedMessage();
- }
- else if (message instanceof TextMessage)
- {
- newMessage = new MessageConverter((TextMessage) message).getConvertedMessage();
- }
- else if (message instanceof StreamMessage)
- {
- newMessage = new MessageConverter((StreamMessage) message).getConvertedMessage();
- }
- else
- {
- newMessage = new MessageConverter(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));
- }
-
- declareDestination((AMQDestination) destination);
- }
-
- 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 (_disableMessageId)
- {
- message.setJMSMessageID(null);
- }
- else
- {
- if (message.getJMSMessageID() == null)
- {
- message.setJMSMessageID(UUID.randomUUID().toString());
- }
- }
-
- int type;
- if (destination instanceof Topic)
- {
- type = AMQDestination.TOPIC_TYPE;
- }
- else if (destination instanceof Queue)
- {
- type = AMQDestination.QUEUE_TYPE;
- }
- else
- {
- type = AMQDestination.UNKNOWN_TYPE;
- }
-
- message.getJmsHeaders().setInteger(CustomJMSXProperty.JMS_QPID_DESTTYPE.getShortStringName(), type);
-
- // 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 publishFrame =
- BasicPublishBody.createAMQFrame(_channelId, _protocolHandler.getProtocolMajorVersion(),
- _protocolHandler.getProtocolMinorVersion(), destination.getExchangeName(), // exchange
- immediate, // immediate
- mandatory, // mandatory
- destination.getRoutingKey(), // routingKey
- _session.getTicket()); // ticket
-
- message.prepareForSending();
- ByteBuffer payload = message.getData();
- BasicContentHeaderProperties contentHeaderProperties = message.getContentHeaderProperties();
-
- 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);
- }
-
- // weight argument of zero indicates no child content headers, just bodies
- // 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.
- AMQFrame contentHeaderFrame =
- ContentHeaderBody.createAMQFrame(_channelId,
- BasicConsumeBody.getClazz(_protocolHandler.getProtocolMajorVersion(),
- _protocolHandler.getProtocolMinorVersion()), 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);
- _protocolHandler.writeFrame(compositeFrame, 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());
- }
- }
-
- 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");
- }
- }
- }
-
- /**
- * 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;
- }
-
- 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/Final/java/client/src/main/java/org/apache/qpid/client/Closeable.java b/Final/java/client/src/main/java/org/apache/qpid/client/Closeable.java
deleted file mode 100644
index 7e119343a1..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/ConnectionTuneParameters.java b/Final/java/client/src/main/java/org/apache/qpid/client/ConnectionTuneParameters.java
deleted file mode 100644
index b1ec7216bc..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.java b/Final/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.java
deleted file mode 100644
index a5e89ef4fc..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/CustomJMSXProperty.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 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;
-
-
- 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/Final/java/client/src/main/java/org/apache/qpid/client/DispatcherCallback.java b/Final/java/client/src/main/java/org/apache/qpid/client/DispatcherCallback.java
deleted file mode 100644
index 81a55006ed..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/JMSAMQException.java b/Final/java/client/src/main/java/org/apache/qpid/client/JMSAMQException.java
deleted file mode 100644
index 0927ca3625..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/JmsNotImplementedException.java b/Final/java/client/src/main/java/org/apache/qpid/client/JmsNotImplementedException.java
deleted file mode 100644
index 903514c35f..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/MessageConsumerPair.java b/Final/java/client/src/main/java/org/apache/qpid/client/MessageConsumerPair.java
deleted file mode 100644
index 585d6db3fd..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/QpidConnectionMetaData.java b/Final/java/client/src/main/java/org/apache/qpid/client/QpidConnectionMetaData.java
deleted file mode 100644
index 3bb5707417..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/QueueReceiverAdaptor.java b/Final/java/client/src/main/java/org/apache/qpid/client/QueueReceiverAdaptor.java
deleted file mode 100644
index 7059588367..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/QueueSenderAdapter.java b/Final/java/client/src/main/java/org/apache/qpid/client/QueueSenderAdapter.java
deleted file mode 100644
index 493e2b5ec0..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/QueueSenderAdapter.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.client;
-
-import javax.jms.Destination;
-import javax.jms.IllegalStateException;
-import javax.jms.InvalidDestinationException;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-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.isValidated() && checkQueueBeforePublish())
- {
-
- if (_delegate.getSession().isStrictAMQP())
- {
- _delegate._logger.warn("AMQP does not support destination validation before publish, ");
- destination.setValidated(true);
- }
- else
- {
- if (_delegate.isBound(destination))
- {
- destination.setValidated(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/Final/java/client/src/main/java/org/apache/qpid/client/SSLConfiguration.java b/Final/java/client/src/main/java/org/apache/qpid/client/SSLConfiguration.java
deleted file mode 100644
index 2280cc9870..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/TemporaryDestination.java b/Final/java/client/src/main/java/org/apache/qpid/client/TemporaryDestination.java
deleted file mode 100644
index 03d25aa243..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/TopicPublisherAdapter.java b/Final/java/client/src/main/java/org/apache/qpid/client/TopicPublisherAdapter.java
deleted file mode 100644
index 81b9940ed5..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/TopicSubscriberAdaptor.java b/Final/java/client/src/main/java/org/apache/qpid/client/TopicSubscriberAdaptor.java
deleted file mode 100644
index d4bec5d906..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/TopicSubscriberAdaptor.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.client;
-
-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 implements TopicSubscriber
-{
- private final Topic _topic;
- private final BasicMessageConsumer _consumer;
- private final boolean _noLocal;
-
- TopicSubscriberAdaptor(Topic topic, BasicMessageConsumer consumer, boolean noLocal)
- {
- _topic = topic;
- _consumer = consumer;
- _noLocal = noLocal;
- }
-
- TopicSubscriberAdaptor(Topic topic, BasicMessageConsumer 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{
- BasicMessageConsumer msgConsumer = (BasicMessageConsumer)_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");
- }
- }
-
- BasicMessageConsumer getMessageConsumer()
- {
- return _consumer;
- }
-
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverException.java b/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverException.java
deleted file mode 100644
index 037b0dc2d1..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.java
deleted file mode 100644
index 5303993331..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverHandler.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.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.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.
- synchronized (_amqProtocolHandler.getConnection().getFailoverMutex())
- {
- // 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(_amqProtocolHandler.getProtocolSession()));
- if (!_amqProtocolHandler.getConnection().firePreFailover(_host != null))
- {
- _logger.info("Failover process veto-ed by client");
-
- _amqProtocolHandler.setStateManager(existingStateManager);
- if (_host != null)
- {
- _amqProtocolHandler.getConnection().exceptionReceived(new AMQDisconnectedException(
- "Redirect was vetoed by client"));
- }
- else
- {
- _amqProtocolHandler.getConnection().exceptionReceived(new AMQDisconnectedException(
- "Failover was vetoed by client"));
- }
-
- _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)
- {
- _amqProtocolHandler.setStateManager(existingStateManager);
- _amqProtocolHandler.getConnection().exceptionReceived(new AMQDisconnectedException(
- "Server closed connection and no failover " + "was successful"));
- }
- else
- {
- _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/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverNoopSupport.java b/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverNoopSupport.java
deleted file mode 100644
index 1ec98efe0e..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverProtectedOperation.java b/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverProtectedOperation.java
deleted file mode 100644
index 9a7f43926e..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.java b/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.java
deleted file mode 100644
index 120a07f0fc..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverRetrySupport.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.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
- {
- while (true)
- {
- try
- {
- connection.blockUntilNotFailingOver();
- }
- catch (InterruptedException e)
- {
- _log.debug("Interrupted: " + e, e);
-
- return null;
- }
-
- synchronized (connection.getFailoverMutex())
- {
- try
- {
- return operation.execute();
- }
- catch (FailoverException e)
- {
- _log.debug("Failover exception caught during operation: " + e, e);
- }
- }
- }
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverState.java b/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverState.java
deleted file mode 100644
index 807a5f7d13..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverSupport.java b/Final/java/client/src/main/java/org/apache/qpid/client/failover/FailoverSupport.java
deleted file mode 100644
index ef2e7e1d65..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/handler/BasicCancelOkMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/BasicCancelOkMethodHandler.java
deleted file mode 100644
index 8f0ee05b3e..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/BasicCancelOkMethodHandler.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.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.BasicCancelOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BasicCancelOkMethodHandler implements StateAwareMethodListener
-{
- 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(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- BasicCancelOkBody body = (BasicCancelOkBody) evt.getMethod();
-
- if (_logger.isInfoEnabled())
- {
- _logger.info("New BasicCancelOk method received for consumer:" + body.consumerTag);
- }
-
- protocolSession.confirmConsumerCancelled(evt.getChannelId(), body.consumerTag);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/BasicDeliverMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/BasicDeliverMethodHandler.java
deleted file mode 100644
index 51120da55c..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/BasicDeliverMethodHandler.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.message.UnprocessedMessage;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.BasicDeliverBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BasicDeliverMethodHandler implements StateAwareMethodListener
-{
- 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(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- final UnprocessedMessage msg = new UnprocessedMessage(evt.getChannelId(), (BasicDeliverBody) evt.getMethod());
- _logger.debug("New JmsDeliver method received");
- protocolSession.unprocessedMessageReceived(msg);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/BasicReturnMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/BasicReturnMethodHandler.java
deleted file mode 100644
index 0f00c6a26e..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/BasicReturnMethodHandler.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.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.message.UnprocessedMessage;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.BasicReturnBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BasicReturnMethodHandler implements StateAwareMethodListener
-{
- 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(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- _logger.debug("New JmsBounce method received");
- final UnprocessedMessage msg = new UnprocessedMessage(evt.getChannelId(), (BasicReturnBody) evt.getMethod());
-
- protocolSession.unprocessedMessageReceived(msg);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.java
deleted file mode 100644
index 139a32370e..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseMethodHandler.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.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.AMQStateManager;
-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.apache.qpid.protocol.AMQMethodEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ChannelCloseMethodHandler implements StateAwareMethodListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(ChannelCloseMethodHandler.class);
-
- private static ChannelCloseMethodHandler _handler = new ChannelCloseMethodHandler();
-
- public static ChannelCloseMethodHandler getInstance()
- {
- return _handler;
- }
-
- public void methodReceived(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- _logger.debug("ChannelClose method received");
- ChannelCloseBody method = (ChannelCloseBody) evt.getMethod();
-
- AMQConstant errorCode = AMQConstant.getConstant(method.replyCode);
- AMQShortString reason = method.replyText;
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Channel close reply code: " + errorCode + ", reason: " + reason);
- }
-
- // 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)
- {
- 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);
- }
- else if (errorCode == AMQConstant.NO_ROUTE)
- {
- throw new AMQNoRouteException("Error: " + reason, null);
- }
- else if (errorCode == AMQConstant.INVALID_ARGUMENT)
- {
- _logger.debug("Broker responded with Invalid Argument.");
-
- throw new org.apache.qpid.AMQInvalidArgumentException(String.valueOf(reason));
- }
- else if (errorCode == AMQConstant.INVALID_ROUTING_KEY)
- {
- _logger.debug("Broker responded with Invalid Routing Key.");
-
- throw new AMQInvalidRoutingKeyException(String.valueOf(reason));
- }
- else
- {
- throw new AMQChannelClosedException(errorCode, "Error: " + reason);
- }
-
- }
- // fixme why is this only done when the close is expected...
- // should the above forced closes not also cause a close?
- protocolSession.channelClosed(evt.getChannelId(), errorCode, String.valueOf(reason));
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseOkMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseOkMethodHandler.java
deleted file mode 100644
index e1fe2697e5..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ChannelCloseOkMethodHandler.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.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ChannelCloseOkMethodHandler implements StateAwareMethodListener
-{
- 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(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- _logger.info("Received channel-close-ok for channel-id " + evt.getChannelId());
-
- // todo this should do the local closure
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ChannelFlowOkMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/ChannelFlowOkMethodHandler.java
deleted file mode 100644
index ca3f46d08b..0000000000
--- a/Final/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.AMQStateManager;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.ChannelFlowOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ChannelFlowOkMethodHandler implements StateAwareMethodListener
-{
- 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(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- ChannelFlowOkBody method = (ChannelFlowOkBody) evt.getMethod();
- _logger.debug("Received Channel.Flow-Ok message, active = " + method.active);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionCloseMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionCloseMethodHandler.java
deleted file mode 100644
index df096d3c4e..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionCloseMethodHandler.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.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.AMQStateManager;
-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.apache.qpid.protocol.AMQMethodEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ConnectionCloseMethodHandler implements StateAwareMethodListener
-{
- 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(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- _logger.info("ConnectionClose frame received");
- ConnectionCloseBody method = (ConnectionCloseBody) evt.getMethod();
-
- // does it matter
- // stateManager.changeState(AMQState.CONNECTION_CLOSING);
-
- AMQConstant errorCode = AMQConstant.getConstant(method.replyCode);
- AMQShortString reason = method.replyText;
-
- try
- {
- // TODO: check whether channel id of zero is appropriate
- // Be aware of possible changes to parameter order as versions change.
- protocolSession.writeFrame(ConnectionCloseOkBody.createAMQFrame((short) 0, method.getMajor(),
- method.getMinor()));
-
- if (errorCode != AMQConstant.REPLY_SUCCESS)
- {
- if (errorCode == AMQConstant.NOT_ALLOWED)
- {
- _logger.info("Authentication Error:" + Thread.currentThread().getName());
-
- 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 == null) ? null : reason.toString());
- }
- else
- {
- _logger.info("Connection close received with error code " + errorCode);
-
- throw new AMQConnectionClosedException(errorCode, "Error: " + reason);
- }
- }
- }
- finally
- {
- // this actually closes the connection in the case where it is not an error.
-
- protocolSession.closeProtocolSession();
-
- stateManager.changeState(AMQState.CONNECTION_CLOSED);
- }
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.java
deleted file mode 100644
index 2e0f273c32..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionOpenOkMethodHandler.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.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-public class ConnectionOpenOkMethodHandler implements StateAwareMethodListener
-{
- private static final ConnectionOpenOkMethodHandler _instance = new ConnectionOpenOkMethodHandler();
-
- public static ConnectionOpenOkMethodHandler getInstance()
- {
- return _instance;
- }
-
- private ConnectionOpenOkMethodHandler()
- {
- }
-
- public void methodReceived(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt) throws AMQException
- {
- stateManager.changeState(AMQState.CONNECTION_OPEN);
- }
-
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionRedirectMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionRedirectMethodHandler.java
deleted file mode 100644
index 213c0eba6e..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionRedirectMethodHandler.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.client.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.ConnectionRedirectBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ConnectionRedirectMethodHandler implements StateAwareMethodListener
-{
- 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(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- _logger.info("ConnectionRedirect frame received");
- ConnectionRedirectBody method = (ConnectionRedirectBody) evt.getMethod();
-
- String host = method.host.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);
-
- }
-
- protocolSession.failover(host, port);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionSecureMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionSecureMethodHandler.java
deleted file mode 100644
index ab6acffeaf..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionSecureMethodHandler.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.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.AMQStateManager;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.ConnectionSecureBody;
-import org.apache.qpid.framing.ConnectionSecureOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-public class ConnectionSecureMethodHandler implements StateAwareMethodListener
-{
- private static final ConnectionSecureMethodHandler _instance = new ConnectionSecureMethodHandler();
-
- public static ConnectionSecureMethodHandler getInstance()
- {
- return _instance;
- }
-
- public void methodReceived(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt) throws AMQException
- {
- SaslClient client = protocolSession.getSaslClient();
- if (client == null)
- {
- throw new AMQException("No SASL client set up - cannot proceed with authentication");
- }
-
- ConnectionSecureBody body = (ConnectionSecureBody) evt.getMethod();
-
- try
- {
- // Evaluate server challenge
- byte[] response = client.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.getChannelId(),
- body.getMajor(), body.getMinor(),
- response); // response
- protocolSession.writeFrame(responseFrame);
- }
- catch (SaslException e)
- {
- throw new AMQException("Error processing SASL challenge: " + e, e);
- }
-
-
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.java
deleted file mode 100644
index f14e256172..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionStartMethodHandler.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.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.AMQStateManager;
-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.apache.qpid.protocol.AMQMethodEvent;
-
-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
-{
- 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(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- _log.debug("public void methodReceived(AMQStateManager stateManager, AMQProtocolSession protocolSession, "
- + "AMQMethodEvent evt): called");
-
- ConnectionStartBody body = (ConnectionStartBody) evt.getMethod();
-
- ProtocolVersion pv = new ProtocolVersion((byte) body.versionMajor, (byte) body.versionMinor);
-
- // 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())
- {
- protocolSession.setProtocolVersion(pv.getMajorVersion(), pv.getMinorVersion());
-
- try
- {
- // Used to hold the SASL mechanism to authenticate with.
- String mechanism;
-
- if (body.mechanisms == null)
- {
- throw new AMQException("mechanism not specified in ConnectionStart method frame");
- }
- else
- {
- mechanism = chooseMechanism(body.mechanisms);
- _log.debug("mechanism = " + mechanism);
- }
-
- if (mechanism == null)
- {
- throw new AMQException("No supported security mechanism found, passed: " + new String(body.mechanisms));
- }
-
- byte[] saslResponse;
- try
- {
- SaslClient sc =
- Sasl.createSaslClient(new String[] { mechanism }, null, "AMQP", "localhost", null,
- createCallbackHandler(mechanism, protocolSession));
- if (sc == null)
- {
- throw new AMQException(
- "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.");
- }
-
- protocolSession.setSaslClient(sc);
- saslResponse = (sc.hasInitialResponse() ? sc.evaluateChallenge(new byte[0]) : null);
- }
- catch (SaslException e)
- {
- protocolSession.setSaslClient(null);
- throw new AMQException("Unable to create SASL client: " + e, e);
- }
-
- if (body.locales == null)
- {
- throw new AMQException("Locales is not defined in Connection Start method");
- }
-
- final String locales = new String(body.locales, "utf8");
- final StringTokenizer tokenizer = new StringTokenizer(locales, " ");
- String selectedLocale = null;
- if (tokenizer.hasMoreTokens())
- {
- selectedLocale = tokenizer.nextToken();
- }
- else
- {
- throw new AMQException("No locales sent from server, passed: " + locales);
- }
-
- stateManager.changeState(AMQState.CONNECTION_NOT_TUNED);
- FieldTable clientProperties = FieldTableFactory.newFieldTable();
-
- clientProperties.setString(new AMQShortString(ClientProperties.instance.toString()),
- protocolSession.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());
-
- // 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.
- protocolSession.writeFrame(ConnectionStartOkBody.createAMQFrame(evt.getChannelId(),
- protocolSession.getProtocolMajorVersion(), protocolSession.getProtocolMinorVersion(),
- clientProperties, // clientProperties
- new AMQShortString(selectedLocale), // locale
- new AMQShortString(mechanism), // mechanism
- saslResponse)); // response
-
- }
- catch (UnsupportedEncodingException e)
- {
- throw new AMQException("Unable to decode data: " + e, e);
- }
- }
- else
- {
- _log.error("Broker requested Protocol [" + body.versionMajor + "-" + body.versionMinor
- + "] which is not supported by this version of the client library");
-
- protocolSession.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("Unable to create callback handler: " + e, e);
- }
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.java
deleted file mode 100644
index 68556991d7..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ConnectionTuneMethodHandler.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.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.AMQStateManager;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ConnectionOpenBody;
-import org.apache.qpid.framing.ConnectionTuneBody;
-import org.apache.qpid.framing.ConnectionTuneOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ConnectionTuneMethodHandler implements StateAwareMethodListener
-{
- 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(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- _logger.debug("ConnectionTune frame received");
- ConnectionTuneBody frame = (ConnectionTuneBody) evt.getMethod();
-
- ConnectionTuneParameters params = protocolSession.getConnectionTuneParameters();
- if (params == null)
- {
- params = new ConnectionTuneParameters();
- }
-
- params.setFrameMax(frame.frameMax);
- params.setChannelMax(frame.channelMax);
- params.setHeartbeat(Integer.getInteger("amqj.heartbeat.delay", frame.heartbeat));
- protocolSession.setConnectionTuneParameters(params);
-
- stateManager.changeState(AMQState.CONNECTION_NOT_OPENED);
- protocolSession.writeFrame(createTuneOkFrame(evt.getChannelId(), params, frame.getMajor(), frame.getMinor()));
-
- String host = protocolSession.getAMQConnection().getVirtualHost();
- AMQShortString virtualHost = new AMQShortString("/" + host);
-
- protocolSession.writeFrame(createConnectionOpenFrame(evt.getChannelId(), virtualHost, null, true, frame.getMajor(),
- frame.getMinor()));
- }
-
- protected AMQFrame createConnectionOpenFrame(int channel, AMQShortString path, AMQShortString capabilities,
- boolean insist, byte major, byte minor)
- {
- // Be aware of possible changes to parameter order as versions change.
- return ConnectionOpenBody.createAMQFrame(channel, major, minor, // AMQP version (major, minor)
- capabilities, // capabilities
- insist, // insist
- path); // virtualHost
- }
-
- protected AMQFrame createTuneOkFrame(int channel, ConnectionTuneParameters params, byte major, byte minor)
- {
- // Be aware of possible changes to parameter order as versions change.
- return ConnectionTuneOkBody.createAMQFrame(channel, major, minor, params.getChannelMax(), // channelMax
- params.getFrameMax(), // frameMax
- params.getHeartbeat()); // heartbeat
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ExchangeBoundOkMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/ExchangeBoundOkMethodHandler.java
deleted file mode 100644
index 862a9be8d4..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/ExchangeBoundOkMethodHandler.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.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.ExchangeBoundOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author Apache Software Foundation
- */
-public class ExchangeBoundOkMethodHandler implements StateAwareMethodListener
-{
- 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(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- if (_logger.isDebugEnabled())
- {
- ExchangeBoundOkBody body = (ExchangeBoundOkBody) evt.getMethod();
- _logger.debug("Received Exchange.Bound-Ok message, response code: " + body.replyCode + " text: "
- + body.replyText);
- }
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/handler/QueueDeleteOkMethodHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/handler/QueueDeleteOkMethodHandler.java
deleted file mode 100644
index 65060d44d2..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/handler/QueueDeleteOkMethodHandler.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.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.framing.QueueDeleteOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * @author Apache Software Foundation
- */
-public class QueueDeleteOkMethodHandler implements StateAwareMethodListener
-{
- 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(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- if (_logger.isDebugEnabled())
- {
- QueueDeleteOkBody body = (QueueDeleteOkBody) evt.getMethod();
- _logger.debug("Received Queue.Delete-Ok message, message count: " + body.messageCount);
- }
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/AMQMessage.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/AMQMessage.java
deleted file mode 100644
index 8741a1cbb6..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/AMQMessage.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.client.message;
-
-import javax.jms.JMSException;
-
-import org.apache.qpid.client.AMQSession;
-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 java.math.BigDecimal;
-
-public class AMQMessage
-{
- protected ContentHeaderProperties _contentHeaderProperties;
-
- /** If the acknowledge mode is CLIENT_ACKNOWLEDGE the session is required */
- protected AMQSession _session;
-
- protected final long _deliveryTag;
-
- public AMQMessage(ContentHeaderProperties properties, long deliveryTag)
- {
- _contentHeaderProperties = properties;
- _deliveryTag = deliveryTag;
- }
-
- public AMQMessage(ContentHeaderProperties properties)
- {
- this(properties, -1);
- }
-
- /**
- * 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;
- }
-
- /** Invoked prior to sending the message. Allows the message to be modified if necessary before sending. */
- public void prepareForSending() throws JMSException
- {
- }
-
- public FieldTable getPropertyHeaders()
- {
- return ((BasicContentHeaderProperties) _contentHeaderProperties).getHeaders();
- }
-
- public void setDecimalProperty(AMQShortString propertyName, BigDecimal bd) throws JMSException
- {
- getPropertyHeaders().setDecimal(propertyName, bd);
- }
-
- public void setIntProperty(AMQShortString propertyName, int i) throws JMSException
- {
- getPropertyHeaders().setInteger(propertyName, new Integer(i));
- }
-
- public void setLongStringProperty(AMQShortString propertyName, String value)
- {
- getPropertyHeaders().setString(propertyName, value);
- }
-
- public void setTimestampProperty(AMQShortString propertyName, long value)
- {
- getPropertyHeaders().setTimestamp(propertyName, value);
- }
-
- public void setVoidProperty(AMQShortString propertyName)
- {
- getPropertyHeaders().setVoid(propertyName);
- }
-
- //** Getters
-
- public BigDecimal getDecimalProperty(AMQShortString propertyName) throws JMSException
- {
- return getPropertyHeaders().getDecimal(propertyName);
- }
-
- public int getIntegerProperty(AMQShortString propertyName) throws JMSException
- {
- return getPropertyHeaders().getInteger(propertyName);
- }
-
- public String getLongStringProperty(AMQShortString propertyName)
- {
- return getPropertyHeaders().getString(propertyName);
- }
-
- public Long getTimestampProperty(AMQShortString propertyName)
- {
- return getPropertyHeaders().getTimestamp(propertyName);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.java
deleted file mode 100644
index af254fbbaf..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesMessage.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.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;
-import org.apache.qpid.framing.ContentHeaderBody;
-
-/**
- * @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()
- {
- this(null);
- }
-
- /**
- * Construct a bytes message with existing data.
- *
- * @param data the data that comprises this message. If data is null, you get a 1024 byte buffer that is
- * set to auto expand
- */
- AbstractBytesMessage(ByteBuffer data)
- {
- super(data); // this instanties a content header
- getContentHeaderProperties().setContentType(getMimeTypeAsShortString());
-
- if (_data == null)
- {
- allocateInitialBuffer();
- }
- }
-
- protected void allocateInitialBuffer()
- {
- _data = ByteBuffer.allocate(DEFAULT_BUFFER_INITIAL_SIZE);
- _data.setAutoExpand(true);
- }
-
- AbstractBytesMessage(long messageNbr, ContentHeaderBody contentHeader, AMQShortString exchange,
- AMQShortString routingKey, ByteBuffer data) throws AMQException
- {
- // TODO: this casting is ugly. Need to review whole ContentHeaderBody idea
- super(messageNbr, (BasicContentHeaderProperties) contentHeader.properties, exchange, routingKey, data);
- getContentHeaderProperties().setContentType(getMimeTypeAsShortString());
- }
-
- 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/Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesTypedMessage.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesTypedMessage.java
deleted file mode 100644
index 3b8ce9a98a..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractBytesTypedMessage.java
+++ /dev/null
@@ -1,801 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.ContentHeaderBody;
-
-/**
- * @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()
- {
- this(null);
- }
-
- /**
- * Construct a stream message with existing data.
- *
- * @param data the data that comprises this message. If data is null, you get a 1024 byte buffer that is
- * set to auto expand
- */
- AbstractBytesTypedMessage(ByteBuffer data)
- {
- super(data); // this instanties a content header
- }
-
-
- AbstractBytesTypedMessage(long messageNbr, ContentHeaderBody contentHeader, AMQShortString exchange,
- AMQShortString routingKey, ByteBuffer data) throws AMQException
- {
- super(messageNbr, contentHeader, exchange, routingKey, 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/Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.java
deleted file mode 100644
index 2dfeb19268..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessage.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.client.message;
-
-import org.apache.commons.collections.map.ReferenceMap;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.*;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.url.AMQBindingURL;
-import org.apache.qpid.url.BindingURL;
-import org.apache.qpid.url.URLSyntaxException;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.MessageNotReadableException;
-import javax.jms.MessageNotWriteableException;
-
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Map;
-import java.util.UUID;
-
-public abstract class AbstractJMSMessage extends AMQMessage implements org.apache.qpid.jms.Message
-{
- private static final Map _destinationCache = Collections.synchronizedMap(new ReferenceMap());
-
- protected boolean _redelivered;
-
- protected ByteBuffer _data;
- private boolean _readableProperties = false;
- protected boolean _readableMessage = false;
- protected boolean _changedData;
- private Destination _destination;
- private JMSHeaderAdapter _headerAdapter;
- private BasicMessageConsumer _consumer;
- private boolean _strictAMQP;
-
- protected AbstractJMSMessage(ByteBuffer data)
- {
- super(new BasicContentHeaderProperties());
- _data = data;
- if (_data != null)
- {
- _data.acquire();
- }
-
- _readableProperties = false;
- _readableMessage = (data != null);
- _changedData = (data == null);
- _headerAdapter = new JMSHeaderAdapter(((BasicContentHeaderProperties) _contentHeaderProperties).getHeaders());
-
- _strictAMQP =
- Boolean.parseBoolean(System.getProperties().getProperty(AMQSession.STRICT_AMQP, AMQSession.STRICT_AMQP_DEFAULT));
- }
-
- protected AbstractJMSMessage(long deliveryTag, BasicContentHeaderProperties contentHeader, AMQShortString exchange,
- AMQShortString routingKey, ByteBuffer data) throws AMQException
- {
- this(contentHeader, deliveryTag);
-
- Integer type = contentHeader.getHeaders().getInteger(CustomJMSXProperty.JMS_QPID_DESTTYPE.getShortStringName());
-
- AMQDestination dest;
-
- if (AMQDestination.QUEUE_TYPE.equals(type))
- {
- dest = new AMQQueue(exchange, routingKey, routingKey);
- }
- else if (AMQDestination.TOPIC_TYPE.equals(type))
- {
- dest = new AMQTopic(exchange, routingKey, null);
- }
- else
- {
- dest = new AMQUndefinedDestination(exchange, routingKey, null);
- }
- // Destination dest = AMQDestination.createDestination(url);
- setJMSDestination(dest);
-
- _data = data;
- if (_data != null)
- {
- _data.acquire();
- }
-
- _readableMessage = data != null;
-
- }
-
- protected AbstractJMSMessage(BasicContentHeaderProperties contentHeader, long deliveryTag)
- {
- super(contentHeader, deliveryTag);
- _readableProperties = (_contentHeaderProperties != null);
- _headerAdapter = new JMSHeaderAdapter(((BasicContentHeaderProperties) _contentHeaderProperties).getHeaders());
- }
-
- public String getJMSMessageID() throws JMSException
- {
- if (getContentHeaderProperties().getMessageIdAsString() == null)
- {
- getContentHeaderProperties().setMessageId("ID:" + UUID.randomUUID());
- }
-
- return getContentHeaderProperties().getMessageIdAsString();
- }
-
- public void setJMSMessageID(String messageId) throws JMSException
- {
- getContentHeaderProperties().setMessageId(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 (URLSyntaxException 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 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 boolean getJMSRedelivered() throws JMSException
- {
- return _redelivered;
- }
-
- public void setJMSRedelivered(boolean b) throws JMSException
- {
- _redelivered = b;
- }
-
- 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 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 clearBody() throws JMSException
- {
- clearBodyImpl();
- _readableMessage = false;
- }
-
- public boolean propertyExists(AMQShortString propertyName) throws JMSException
- {
- return getJmsHeaders().propertyExists(propertyName);
- }
-
- public boolean propertyExists(String propertyName) throws JMSException
- {
- return getJmsHeaders().propertyExists(propertyName);
- }
-
- public boolean getBooleanProperty(AMQShortString propertyName) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getBoolean(propertyName);
- }
-
- public boolean getBooleanProperty(String propertyName) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getBoolean(propertyName);
- }
-
- public byte getByteProperty(String propertyName) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getByte(propertyName);
- }
-
- public byte[] getBytesProperty(AMQShortString propertyName) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getBytes(propertyName);
- }
-
- public short getShortProperty(String propertyName) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getShort(propertyName);
- }
-
- public int getIntProperty(String propertyName) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getInteger(propertyName);
- }
-
- public long getLongProperty(String propertyName) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getLong(propertyName);
- }
-
- public float getFloatProperty(String propertyName) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getFloat(propertyName);
- }
-
- public double getDoubleProperty(String propertyName) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- return getJmsHeaders().getDouble(propertyName);
- }
-
- public String getStringProperty(String propertyName) throws JMSException
- {
- if (_strictAMQP)
- {
- 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(AMQShortString propertyName, boolean b) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- checkWritableProperties();
- getJmsHeaders().setBoolean(propertyName, b);
- }
-
- public void setBooleanProperty(String propertyName, boolean b) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- checkWritableProperties();
- getJmsHeaders().setBoolean(propertyName, b);
- }
-
- public void setByteProperty(String propertyName, byte b) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- checkWritableProperties();
- getJmsHeaders().setByte(propertyName, new Byte(b));
- }
-
- public void setBytesProperty(AMQShortString propertyName, byte[] bytes) throws JMSException
- {
- if (_strictAMQP)
- {
- throw new UnsupportedOperationException("JMS Proprerties not supported in AMQP");
- }
-
- checkWritableProperties();
- getJmsHeaders().setBytes(propertyName, bytes);
- }
-
- public void setShortProperty(String propertyName, short i) throws JMSException
- {
- if (_strictAMQP)
- {
- 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();
- JMSHeaderAdapter.checkPropertyName(propertyName);
- super.setIntProperty(new AMQShortString(propertyName), new Integer(i));
- }
-
- public void setLongProperty(String propertyName, long l) throws JMSException
- {
- if (_strictAMQP)
- {
- 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 (_strictAMQP)
- {
- 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 (_strictAMQP)
- {
- 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();
- JMSHeaderAdapter.checkPropertyName(propertyName);
- super.setLongStringProperty(new AMQShortString(propertyName), value);
- }
-
- public void setObjectProperty(String propertyName, Object object) throws JMSException
- {
- checkWritableProperties();
- getJmsHeaders().setObject(propertyName, object);
- }
-
- protected void removeProperty(AMQShortString propertyName) throws JMSException
- {
- getJmsHeaders().remove(propertyName);
- }
-
- protected void removeProperty(String propertyName) throws JMSException
- {
- getJmsHeaders().remove(propertyName);
- }
-
- 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();
- }
- }
-
- /**
- * 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;
-
- public String getMimeType()
- {
- return getMimeTypeAsShortString().toString();
- }
-
- public abstract AMQShortString getMimeTypeAsShortString();
-
- 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(_deliveryTag);
-
- buf.append("\nProperties:");
- if (getJmsHeaders().isEmpty())
- {
- buf.append("<NONE>");
- }
- else
- {
- buf.append('\n').append(getJmsHeaders().getHeaders());
- }
-
- return buf.toString();
- }
- catch (JMSException e)
- {
- return e.toString();
- }
- }
-
- public void setUnderlyingMessagePropertiesMap(FieldTable messageProperties)
- {
- getContentHeaderProperties().setHeaders(messageProperties);
- }
-
- public JMSHeaderAdapter getJmsHeaders()
- {
- return _headerAdapter;
- }
-
- 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");
- }
- }
-
- protected void checkWritableProperties() throws MessageNotWriteableException
- {
- if (_readableProperties)
- {
- throw new MessageNotWriteableException("You need to call clearProperties() to make the message writable");
- }
- }
-
- public boolean isReadable()
- {
- return _readableMessage;
- }
-
- public boolean isWritable()
- {
- return !_readableMessage;
- }
-
- public void reset()
- {
- if (!_changedData)
- {
- _data.rewind();
- }
- else
- {
- _data.flip();
- _changedData = false;
- }
- }
-
- public void setConsumer(BasicMessageConsumer basicMessageConsumer)
- {
- _consumer = basicMessageConsumer;
- }
-
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.java
deleted file mode 100644
index 87df7e1337..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/AbstractJMSMessageFactory.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.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.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 abstract AbstractJMSMessage createMessage(long messageNbr, ByteBuffer data, AMQShortString exchange,
- AMQShortString routingKey, ContentHeaderBody contentHeader) throws AMQException;
-
- protected AbstractJMSMessage createMessageWithBody(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();
- data.put(cb.payload);
- cb.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());
- }
-
- return createMessage(messageNbr, data, exchange, routingKey, contentHeader);
- }
-
- public AbstractJMSMessage createMessage(long messageNbr, boolean redelivered, ContentHeaderBody contentHeader,
- AMQShortString exchange, AMQShortString routingKey, List bodies) throws JMSException, AMQException
- {
- final AbstractJMSMessage msg = createMessageWithBody(messageNbr, contentHeader, exchange, routingKey, bodies);
- msg.setJMSRedelivered(redelivered);
-
- return msg;
- }
-
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessage.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessage.java
deleted file mode 100644
index 19382b58c3..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessage.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.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.ContentHeaderBody;
-
-public class JMSBytesMessage extends AbstractBytesMessage implements BytesMessage
-{
- public static final String MIME_TYPE = "application/octet-stream";
- private static final AMQShortString MIME_TYPE_SHORT_STRING = new AMQShortString(MIME_TYPE);
-
-
- public JMSBytesMessage()
- {
- this(null);
- }
-
- /**
- * Construct a bytes message with existing data.
- *
- * @param data the data that comprises this message. If data is null, you get a 1024 byte buffer that is
- * set to auto expand
- */
- JMSBytesMessage(ByteBuffer data)
- {
- super(data); // this instanties a content header
- }
-
- JMSBytesMessage(long messageNbr, ContentHeaderBody contentHeader, AMQShortString exchange,
- AMQShortString routingKey, ByteBuffer data) throws AMQException
- {
- super(messageNbr, contentHeader, exchange, routingKey, data);
- }
-
- public void reset()
- {
- super.reset();
- _readableMessage = true;
- }
-
- public AMQShortString getMimeTypeAsShortString()
- {
- return MIME_TYPE_SHORT_STRING;
- }
-
- 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/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessageFactory.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessageFactory.java
deleted file mode 100644
index fd2aae9feb..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSBytesMessageFactory.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 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.ContentHeaderBody;
-
-public class JMSBytesMessageFactory extends AbstractJMSMessageFactory
-{
- protected AbstractJMSMessage createMessage(long deliveryTag, ByteBuffer data,
- AMQShortString exchange, AMQShortString routingKey,
- ContentHeaderBody contentHeader) throws AMQException
- {
- return new JMSBytesMessage(deliveryTag, contentHeader, exchange, routingKey, data);
- }
-
- public AbstractJMSMessage createMessage() throws JMSException
- {
- return new JMSBytesMessage();
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSHeaderAdapter.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSHeaderAdapter.java
deleted file mode 100644
index 39b4e1e27b..0000000000
--- a/Final/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 static 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 static 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/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.java
deleted file mode 100644
index a70acbabbe..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessage.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.message;
-
-import org.apache.mina.common.ByteBuffer;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ContentHeaderBody;
-
-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 static final AMQShortString MIME_TYPE_SHORT_STRING = new AMQShortString(MIME_TYPE);
-
- private Map<String, Object> _map = new HashMap<String, Object>();
-
- public JMSMapMessage() throws JMSException
- {
- this(null);
- }
-
- JMSMapMessage(ByteBuffer data) throws JMSException
- {
- super(data); // this instantiates a content header
- populateMapFromData();
- }
-
- JMSMapMessage(long messageNbr, ContentHeaderBody contentHeader, AMQShortString exchange, AMQShortString routingKey,
- ByteBuffer data) throws AMQException
- {
- super(messageNbr, contentHeader, exchange, routingKey, data);
- try
- {
- populateMapFromData();
- }
- catch (JMSException je)
- {
- throw new AMQException("Error populating MapMessage from ByteBuffer", je);
-
- }
-
- }
-
- public String toBodyString() throws JMSException
- {
- return _map.toString();
- }
-
- public AMQShortString getMimeTypeAsShortString()
- {
- return MIME_TYPE_SHORT_STRING;
- }
-
- 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/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessageFactory.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessageFactory.java
deleted file mode 100644
index a6b9bb29a4..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSMapMessageFactory.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 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.ContentHeaderBody;
-
-public class JMSMapMessageFactory extends AbstractJMSMessageFactory
-{
- public AbstractJMSMessage createMessage() throws JMSException
- {
- return new JMSMapMessage();
- }
-
- protected AbstractJMSMessage createMessage(long deliveryTag, ByteBuffer data,
- AMQShortString exchange, AMQShortString routingKey,
- ContentHeaderBody contentHeader) throws AMQException
- {
- return new JMSMapMessage(deliveryTag, contentHeader, exchange, routingKey, data);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.java
deleted file mode 100644
index caf8741280..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessage.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.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;
-import org.apache.qpid.framing.ContentHeaderBody;
-
-public class JMSObjectMessage extends AbstractJMSMessage implements ObjectMessage
-{
- public static final String MIME_TYPE = "application/java-object-stream";
- private static final AMQShortString MIME_TYPE_SHORT_STRING = new AMQShortString(MIME_TYPE);
-
- private static final int DEFAULT_BUFFER_SIZE = 1024;
-
- /**
- * Creates empty, writable message for use by producers
- */
- public JMSObjectMessage()
- {
- this(null);
- }
-
- private JMSObjectMessage(ByteBuffer data)
- {
- super(data);
- if (data == null)
- {
- _data = ByteBuffer.allocate(DEFAULT_BUFFER_SIZE);
- _data.setAutoExpand(true);
- }
-
- getContentHeaderProperties().setContentType(MIME_TYPE_SHORT_STRING);
- }
-
- /**
- * Creates read only message for delivery to consumers
- */
- JMSObjectMessage(long messageNbr, ContentHeaderBody contentHeader, AMQShortString exchange, AMQShortString routingKey,
- ByteBuffer data) throws AMQException
- {
- super(messageNbr, (BasicContentHeaderProperties) contentHeader.properties, exchange, routingKey, data);
- }
-
- public void clearBodyImpl() throws JMSException
- {
- if (_data != null)
- {
- _data.release();
- }
-
- _data = null;
-
- }
-
- public String toBodyString() throws JMSException
- {
- return toString(_data);
- }
-
- public AMQShortString getMimeTypeAsShortString()
- {
- return MIME_TYPE_SHORT_STRING;
- }
-
- 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)
- { }
- }
-
- private static String toString(ByteBuffer data)
- {
- if (data == null)
- {
- return null;
- }
-
- int pos = data.position();
- try
- {
- return data.getString(Charset.forName("UTF8").newDecoder());
- }
- catch (CharacterCodingException e)
- {
- return null;
- }
- finally
- {
- data.position(pos);
- }
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessageFactory.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessageFactory.java
deleted file mode 100644
index 57ac4fb006..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSObjectMessageFactory.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 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.ContentHeaderBody;
-
-public class JMSObjectMessageFactory extends AbstractJMSMessageFactory
-{
- protected AbstractJMSMessage createMessage(long deliveryTag, ByteBuffer data,
- AMQShortString exchange, AMQShortString routingKey,
- ContentHeaderBody contentHeader) throws AMQException
- {
- return new JMSObjectMessage(deliveryTag, contentHeader, exchange, routingKey, data);
- }
-
- public AbstractJMSMessage createMessage() throws JMSException
- {
- return new JMSObjectMessage();
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.java
deleted file mode 100644
index b4350c7a98..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessage.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.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.ContentHeaderBody;
-
-/**
- * @author Apache Software Foundation
- */
-public class JMSStreamMessage extends AbstractBytesTypedMessage implements StreamMessage
-{
- public static final String MIME_TYPE="jms/stream-message";
- private static final AMQShortString MIME_TYPE_SHORT_STRING = new AMQShortString(MIME_TYPE);
-
-
- /**
- * 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()
- {
- this(null);
- }
-
- /**
- * Construct a stream message with existing data.
- *
- * @param data the data that comprises this message. If data is null, you get a 1024 byte buffer that is
- * set to auto expand
- */
- JMSStreamMessage(ByteBuffer data)
- {
- super(data); // this instanties a content header
- }
-
-
- JMSStreamMessage(long messageNbr, ContentHeaderBody contentHeader, AMQShortString exchange,
- AMQShortString routingKey, ByteBuffer data) throws AMQException
- {
- super(messageNbr, contentHeader, exchange, routingKey, data);
- }
-
- public void reset()
- {
- super.reset();
- _readableMessage = true;
- }
-
- public AMQShortString getMimeTypeAsShortString()
- {
- return MIME_TYPE_SHORT_STRING;
- }
-
-
-
- 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/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessageFactory.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessageFactory.java
deleted file mode 100644
index c34ee7175d..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSStreamMessageFactory.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 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.ContentHeaderBody;
-
-public class JMSStreamMessageFactory extends AbstractJMSMessageFactory
-{
- protected AbstractJMSMessage createMessage(long deliveryTag, ByteBuffer data,
- AMQShortString exchange, AMQShortString routingKey,
- ContentHeaderBody contentHeader) throws AMQException
- {
- return new JMSStreamMessage(deliveryTag, contentHeader, exchange, routingKey, data);
- }
-
- public AbstractJMSMessage createMessage() throws JMSException
- {
- return new JMSStreamMessage();
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessage.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessage.java
deleted file mode 100644
index 87cc80f21d..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessage.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.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;
-
-public class JMSTextMessage extends AbstractJMSMessage implements javax.jms.TextMessage
-{
- private static final String MIME_TYPE = "text/plain";
- private static final AMQShortString MIME_TYPE_SHORT_STRING = new AMQShortString(MIME_TYPE);
-
-
- private String _decodedValue;
-
- /**
- * This constant represents the name of a property that is set when the message payload is null.
- */
- private static final AMQShortString PAYLOAD_NULL_PROPERTY = CustomJMSXProperty.JMS_AMQP_NULL.getShortStringName();
- private static final Charset DEFAULT_CHARSET = Charset.forName("UTF-8");
-
- public JMSTextMessage() throws JMSException
- {
- this(null, null);
- }
-
- JMSTextMessage(ByteBuffer data, String encoding) throws JMSException
- {
- super(data); // this instantiates a content header
- getContentHeaderProperties().setContentType(MIME_TYPE_SHORT_STRING);
- getContentHeaderProperties().setEncoding(encoding);
- }
-
- JMSTextMessage(long deliveryTag, BasicContentHeaderProperties contentHeader, AMQShortString exchange,
- AMQShortString routingKey, ByteBuffer data)
- throws AMQException
- {
- super(deliveryTag, contentHeader, exchange, routingKey, data);
- contentHeader.setContentType(MIME_TYPE_SHORT_STRING);
- _data = data;
- }
-
- JMSTextMessage(ByteBuffer data) throws JMSException
- {
- this(data, null);
- }
-
- JMSTextMessage(String text) throws JMSException
- {
- super((ByteBuffer) null);
- setText(text);
- }
-
- public void clearBodyImpl() throws JMSException
- {
- if (_data != null)
- {
- _data.release();
- }
- _data = null;
- _decodedValue = null;
- }
-
- public String toBodyString() throws JMSException
- {
- return getText();
- }
-
- public void setData(ByteBuffer data)
- {
- _data = data;
- }
-
- public AMQShortString getMimeTypeAsShortString()
- {
- return MIME_TYPE_SHORT_STRING;
- }
-
- public void setText(String text) throws JMSException
- {
- checkWritable();
-
- clearBody();
- try
- {
- if (text != null)
- {
- _data = ByteBuffer.allocate(text.length());
- _data.limit(text.length()) ;
- //_data.sweep();
- _data.setAutoExpand(true);
- final String encoding = getContentHeaderProperties().getEncodingAsString();
- if (encoding == null)
- {
- _data.put(text.getBytes(DEFAULT_CHARSET.name()));
- }
- else
- {
- _data.put(text.getBytes(encoding));
- }
- _changedData=true;
- }
- _decodedValue = text;
- }
- catch (UnsupportedEncodingException e)
- {
- // should never occur
- JMSException jmse = new JMSException("Unable to decode text data");
- jmse.setLinkedException(e);
- }
- }
-
- 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 (getContentHeaderProperties().getEncodingAsString() != null)
- {
- try
- {
- _decodedValue = _data.getString(Charset.forName(getContentHeaderProperties().getEncodingAsString()).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/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessageFactory.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessageFactory.java
deleted file mode 100644
index c5942dbe2a..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/JMSTextMessageFactory.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;
-
-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.ContentHeaderBody;
-
-public class JMSTextMessageFactory extends AbstractJMSMessageFactory
-{
-
- public AbstractJMSMessage createMessage() throws JMSException
- {
- return new JMSTextMessage();
- }
-
- protected AbstractJMSMessage createMessage(long deliveryTag, ByteBuffer data,
- AMQShortString exchange, AMQShortString routingKey,
- ContentHeaderBody contentHeader) throws AMQException
- {
- return new JMSTextMessage(deliveryTag, (BasicContentHeaderProperties) contentHeader.properties,
- exchange, routingKey, data);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/MessageConverter.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/MessageConverter.java
deleted file mode 100644
index f6b11c6f6c..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/MessageConverter.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.client.message;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.BytesMessage;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.MessageEOFException;
-import javax.jms.ObjectMessage;
-import javax.jms.StreamMessage;
-import javax.jms.TextMessage;
-
-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(BytesMessage message) throws JMSException
- {
- BytesMessage bytesMessage = (BytesMessage) message;
- bytesMessage.reset();
-
- JMSBytesMessage nativeMsg = new JMSBytesMessage();
-
- byte[] buf = new byte[1024];
-
- int len;
-
- while ((len = bytesMessage.readBytes(buf)) != -1)
- {
- nativeMsg.writeBytes(buf, 0, len);
- }
-
- _newMessage = nativeMsg;
- setMessageProperties(message);
- }
-
- public MessageConverter(MapMessage message) throws JMSException
- {
- MapMessage nativeMessage = new JMSMapMessage();
-
- 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(ObjectMessage message) throws JMSException
- {
- ObjectMessage origMessage = (ObjectMessage) message;
- ObjectMessage nativeMessage = new JMSObjectMessage();
-
- nativeMessage.setObject(origMessage.getObject());
-
- _newMessage = (AbstractJMSMessage) nativeMessage;
- setMessageProperties(message);
-
- }
-
- public MessageConverter(TextMessage message) throws JMSException
- {
- TextMessage nativeMessage = new JMSTextMessage();
-
- nativeMessage.setText(message.getText());
-
- _newMessage = (AbstractJMSMessage) nativeMessage;
- setMessageProperties(message);
- }
-
- public MessageConverter(StreamMessage message) throws JMSException
- {
- StreamMessage nativeMessage = new JMSStreamMessage();
-
- 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(Message message) throws JMSException
- {
- // Send a message with just properties.
- // Throwing away content
- BytesMessage nativeMessage = new JMSBytesMessage();
-
- _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/Final/java/client/src/main/java/org/apache/qpid/client/message/MessageFactory.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/MessageFactory.java
deleted file mode 100644
index 0fe4af715d..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/MessageFactory.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 java.util.List;
-
-import javax.jms.JMSException;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ContentHeaderBody;
-
-
-public interface MessageFactory
-{
- AbstractJMSMessage createMessage(long deliveryTag, boolean redelivered,
- ContentHeaderBody contentHeader,
- AMQShortString exchange, AMQShortString routingKey,
- List bodies)
- throws JMSException, AMQException;
-
- AbstractJMSMessage createMessage() throws JMSException;
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.java
deleted file mode 100644
index c2015f9e7c..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/MessageFactoryRegistry.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.client.message;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-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;
-
-public class MessageFactoryRegistry
-{
- 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("Unsupport MIME type of " + properties.getContentTypeAsString());
- }
- else
- {
- return mf.createMessage(deliveryTag, redelivered, contentHeader, exchange, routingKey, bodies);
- }
- }
-
- public AbstractJMSMessage createMessage(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("Unsupport MIME type of " + mimeType);
- }
- else
- {
- return mf.createMessage();
- }
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/UnexpectedBodyReceivedException.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/UnexpectedBodyReceivedException.java
deleted file mode 100644
index 1f61a661d4..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/UnexpectedBodyReceivedException.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.client.message;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-
-/**
- * @todo Not used! Delete!
- */
-public class UnexpectedBodyReceivedException extends AMQException
-{
- public UnexpectedBodyReceivedException(String msg, Throwable t)
- {
- super(msg, t);
- }
-
- public UnexpectedBodyReceivedException(String msg)
- {
- super(msg);
- }
-
- public UnexpectedBodyReceivedException(AMQConstant errorCode, String msg)
- {
- super(errorCode, msg);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.java b/Final/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.java
deleted file mode 100644
index 5b199f2478..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/message/UnprocessedMessage.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.message;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.qpid.framing.BasicDeliverBody;
-import org.apache.qpid.framing.BasicReturnBody;
-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
-{
- private long _bytesReceived = 0;
-
- private final BasicDeliverBody _deliverBody;
- private final BasicReturnBody _bounceBody; // TODO: check change (gustavo)
- private final int _channelId;
- 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(int channelId, BasicDeliverBody deliverBody)
- {
- _deliverBody = deliverBody;
- _channelId = channelId;
- _bounceBody = null;
- }
-
-
- public UnprocessedMessage(int channelId, BasicReturnBody bounceBody)
- {
- _deliverBody = null;
- _channelId = channelId;
- _bounceBody = bounceBody;
- }
-
- public void receiveBody(ContentBody body) //throws UnexpectedBodyReceivedException
- {
-
- 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 boolean isAllBodyDataReceived()
- {
- return _bytesReceived == getContentHeader().bodySize;
- }
-
- public BasicDeliverBody getDeliverBody()
- {
- return _deliverBody;
- }
-
- public BasicReturnBody getBounceBody()
- {
- return _bounceBody;
- }
-
-
- public int getChannelId()
- {
- return _channelId;
- }
-
-
- public ContentHeaderBody getContentHeader()
- {
- return _contentHeader;
- }
-
- public void setContentHeader(ContentHeaderBody contentHeader)
- {
- this._contentHeader = contentHeader;
- }
-
- public List<ContentBody> getBodies()
- {
- return _bodies;
- }
-
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java
deleted file mode 100644
index e7ff5afceb..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolHandler.java
+++ /dev/null
@@ -1,732 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.IoHandlerAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.filter.SSLFilter;
-import org.apache.mina.filter.codec.ProtocolCodecException;
-import org.apache.mina.filter.codec.ProtocolCodecFilter;
-
-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.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.listener.SpecificMethodFrameListener;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.framing.AMQBody;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ConnectionCloseBody;
-import org.apache.qpid.framing.ConnectionCloseOkBody;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.HeartbeatBody;
-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.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.Iterator;
-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);
-
- /**
- * 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 _frameListeners = new CopyOnWriteArraySet();
-
- /**
- * 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;
-
- /** Defines the default timeout to use for synchronous protocol commands. */
- private final long DEFAULT_SYNC_TIMEOUT = 1000 * 30;
-
- /**
- * 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)
- {
- e.printStackTrace();
- }
-
- _protocolSession = new AMQProtocolSession(this, session, _connection, getStateManager());
- _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."));
- }
- 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)
- {
- _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);
- propagateExceptionToWaiters(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);
- propagateExceptionToWaiters(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.
- *
- * @param e the exception to propagate
- */
- public void propagateExceptionToWaiters(Exception e)
- {
- getStateManager().error(e);
- if (!_frameListeners.isEmpty())
- {
- final Iterator it = _frameListeners.iterator();
- while (it.hasNext())
- {
- final AMQMethodListener ml = (AMQMethodListener) it.next();
- ml.error(e);
- }
- }
- }
-
- private static int _messageReceivedCount;
-
- public void messageReceived(IoSession session, Object message) throws Exception
- {
- 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);
-
- switch (bodyFrame.getFrameType())
- {
- case AMQMethodBody.TYPE:
-
- if (debug)
- {
- _logger.debug("(" + System.identityHashCode(this) + ")Method frame received: " + frame);
- }
-
- final AMQMethodEvent<AMQMethodBody> evt =
- new AMQMethodEvent<AMQMethodBody>(frame.getChannel(), (AMQMethodBody) bodyFrame);
-
- try
- {
-
- boolean wasAnyoneInterested = getStateManager().methodReceived(evt);
- if (!_frameListeners.isEmpty())
- {
- Iterator it = _frameListeners.iterator();
- while (it.hasNext())
- {
- final AMQMethodListener listener = (AMQMethodListener) it.next();
- wasAnyoneInterested = listener.methodReceived(evt) || wasAnyoneInterested;
- }
- }
-
- if (!wasAnyoneInterested)
- {
- throw new AMQException("AMQMethodEvent " + evt + " was not processed by any listener. Listeners:"
- + _frameListeners);
- }
- }
- catch (AMQException e)
- {
- getStateManager().error(e);
- if (!_frameListeners.isEmpty())
- {
- Iterator it = _frameListeners.iterator();
- while (it.hasNext())
- {
- final AMQMethodListener listener = (AMQMethodListener) it.next();
- listener.error(e);
- }
- }
-
- exceptionCaught(session, e);
- }
-
- break;
-
- case ContentHeaderBody.TYPE:
-
- _protocolSession.messageContentHeaderReceived(frame.getChannel(), (ContentHeaderBody) bodyFrame);
- break;
-
- case ContentBody.TYPE:
-
- _protocolSession.messageContentBodyReceived(frame.getChannel(), (ContentBody) bodyFrame);
- break;
-
- case HeartbeatBody.TYPE:
-
- if (debug)
- {
- _logger.debug("Received heartbeat");
- }
-
- break;
-
- default:
-
- }
-
- _connection.bytesReceived(_protocolSession.getIoSession().getReadBytes());
- }
-
- private static int _messagesOut;
-
- public void messageSent(IoSession session, Object message) throws Exception
- {
- final long sentMessages = _messagesOut++;
-
- final boolean debug = _logger.isDebugEnabled();
-
- if (debug && ((sentMessages % 1000) == 0))
- {
- _logger.debug("Sent " + _messagesOut + " protocol messages");
- }
-
- _connection.bytesSent(session.getWrittenBytes());
- if (debug)
- {
- _logger.debug("Sent frame " + message);
- }
- }
-
- /*
- public void addFrameListener(AMQMethodListener listener)
- {
- _frameListeners.add(listener);
- }
-
- public void removeFrameListener(AMQMethodListener listener)
- {
- _frameListeners.remove(listener);
- }
- */
- public void attainState(AMQState s) throws AMQException
- {
- getStateManager().attainState(s);
- }
-
- /**
- * 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
- {
- _frameListeners.add(listener);
- _protocolSession.writeFrame(frame);
-
- AMQMethodEvent e = listener.blockForFrame(timeout);
-
- return e;
- // When control resumes before this line, a reply will have been received
- // that matches the criteria defined in the blocking listener
- }
- catch (AMQException e)
- {
- throw e;
- }
- 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);
-
- // 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.
- final AMQFrame frame =
- ConnectionCloseBody.createAMQFrame(0, _protocolSession.getProtocolMajorVersion(),
- _protocolSession.getProtocolMinorVersion(), // AMQP version (major, minor)
- 0, // classId
- 0, // methodId
- AMQConstant.REPLY_SUCCESS.getCode(), // replyCode
- new AMQShortString("JMS client is closing the connection.")); // replyText
-
- 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
- {
- if (_failoverLatch != null)
- {
- _failoverLatch.await();
- }
- }
-
- public AMQShortString generateQueueName()
- {
- return _protocolSession.generateQueueName();
- }
-
- public CountDownLatch getFailoverLatch()
- {
- return _failoverLatch;
- }
-
- public void setFailoverLatch(CountDownLatch failoverLatch)
- {
- _failoverLatch = failoverLatch;
- }
-
- public AMQConnection getConnection()
- {
- return _connection;
- }
-
- public AMQStateManager getStateManager()
- {
- return _stateManager;
- }
-
- public void setStateManager(AMQStateManager stateManager)
- {
- _stateManager = stateManager;
- if (_protocolSession != null)
- {
- _protocolSession.setStateManager(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();
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java b/Final/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
deleted file mode 100644
index 5fe6ffe6c6..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/protocol/AMQProtocolSession.java
+++ /dev/null
@@ -1,459 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.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.UnexpectedBodyReceivedException;
-import org.apache.qpid.client.message.UnprocessedMessage;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ContentBody;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.MainRegistry;
-import org.apache.qpid.framing.ProtocolInitiation;
-import org.apache.qpid.framing.ProtocolVersion;
-import org.apache.qpid.framing.VersionSpecificRegistry;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.protocol.AMQVersionAwareProtocolSession;
-
-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 java.util.UUID;
-
-/**
- * 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;
-
- private AMQStateManager _stateManager;
-
- 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.
- */
- protected ConcurrentMap _channelId2UnprocessedMsgMap = new ConcurrentHashMap();
-
- /** Counter to ensure unique queue names */
- protected int _queueId = 1;
- protected final Object _queueIdLock = new Object();
-
- private byte _protocolMinorVersion;
- private byte _protocolMajorVersion;
- private VersionSpecificRegistry _registry =
- MainRegistry.getVersionSpecificRegistry(ProtocolVersion.getLatestSupportedVersion());
-
- private final AMQConnection _connection;
-
- public AMQProtocolSession(AMQProtocolHandler protocolHandler, IoSession protocolSession, AMQConnection connection)
- {
- this(protocolHandler, protocolSession, connection, new AMQStateManager());
-
- }
-
- public AMQProtocolSession(AMQProtocolHandler protocolHandler, IoSession protocolSession, AMQConnection connection,
- AMQStateManager stateManager)
- {
- _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);
- _stateManager = stateManager;
- _stateManager.setProtocolSession(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(ProtocolVersion.getLatestSupportedVersion()));
- }
-
- 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 _stateManager;
- }
-
- public void setStateManager(AMQStateManager stateManager)
- {
- _stateManager = stateManager;
- }
-
- 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(UnprocessedMessage message) throws AMQException
- {
- _channelId2UnprocessedMsgMap.put(message.getChannelId(), message);
- }
-
- public void messageContentHeaderReceived(int channelId, ContentHeaderBody contentHeader) throws AMQException
- {
- UnprocessedMessage msg = (UnprocessedMessage) _channelId2UnprocessedMsgMap.get(channelId);
- if (msg == null)
- {
- throw new AMQException("Error: received content header without having received a BasicDeliver frame first");
- }
-
- if (msg.getContentHeader() != null)
- {
- throw new AMQException(
- "Error: received duplicate content header or did not receive correct number of content body frames");
- }
-
- msg.setContentHeader(contentHeader);
- if (contentHeader.bodySize == 0)
- {
- deliverMessageToAMQSession(channelId, msg);
- }
- }
-
- public void messageContentBodyReceived(int channelId, ContentBody contentBody) throws AMQException
- {
- UnprocessedMessage msg = (UnprocessedMessage) _channelId2UnprocessedMsgMap.get(channelId);
- if (msg == null)
- {
- throw new AMQException("Error: received content body without having received a JMSDeliver frame first");
- }
-
- if (msg.getContentHeader() == 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);
- }
- }
-
- /**
- * 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);
- _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));
- }
- catch (JMSException e)
- {
- throw new AMQException("JMSException received while closing session", e);
- }
-
- return true;
- }
- else
- {
- return false;
- }
- }
-
- public AMQConnection getAMQConnection()
- {
- return (AMQConnection) _minaProtocolSession.getAttribute(AMQ_CONNECTION);
- }
-
- public void closeProtocolSession()
- {
- closeProtocolSession(true);
- }
-
- public void closeProtocolSession(boolean waitLast)
- {
- _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();
- future.join(LAST_WRITE_FUTURE_JOIN_TIMEOUT);
- }
-
- public void failover(String host, int port)
- {
- _protocolHandler.failover(host, port);
- }
-
- protected AMQShortString generateQueueName()
- {
- int id;
-
- return new AMQShortString("tmp_" + UUID.randomUUID());
- }
-
- /** @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);
- }
-
- public void setProtocolVersion(final byte versionMajor, final byte versionMinor)
- {
- _protocolMajorVersion = versionMajor;
- _protocolMinorVersion = versionMinor;
- _registry = MainRegistry.getVersionSpecificRegistry(versionMajor, versionMinor);
- }
-
- public byte getProtocolMinorVersion()
- {
- return _protocolMinorVersion;
- }
-
- public byte getProtocolMajorVersion()
- {
- return _protocolMajorVersion;
- }
-
- public VersionSpecificRegistry getRegistry()
- {
- return _registry;
- }
-
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.java b/Final/java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.java
deleted file mode 100644
index 1badbb601c..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/protocol/BlockingMethodFrameListener.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.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.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 What is to stop a blocking method listener, receiving a second method whilst it is registered as a listener,
- * overwriting the first one before the caller of the block method has had a chance to examine it? If one-shot
- * behaviour is to be intended it should be enforced, perhaps by always returning false once the blocked for
- * method has been received.
- *
- * @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 BlockingMethodFrameListener implements AMQMethodListener
-{
- /** 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 channel id for the channel upon which this listener is waiting for a response. */
- protected int _channelId;
-
- /** Holds the incoming method. */
- protected AMQMethodEvent _doneEvt = 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 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); // throws AMQException;
-
- /**
- * 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) // throws AMQException
- {
- AMQMethodBody method = evt.getMethod();
-
- /*try
- {*/
- boolean ready = (evt.getChannelId() == _channelId) && processMethod(evt.getChannelId(), method);
-
- 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
- {
- _doneEvt = evt;
- _ready = ready;
- _receivedCondition.signal();
- }
- finally
- {
- _lock.unlock();
- }
- }
-
- 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;
- }*/
- }
-
- /**
- * 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
- {
- long nanoTimeout = TimeUnit.MILLISECONDS.toNanos(timeout);
-
- _lock.lock();
-
- try
- {
- 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");
- _ready = true;
- }
- }
- }
- catch (InterruptedException e)
- {
- // 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
- {
- _errorAck = true;
- _errorConditionAck.signal();
- _error = null;
- _lock.unlock();
- }
-
- return _doneEvt;
- }
-
- /**
- * 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.
- *
- * @param e
- */
- 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 (_error == null)
- {
- _error = e;
- }
- else
- {
- System.err.println("WARNING: new error arrived while old one not yet processed");
- }
-
- try
- {
- _ready = true;
- _receivedCondition.signal();
-
- while (!_errorAck)
- {
- try
- {
- _errorConditionAck.await();
- }
- catch (InterruptedException e1)
- {
- //
- }
- }
- _errorAck = false;
- }
- finally
- {
- _lock.unlock();
- }
- }
-
- public boolean equals(Object o)
- {
-
- if (o instanceof BlockingMethodFrameListener)
- {
- BlockingMethodFrameListener other = (BlockingMethodFrameListener) o;
-
- return _channelId == other._channelId;
- }
-
- return false;
- }
-
-
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatConfig.java b/Final/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatConfig.java
deleted file mode 100644
index 35ea44a331..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatDiagnostics.java b/Final/java/client/src/main/java/org/apache/qpid/client/protocol/HeartbeatDiagnostics.java
deleted file mode 100644
index d44faeab04..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/protocol/ProtocolBufferMonitorFilter.java b/Final/java/client/src/main/java/org/apache/qpid/client/protocol/ProtocolBufferMonitorFilter.java
deleted file mode 100644
index 93cc5e7ec3..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/security/AMQCallbackHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/security/AMQCallbackHandler.java
deleted file mode 100644
index fbca444208..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.java b/Final/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.java
deleted file mode 100644
index 140cbdeb75..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.properties b/Final/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.properties
deleted file mode 100644
index 89ee8337f8..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/security/CallbackHandlerRegistry.properties
+++ /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.
-#
-CallbackHandler.CRAM-MD5-HASHED=org.apache.qpid.client.security.UsernameHashedPasswordCallbackHandler
-CallbackHandler.CRAM-MD5=org.apache.qpid.client.security.UsernamePasswordCallbackHandler
-CallbackHandler.PLAIN=org.apache.qpid.client.security.UsernamePasswordCallbackHandler
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.java b/Final/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.java
deleted file mode 100644
index 803b34b7fa..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.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.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)
- {
- Security.insertProviderAt(new JCAProvider(factories), 0);
- _logger.debug("Dynamic SASL provider added as a security provider");
- }
- }
- 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;
- }
-
- factoriesToRegister.put(mechanism, (Class<? extends SaslClientFactory>) clazz);
- }
- catch (Exception ex)
- {
- _logger.error("Error instantiating SaslClientFactory calss " + className + " - skipping");
- }
- }
-
- return factoriesToRegister;
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.properties b/Final/java/client/src/main/java/org/apache/qpid/client/security/DynamicSaslRegistrar.properties
deleted file mode 100644
index 1bff43142b..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/security/JCAProvider.java b/Final/java/client/src/main/java/org/apache/qpid/client/security/JCAProvider.java
deleted file mode 100644
index 5a2c5ac5c1..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/security/JCAProvider.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.security;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.security.sasl.SaslClientFactory;
-
-import java.security.Provider;
-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", 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/Final/java/client/src/main/java/org/apache/qpid/client/security/UsernameHashedPasswordCallbackHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/security/UsernameHashedPasswordCallbackHandler.java
deleted file mode 100644
index 66176dac3c..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/security/UsernamePasswordCallbackHandler.java b/Final/java/client/src/main/java/org/apache/qpid/client/security/UsernamePasswordCallbackHandler.java
deleted file mode 100644
index c50c62710f..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClient.java b/Final/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClient.java
deleted file mode 100644
index f8a25c630c..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClientFactory.java b/Final/java/client/src/main/java/org/apache/qpid/client/security/amqplain/AmqPlainSaslClientFactory.java
deleted file mode 100644
index 30cc786890..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/security/crammd5hashed/CRAMMD5HashedSaslClientFactory.java b/Final/java/client/src/main/java/org/apache/qpid/client/security/crammd5hashed/CRAMMD5HashedSaslClientFactory.java
deleted file mode 100644
index 22bb1ac156..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/state/AMQState.java b/Final/java/client/src/main/java/org/apache/qpid/client/state/AMQState.java
deleted file mode 100644
index 4996f59345..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/state/AMQState.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.client.state;
-
-/**
- * States used in the AMQ protocol. Used by the finite state machine to determine
- * valid responses.
- */
-public class AMQState
-{
- 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;
- }
-
- public static final AMQState CONNECTION_NOT_STARTED = new AMQState(1, "CONNECTION_NOT_STARTED");
-
- public static final AMQState CONNECTION_NOT_TUNED = new AMQState(2, "CONNECTION_NOT_TUNED");
-
- public static final AMQState CONNECTION_NOT_OPENED = new AMQState(3, "CONNECTION_NOT_OPENED");
-
- public static final AMQState CONNECTION_OPEN = new AMQState(4, "CONNECTION_OPEN");
-
- public static final AMQState CONNECTION_CLOSING = new AMQState(5, "CONNECTION_CLOSING");
-
- public static final AMQState CONNECTION_CLOSED = new AMQState(6, "CONNECTION_CLOSED");
-
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/state/AMQStateChangedEvent.java b/Final/java/client/src/main/java/org/apache/qpid/client/state/AMQStateChangedEvent.java
deleted file mode 100644
index edef54ccd6..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/state/AMQStateListener.java b/Final/java/client/src/main/java/org/apache/qpid/client/state/AMQStateListener.java
deleted file mode 100644
index 110471aad0..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java b/Final/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.java
deleted file mode 100644
index 227f23b540..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/state/AMQStateManager.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.client.state;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.handler.BasicCancelOkMethodHandler;
-import org.apache.qpid.client.handler.BasicDeliverMethodHandler;
-import org.apache.qpid.client.handler.BasicReturnMethodHandler;
-import org.apache.qpid.client.handler.ChannelCloseMethodHandler;
-import org.apache.qpid.client.handler.ChannelCloseOkMethodHandler;
-import org.apache.qpid.client.handler.ChannelFlowOkMethodHandler;
-import org.apache.qpid.client.handler.ConnectionCloseMethodHandler;
-import org.apache.qpid.client.handler.ConnectionOpenOkMethodHandler;
-import org.apache.qpid.client.handler.ConnectionSecureMethodHandler;
-import org.apache.qpid.client.handler.ConnectionStartMethodHandler;
-import org.apache.qpid.client.handler.ConnectionTuneMethodHandler;
-import org.apache.qpid.client.handler.ExchangeBoundOkMethodHandler;
-import org.apache.qpid.client.handler.QueueDeleteOkMethodHandler;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.BasicCancelOkBody;
-import org.apache.qpid.framing.BasicDeliverBody;
-import org.apache.qpid.framing.BasicReturnBody;
-import org.apache.qpid.framing.ChannelCloseBody;
-import org.apache.qpid.framing.ChannelCloseOkBody;
-import org.apache.qpid.framing.ChannelFlowOkBody;
-import org.apache.qpid.framing.ConnectionCloseBody;
-import org.apache.qpid.framing.ConnectionOpenOkBody;
-import org.apache.qpid.framing.ConnectionSecureBody;
-import org.apache.qpid.framing.ConnectionStartBody;
-import org.apache.qpid.framing.ConnectionTuneBody;
-import org.apache.qpid.framing.ExchangeBoundOkBody;
-import org.apache.qpid.framing.QueueDeleteOkBody;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.protocol.AMQMethodListener;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.concurrent.CopyOnWriteArraySet;
-
-/**
- * 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 = LoggerFactory.getLogger(AMQStateManager.class);
-
- private 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.
- */
- protected final Map _state2HandlersMap = new HashMap();
-
- private final CopyOnWriteArraySet _stateListeners = new CopyOnWriteArraySet();
- private final Object _stateLock = new Object();
- private static final long MAXIMUM_STATE_WAIT_TIME = 30000L;
-
- public AMQStateManager()
- {
- this(null);
- }
-
- public AMQStateManager(AMQProtocolSession protocolSession)
- {
- this(AMQState.CONNECTION_NOT_STARTED, true, protocolSession);
- }
-
- protected AMQStateManager(AMQState state, boolean register, AMQProtocolSession protocolSession)
- {
- _protocolSession = protocolSession;
- _currentState = state;
- if (register)
- {
- registerListeners();
- }
- }
-
- protected void registerListeners()
- {
- Map frame2handlerMap = new HashMap();
-
- // 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.put(null, frame2handlerMap);
-
- frame2handlerMap = new HashMap();
- frame2handlerMap.put(ConnectionStartBody.class, ConnectionStartMethodHandler.getInstance());
- frame2handlerMap.put(ConnectionCloseBody.class, ConnectionCloseMethodHandler.getInstance());
- _state2HandlersMap.put(AMQState.CONNECTION_NOT_STARTED, frame2handlerMap);
-
- frame2handlerMap = new HashMap();
- frame2handlerMap.put(ConnectionTuneBody.class, ConnectionTuneMethodHandler.getInstance());
- frame2handlerMap.put(ConnectionSecureBody.class, ConnectionSecureMethodHandler.getInstance());
- frame2handlerMap.put(ConnectionCloseBody.class, ConnectionCloseMethodHandler.getInstance());
- _state2HandlersMap.put(AMQState.CONNECTION_NOT_TUNED, frame2handlerMap);
-
- frame2handlerMap = new HashMap();
- frame2handlerMap.put(ConnectionOpenOkBody.class, ConnectionOpenOkMethodHandler.getInstance());
- frame2handlerMap.put(ConnectionCloseBody.class, ConnectionCloseMethodHandler.getInstance());
- _state2HandlersMap.put(AMQState.CONNECTION_NOT_OPENED, frame2handlerMap);
-
- //
- // ConnectionOpen handlers
- //
- frame2handlerMap = new HashMap();
- frame2handlerMap.put(ChannelCloseBody.class, ChannelCloseMethodHandler.getInstance());
- frame2handlerMap.put(ChannelCloseOkBody.class, ChannelCloseOkMethodHandler.getInstance());
- frame2handlerMap.put(ConnectionCloseBody.class, ConnectionCloseMethodHandler.getInstance());
- frame2handlerMap.put(BasicDeliverBody.class, BasicDeliverMethodHandler.getInstance());
- frame2handlerMap.put(BasicReturnBody.class, BasicReturnMethodHandler.getInstance());
- frame2handlerMap.put(BasicCancelOkBody.class, BasicCancelOkMethodHandler.getInstance());
- frame2handlerMap.put(ChannelFlowOkBody.class, ChannelFlowOkMethodHandler.getInstance());
- frame2handlerMap.put(QueueDeleteOkBody.class, QueueDeleteOkMethodHandler.getInstance());
- frame2handlerMap.put(ExchangeBoundOkBody.class, ExchangeBoundOkMethodHandler.getInstance());
- _state2HandlersMap.put(AMQState.CONNECTION_OPEN, frame2handlerMap);
- }
-
- 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;
- _stateLock.notifyAll();
- }
- }
-
- public void error(Exception e)
- {
- _logger.debug("State manager receive error notification: " + e);
- synchronized (_stateListeners)
- {
- final Iterator it = _stateListeners.iterator();
- while (it.hasNext())
- {
- final StateListener l = (StateListener) it.next();
- l.error(e);
- }
- }
- }
-
- public <B extends AMQMethodBody> boolean methodReceived(AMQMethodEvent<B> evt) throws AMQException
- {
- StateAwareMethodListener handler = findStateTransitionHandler(_currentState, evt.getMethod());
- if (handler != null)
- {
- handler.methodReceived(this, _protocolSession, evt);
-
- return true;
- }
-
- return false;
- }
-
- protected StateAwareMethodListener findStateTransitionHandler(AMQState currentState, AMQMethodBody frame)
- // throws IllegalStateTransitionException
- {
- final Class clazz = frame.getClass();
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Looking for state[" + currentState + "] transition handler for frame " + clazz);
- }
-
- final Map classToHandlerMap = (Map) _state2HandlersMap.get(currentState);
-
- if (classToHandlerMap == null)
- {
- // if no specialised per state handler is registered look for a
- // handler registered for "all" states
- return findStateTransitionHandler(null, frame);
- }
-
- final StateAwareMethodListener handler = (StateAwareMethodListener) classToHandlerMap.get(clazz);
- if (handler == null)
- {
- if (currentState == null)
- {
- _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(null, frame);
- }
- }
- else
- {
- return handler;
- }
- }
-
- public void attainState(final AMQState s) throws AMQException
- {
- synchronized (_stateLock)
- {
- final long waitUntilTime = System.currentTimeMillis() + MAXIMUM_STATE_WAIT_TIME;
- long waitTime = MAXIMUM_STATE_WAIT_TIME;
-
- while ((_currentState != s) && (waitTime > 0))
- {
- try
- {
- _stateLock.wait(MAXIMUM_STATE_WAIT_TIME);
- }
- catch (InterruptedException e)
- {
- _logger.warn("Thread interrupted");
- }
-
- if (_currentState != s)
- {
- waitTime = waitUntilTime - System.currentTimeMillis();
- }
- }
-
- if (_currentState != s)
- {
- _logger.warn("State not achieved within permitted time. Current state " + _currentState
- + ", desired state: " + s);
- throw new AMQException("State not achieved within permitted time. Current state " + _currentState
- + ", desired state: " + s);
- }
- }
-
- // at this point the state will have changed.
- }
-
- public AMQProtocolSession getProtocolSession()
- {
- return _protocolSession;
- }
-
- public void setProtocolSession(AMQProtocolSession session)
- {
- _protocolSession = session;
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/state/IllegalStateTransitionException.java b/Final/java/client/src/main/java/org/apache/qpid/client/state/IllegalStateTransitionException.java
deleted file mode 100644
index 41fa1ba704..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/state/IllegalStateTransitionException.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.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/Final/java/client/src/main/java/org/apache/qpid/client/state/StateAwareMethodListener.java b/Final/java/client/src/main/java/org/apache/qpid/client/state/StateAwareMethodListener.java
deleted file mode 100644
index b3932533ce..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/state/StateAwareMethodListener.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.state;
-
-import org.apache.qpid.AMQException;
-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
-{
- void methodReceived(AMQStateManager stateManager, AMQProtocolSession protocolSession,
- AMQMethodEvent evt) throws AMQException;
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/state/StateListener.java b/Final/java/client/src/main/java/org/apache/qpid/client/state/StateListener.java
deleted file mode 100644
index df207a0a23..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/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.client.state;
-
-import org.apache.qpid.AMQException;
-
-public interface StateListener
-{
- void stateChanged(AMQState oldState, AMQState newState) throws AMQException;
-
- void error(Throwable t);
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/state/StateWaiter.java b/Final/java/client/src/main/java/org/apache/qpid/client/state/StateWaiter.java
deleted file mode 100644
index 73d5a8a3d6..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/state/StateWaiter.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.client.state;
-
-import org.apache.qpid.AMQException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Waits for a particular state to be reached.
- */
-public class StateWaiter implements StateListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(StateWaiter.class);
-
- private final AMQState _state;
-
- private volatile boolean _newStateAchieved;
-
- private volatile Throwable _throwable;
-
- private final Object _monitor = new Object();
- private static final long TIME_OUT = 1000 * 60 * 2;
-
- public StateWaiter(AMQState state)
- {
- _state = state;
- }
-
- public void waituntilStateHasChanged() throws AMQException
- {
- synchronized (_monitor)
- {
- //
- // The guard is required in case we are woken up by a spurious
- // notify().
- //
- while (!_newStateAchieved && (_throwable == null))
- {
- try
- {
- _logger.debug("State " + _state + " not achieved so waiting...");
- _monitor.wait(TIME_OUT);
- // fixme this won't cause the timeout to exit the loop. need to set _throwable
- }
- catch (InterruptedException e)
- {
- _logger.debug("Interrupted exception caught while waiting: " + e, e);
- }
- }
- }
-
- if (_throwable != null)
- {
- _logger.debug("Throwable reached state waiter: " + _throwable);
- if (_throwable instanceof AMQException)
- {
- throw (AMQException) _throwable;
- }
- else
- {
- throw new AMQException("Error: " + _throwable, _throwable); // FIXME: this will wrap FailoverException in throwable which will prevent it being caught.
- }
- }
- }
-
- public void stateChanged(AMQState oldState, AMQState newState)
- {
- synchronized (_monitor)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("stateChanged called changing from :" + oldState + " to :" + newState);
- }
-
- if (_state == newState)
- {
- _newStateAchieved = true;
-
- if (_logger.isDebugEnabled())
- {
- _logger.debug("New state reached so notifying monitor");
- }
-
- _monitor.notifyAll();
- }
- }
- }
-
- public void error(Throwable t)
- {
- synchronized (_monitor)
- {
- if (_logger.isDebugEnabled())
- {
- _logger.debug("exceptionThrown called");
- }
-
- _throwable = t;
- _monitor.notifyAll();
- }
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/state/listener/SpecificMethodFrameListener.java b/Final/java/client/src/main/java/org/apache/qpid/client/state/listener/SpecificMethodFrameListener.java
deleted file mode 100644
index 4a4f4a0a38..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/state/listener/SpecificMethodFrameListener.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.state.listener;
-
-import org.apache.qpid.AMQException;
-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) //throws AMQException
- {
-
- //equiv to: (frame instanceof _expectedClass)
- return _expectedClass.isInstance(frame);
- }
-
- public boolean equals(Object o)
- {
- if (o instanceof SpecificMethodFrameListener)
- {
- SpecificMethodFrameListener other = (SpecificMethodFrameListener) o;
-
- // here we need to check if the two classes are the same.
- return (_channelId == other._channelId) && (_expectedClass.equals(other._expectedClass));
- }
-
- return false;
- }
-
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.java b/Final/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.java
deleted file mode 100644
index da16baaad9..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/transport/AMQNoTransportForProtocolException.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.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>
- */
-public class AMQNoTransportForProtocolException extends AMQTransportConnectionException
-{
- BrokerDetails _details;
-
- public AMQNoTransportForProtocolException(BrokerDetails details)
- {
- this(details, "No Transport exists for specified broker protocol");
- }
-
- public AMQNoTransportForProtocolException(BrokerDetails details, String message)
- {
- super(null, message, null);
-
- _details = details;
- }
-
- public String toString()
- {
- if (_details != null)
- {
- return super.toString() + _details.toString();
- }
- else
- {
- return super.toString();
- }
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.java b/Final/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.java
deleted file mode 100644
index 24b4e03b39..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/transport/AMQTransportConnectionException.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.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>
- */
-public class AMQTransportConnectionException extends AMQException
-{
- public AMQTransportConnectionException(AMQConstant errorCode, String message, Throwable cause)
- {
- super(errorCode, message, cause);
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/transport/ITransportConnection.java b/Final/java/client/src/main/java/org/apache/qpid/client/transport/ITransportConnection.java
deleted file mode 100644
index 7a24d6e15a..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/client/transport/SocketTransportConnection.java b/Final/java/client/src/main/java/org/apache/qpid/client/transport/SocketTransportConnection.java
deleted file mode 100644
index 5482e48699..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/transport/SocketTransportConnection.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.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.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;
-
-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 = 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/Final/java/client/src/main/java/org/apache/qpid/client/transport/TransportConnection.java b/Final/java/client/src/main/java/org/apache/qpid/client/transport/TransportConnection.java
deleted file mode 100644
index 1d0d6a3491..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/transport/TransportConnection.java
+++ /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.
- *
- */
-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.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.Iterator;
-import java.util.Map;
-
-/**
- * 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 Logger _logger = LoggerFactory.getLogger(TransportConnection.class);
-
- private static final String DEFAULT_QPID_SERVER = "org.apache.qpid.server.protocol.AMQPFastProtocolHandler";
-
- public static ITransportConnection getInstance(BrokerDetails details) throws AMQTransportConnectionException
- {
- int transport = getTransport(details.getTransport());
-
- if (transport == -1)
- {
- throw new AMQNoTransportForProtocolException(details);
- }
-
- if (transport == _currentInstance)
- {
- if (transport == VM)
- {
- if (_currentVMPort == details.getPort())
- {
- return _instance;
- }
- }
- else
- {
- return _instance;
- }
- }
-
- _currentInstance = transport;
-
- switch (transport)
- {
-
- case TCP:
- _instance = 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.error("Using Qpid NIO - sysproperty 'qpidnio' is set.");
- // result = new org.apache.qpid.nio.SocketConnector(); // non-blocking connector
- }
- // 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;
- }
- });
- break;
-
- case VM:
- {
- _instance = getVMTransport(details, Boolean.getBoolean("amqj.AutoCreateVMBroker"));
- break;
- }
- }
-
- return _instance;
- }
-
- private static int getTransport(String transport)
- {
- 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)
- {
- createVMBroker(port);
- }
- 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", null);
- amqbce.initCause(e);
- throw amqbce;
- }
-
- return provider;
- }
-
- public static void killAllVMBrokers()
- {
- _logger.info("Killing all VM Brokers");
- _acceptor.unbindAll();
- synchronized (_inVmPipeAddress)
- {
- Iterator keys = _inVmPipeAddress.keySet().iterator();
-
- while (keys.hasNext())
- {
- int id = (Integer) keys.next();
- _inVmPipeAddress.remove(id);
- }
- }
- }
-
- 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);
- _acceptor.unbind(pipe);
- }
- }
- }
-
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/transport/VmPipeTransportConnection.java b/Final/java/client/src/main/java/org/apache/qpid/client/transport/VmPipeTransportConnection.java
deleted file mode 100644
index d9137dc8b1..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/transport/VmPipeTransportConnection.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.transport;
-
-import org.apache.mina.common.ConnectFuture;
-import org.apache.mina.common.IoServiceConfig;
-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.PoolingFilter;
-import org.apache.qpid.pool.ReferenceCountingExecutorService;
-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 VmPipeConnector();
- 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/Final/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java b/Final/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.java
deleted file mode 100644
index 579b0d9e90..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/util/FlowControllingBlockingQueue.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.client.util;
-
-import java.util.Iterator;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.TimeUnit;
-
-/**
- * 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 BlockingQueue _queue = new LinkedBlockingQueue();
-
- 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 poll(long time, TimeUnit unit) throws InterruptedException
- {
- Object o = _queue.poll(time, unit);
- if (o != null && _listener != null)
- {
- synchronized (_listener)
- {
- if (_count-- == _flowControlLowThreshold)
- {
- _listener.underThreshold(_count);
- }
- }
- }
-
- return o;
- }
-
- public void add(Object o)
- {
- _queue.add(o);
- if (_listener != null)
- {
- synchronized (_listener)
- {
- if (++_count == _flowControlHighThreshold)
- {
- _listener.aboveThreshold(_count);
- }
- }
- }
- }
-
- public Iterator iterator()
- {
- return _queue.iterator();
- }
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.java b/Final/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.java
deleted file mode 100644
index 1791e7ede3..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/client/vmbroker/AMQVMBrokerCreationException.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.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>
- */
-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/Final/java/client/src/main/java/org/apache/qpid/jms/BrokerDetails.java b/Final/java/client/src/main/java/org/apache/qpid/jms/BrokerDetails.java
deleted file mode 100644
index 91f7710025..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/jms/BrokerDetails.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.jms;
-
-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 int DEFAULT_PORT = 5672;
-
- 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;
-
- String getHost();
-
- void setHost(String host);
-
- int getPort();
-
- void setPort(int port);
-
- String getTransport();
-
- void setTransport(String transport);
-
- String getOption(String key);
-
- void setOption(String key, String value);
-
- long getTimeout();
-
- void setTimeout(long timeout);
-
- SSLConfiguration getSSLConfiguration();
-
- void setSSLConfiguration(SSLConfiguration sslConfiguration);
-
- String toString();
-
- boolean equals(Object o);
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/jms/ChannelLimitReachedException.java b/Final/java/client/src/main/java/org/apache/qpid/jms/ChannelLimitReachedException.java
deleted file mode 100644
index 3d4a4573ed..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/jms/Connection.java b/Final/java/client/src/main/java/org/apache/qpid/jms/Connection.java
deleted file mode 100644
index 616c6dbbec..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/jms/ConnectionListener.java b/Final/java/client/src/main/java/org/apache/qpid/jms/ConnectionListener.java
deleted file mode 100644
index 11c235901c..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/jms/ConnectionURL.java b/Final/java/client/src/main/java/org/apache/qpid/jms/ConnectionURL.java
deleted file mode 100644
index 2d91e290c4..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/jms/ConnectionURL.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.jms;
-
-import org.apache.qpid.framing.AMQShortString;
-
-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_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";
-
- String getURL();
-
- String getFailoverMethod();
-
- String getFailoverOption(String key);
-
- int getBrokerCount();
-
- BrokerDetails getBrokerDetails(int index);
-
- void addBrokerDetails(BrokerDetails broker);
-
- 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/Final/java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.java b/Final/java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.java
deleted file mode 100644
index 6ec883ff0b..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/jms/FailoverPolicy.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.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 static final long DEFAULT_FAILOVER_TIMEOUT = 4 * 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
- {
- if ((now - _lastFailTime) >= DEFAULT_FAILOVER_TIMEOUT)
- {
- _logger.info("Failover timeout");
-
- 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/Final/java/client/src/main/java/org/apache/qpid/jms/Message.java b/Final/java/client/src/main/java/org/apache/qpid/jms/Message.java
deleted file mode 100644
index 6752ee616f..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/jms/Message.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.jms;
-
-import javax.jms.JMSException;
-
-public interface Message extends javax.jms.Message
-{
- public void acknowledgeThis() throws JMSException;
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/jms/MessageConsumer.java b/Final/java/client/src/main/java/org/apache/qpid/jms/MessageConsumer.java
deleted file mode 100644
index caac2b5c1f..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/jms/MessageProducer.java b/Final/java/client/src/main/java/org/apache/qpid/jms/MessageProducer.java
deleted file mode 100644
index b91fc2d960..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/jms/MessageProducer.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.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;
-}
diff --git a/Final/java/client/src/main/java/org/apache/qpid/jms/Session.java b/Final/java/client/src/main/java/org/apache/qpid/jms/Session.java
deleted file mode 100644
index 5287381fae..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverMethod.java b/Final/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverMethod.java
deleted file mode 100644
index d7ec46dea3..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java b/Final/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java
deleted file mode 100644
index 4e0d0b79b5..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverRoundRobinServers.java
+++ /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.
- *
- */
-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()
- {
- 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));
- }
-
- _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));
- }
-
- _currentServerRetry++;
- }
- else
- {
- _currentBrokerIndex++;
-
- setBroker(_connectionDetails.getBrokerDetails(_currentBrokerIndex));
- // This is zero rather than -1 as we are already retrieving the details.
- _currentServerRetry = 0;
- }
- }
-
- return _connectionDetails.getBrokerDetails(_currentBrokerIndex);
- }
-
- public void setBroker(BrokerDetails broker)
- {
-
- _connectionDetails.addBrokerDetails(broker);
-
- int index = _connectionDetails.getAllBrokerDetails().indexOf(broker);
-
- String serverRetries = broker.getOption(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/Final/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java b/Final/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.java
deleted file mode 100644
index 68e6d25be0..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/jms/failover/FailoverSingleServer.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.jms.failover;
-
-import org.apache.qpid.jms.BrokerDetails;
-import org.apache.qpid.jms.ConnectionURL;
-
-public class FailoverSingleServer implements FailoverMethod
-{
- /** 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 ++;
- }
-
- return _brokerDetail;
- }
- }
-
- public void setBroker(BrokerDetails broker)
- {
- if (broker == null)
- {
- throw new IllegalArgumentException("BrokerDetails details cannot be null");
- }
- _brokerDetail = broker;
-
- String retries = broker.getOption(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/Final/java/client/src/main/java/org/apache/qpid/jndi/Example.properties b/Final/java/client/src/main/java/org/apache/qpid/jndi/Example.properties
deleted file mode 100644
index c457e94cab..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/jndi/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.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
diff --git a/Final/java/client/src/main/java/org/apache/qpid/jndi/NameParserImpl.java b/Final/java/client/src/main/java/org/apache/qpid/jndi/NameParserImpl.java
deleted file mode 100644
index a3174aec7a..0000000000
--- a/Final/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/Final/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java b/Final/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.java
deleted file mode 100644
index a46c7f3cd5..0000000000
--- a/Final/java/client/src/main/java/org/apache/qpid/jndi/PropertiesFileInitialContextFactory.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.jndi;
-
-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;
-
-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 java.io.BufferedInputStream;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.ConcurrentHashMap;
-
-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);
- _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)
- {
- 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 (URLSyntaxException urlse)
- {
- _logger.warn("Unable to destination:" + 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)
- {
- return new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_NAME, new AMQShortString((String) value));
- }
- 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/Final/java/client/src/main/java/org/apache/qpid/jndi/ReadOnlyContext.java b/Final/java/client/src/main/java/org/apache/qpid/jndi/ReadOnlyContext.java
deleted file mode 100644
index 1719ea1219..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindConnectionFactory.java b/Final/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindConnectionFactory.java
deleted file mode 100644
index 2c08f1e34a..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindQueue.java b/Final/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindQueue.java
deleted file mode 100644
index 10e8b94311..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindTopic.java b/Final/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/JNDIBindTopic.java
deleted file mode 100644
index ca071c1187..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/README.txt b/Final/java/client/src/old_test/java/org/apache/qpid/IBMPerfTest/README.txt
deleted file mode 100644
index 95ee9f9c77..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/cluster/Client.java b/Final/java/client/src/old_test/java/org/apache/qpid/cluster/Client.java
deleted file mode 100644
index cf8059a143..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/codec/BasicDeliverTest.java b/Final/java/client/src/old_test/java/org/apache/qpid/codec/BasicDeliverTest.java
deleted file mode 100644
index 1db7e200bd..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/codec/Client.java b/Final/java/client/src/old_test/java/org/apache/qpid/codec/Client.java
deleted file mode 100644
index 3886021277..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/codec/Server.java b/Final/java/client/src/old_test/java/org/apache/qpid/codec/Server.java
deleted file mode 100644
index fa4295e0b2..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java b/Final/java/client/src/old_test/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java
deleted file mode 100644
index cac0064785..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/config/AbstractConfig.java b/Final/java/client/src/old_test/java/org/apache/qpid/config/AbstractConfig.java
deleted file mode 100644
index 04381d66a0..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java b/Final/java/client/src/old_test/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java
deleted file mode 100644
index a9984eb09a..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/config/Connector.java b/Final/java/client/src/old_test/java/org/apache/qpid/config/Connector.java
deleted file mode 100644
index ff2377f087..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/config/ConnectorConfig.java b/Final/java/client/src/old_test/java/org/apache/qpid/config/ConnectorConfig.java
deleted file mode 100644
index b120ed3f12..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java b/Final/java/client/src/old_test/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java
deleted file mode 100644
index 44285efd96..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/flow/ChannelFlowTest.java b/Final/java/client/src/old_test/java/org/apache/qpid/flow/ChannelFlowTest.java
deleted file mode 100644
index cb8adae18c..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargePublisher.java b/Final/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargePublisher.java
deleted file mode 100644
index a246352d8b..0000000000
--- a/Final/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(); //To change body of catch statement use File | Settings | File Templates.
- }
- catch (AMQException e)
- {
- System.err.println("Error in client: " + e);
- e.printStackTrace();
- }
-
- //System.exit(0);
- }
-}
diff --git a/Final/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargeSubscriber.java b/Final/java/client/src/old_test/java/org/apache/qpid/fragmentation/TestLargeSubscriber.java
deleted file mode 100644
index b0cde22349..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/headers/Listener.java b/Final/java/client/src/old_test/java/org/apache/qpid/headers/Listener.java
deleted file mode 100644
index cb5caefc1e..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/headers/MessageFactory.java b/Final/java/client/src/old_test/java/org/apache/qpid/headers/MessageFactory.java
deleted file mode 100644
index a2d575fdd4..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/headers/Publisher.java b/Final/java/client/src/old_test/java/org/apache/qpid/headers/Publisher.java
deleted file mode 100644
index d9ef702c48..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Bind.java b/Final/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Bind.java
deleted file mode 100644
index ee6a12c233..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Lookup.java b/Final/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Lookup.java
deleted file mode 100644
index 1c9d8b0fd5..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Unbind.java b/Final/java/client/src/old_test/java/org/apache/qpid/jndi/referenceable/Unbind.java
deleted file mode 100644
index 1acead674c..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/latency/LatencyTest.java b/Final/java/client/src/old_test/java/org/apache/qpid/latency/LatencyTest.java
deleted file mode 100644
index 4865a68dc4..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/mina/AcceptorTest.java b/Final/java/client/src/old_test/java/org/apache/qpid/mina/AcceptorTest.java
deleted file mode 100644
index f0ac0e6902..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/mina/BlockingAcceptorTest.java b/Final/java/client/src/old_test/java/org/apache/qpid/mina/BlockingAcceptorTest.java
deleted file mode 100644
index bfe29c47e6..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/mina/WriterTest.java b/Final/java/client/src/old_test/java/org/apache/qpid/mina/WriterTest.java
deleted file mode 100644
index 910345624f..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/multiconsumer/AMQTest.java b/Final/java/client/src/old_test/java/org/apache/qpid/multiconsumer/AMQTest.java
deleted file mode 100644
index db02b9954a..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestPublisher.java b/Final/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestPublisher.java
deleted file mode 100644
index 33891142b5..0000000000
--- a/Final/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(); //To change body of catch statement use File | Settings | File Templates.
- }
- }
-
- 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(); //To change body of catch statement use File | Settings | File Templates.
- }
- catch (AMQException e)
- {
- System.err.println("Error in client: " + e);
- e.printStackTrace();
- }
-
- //System.exit(0);
- }
-}
diff --git a/Final/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestSubscriber.java b/Final/java/client/src/old_test/java/org/apache/qpid/pubsub1/TestSubscriber.java
deleted file mode 100644
index 450d9b3914..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/test/unit/client/connection/TestManyConnections.java b/Final/java/client/src/old_test/java/org/apache/qpid/test/unit/client/connection/TestManyConnections.java
deleted file mode 100644
index f59b36166a..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/PropertiesFileInitialContextFactoryTest.java b/Final/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/PropertiesFileInitialContextFactoryTest.java
deleted file mode 100644
index 5ab5722146..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/example.properties b/Final/java/client/src/old_test/java/org/apache/qpid/test/unit/jndi/example.properties
deleted file mode 100644
index ea9dc5ae0e..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/topic/Config.java b/Final/java/client/src/old_test/java/org/apache/qpid/topic/Config.java
deleted file mode 100644
index bb740f9094..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/topic/Listener.java b/Final/java/client/src/old_test/java/org/apache/qpid/topic/Listener.java
deleted file mode 100644
index 47c608cfe4..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/topic/MessageFactory.java b/Final/java/client/src/old_test/java/org/apache/qpid/topic/MessageFactory.java
deleted file mode 100644
index 39d64069d1..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/topic/Publisher.java b/Final/java/client/src/old_test/java/org/apache/qpid/topic/Publisher.java
deleted file mode 100644
index d788029ee9..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/transacted/Config.java b/Final/java/client/src/old_test/java/org/apache/qpid/transacted/Config.java
deleted file mode 100644
index bd104e5407..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/transacted/Ping.java b/Final/java/client/src/old_test/java/org/apache/qpid/transacted/Ping.java
deleted file mode 100644
index 8f15bf089e..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/transacted/Pong.java b/Final/java/client/src/old_test/java/org/apache/qpid/transacted/Pong.java
deleted file mode 100644
index f4f4b20d7c..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/transacted/Relay.java b/Final/java/client/src/old_test/java/org/apache/qpid/transacted/Relay.java
deleted file mode 100644
index cede95e5f0..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/transacted/Start.java b/Final/java/client/src/old_test/java/org/apache/qpid/transacted/Start.java
deleted file mode 100644
index de718d828a..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceProvider.java b/Final/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceProvider.java
deleted file mode 100644
index 71d806b338..0000000000
--- a/Final/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/Final/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceRequestingClient.java b/Final/java/client/src/old_test/java/org/apache/qpid/weblogic/ServiceRequestingClient.java
deleted file mode 100644
index 2f64a1dde5..0000000000
--- a/Final/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/Final/java/client/src/test/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java b/Final/java/client/src/test/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java
deleted file mode 100644
index 5323ad28bf..0000000000
--- a/Final/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/Final/java/client/src/test/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java b/Final/java/client/src/test/java/org/apache/qpid/client/AMQQueueDeferredOrderingTest.java
deleted file mode 100644
index fe418535d6..0000000000
--- a/Final/java/client/src/test/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/Final/java/client/src/test/java/org/apache/qpid/client/DispatcherTest.java b/Final/java/client/src/test/java/org/apache/qpid/client/DispatcherTest.java
deleted file mode 100644
index 7cca22de6c..0000000000
--- a/Final/java/client/src/test/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/Final/java/client/src/test/java/org/apache/qpid/client/MessageListenerMultiConsumerImmediatePrefetch.java b/Final/java/client/src/test/java/org/apache/qpid/client/MessageListenerMultiConsumerImmediatePrefetch.java
deleted file mode 100644
index 7461f6c200..0000000000
--- a/Final/java/client/src/test/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/Final/java/client/src/test/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.java b/Final/java/client/src/test/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.java
deleted file mode 100644
index 20632e245f..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/client/MessageListenerMultiConsumerTest.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.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 _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 TestCase
-{
- 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();
- 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", "direct://amq.direct//" + this.getClass().getName());
-
- _context = factory.getInitialContext(env);
-
- _queue = (Queue) _context.lookup("queue");
-
- // Create Client 1
- _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
-
- _clientConnection.start();
-
- _clientSession1 = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _consumer1 = _clientSession1.createConsumer(_queue);
-
- // Create Client 2
- Session clientSession2 = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _consumer2 = clientSession2.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);
-
- 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();
- TransportConnection.killAllVMBrokers();
- }
-
- 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);
-
- for (int msg = 0; msg < (MSG_COUNT / 2); msg++)
- {
-
- assertTrue(_consumer1.receive() != null);
- }
-
- for (int msg = 0; msg < (MSG_COUNT / 2); msg++)
- {
- assertTrue(consumer2.receive() != null);
- }
- }
- else
- {
- _logger.info("Performing Receive only on both C1 and C2");
-
- for (int msg = 0; msg < (MSG_COUNT / 2); msg++)
- {
-
- assertTrue(_consumer1.receive() != null);
- }
-
- for (int msg = 0; msg < (MSG_COUNT / 2); msg++)
- {
- assertTrue(_consumer2.receive() != null);
- }
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(MessageListenerMultiConsumerTest.class);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/client/MessageListenerTest.java b/Final/java/client/src/test/java/org/apache/qpid/client/MessageListenerTest.java
deleted file mode 100644
index 87630fad5b..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/client/MessageListenerTest.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;
-
-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.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 MessageListenerTest extends TestCase 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);
- private static final String BROKER = "vm://:1";
- private static final String VHOST = "test";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- if (BROKER.contains("vm://"))
- {
- TransportConnection.createVMBroker(1);
- }
-
- InitialContextFactory factory = new PropertiesFileInitialContextFactory();
-
- Hashtable<String, String> env = new Hashtable<String, String>();
-
- env.put("connectionfactory.connection", "amqp://guest:guest@MLT_ID/" + VHOST + "?brokerlist='" + BROKER + "'");
- env.put("queue.queue", "MessageListenerTest");
-
- _context = factory.getInitialContext(env);
-
- Queue queue = (Queue) _context.lookup("queue");
-
- // Create Client
- _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
-
- _clientConnection.start();
-
- Session clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _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);
-
- 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();
- if (BROKER.contains("vm://"))
- {
- TransportConnection.killAllVMBrokers();
- }
- }
-
- 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 testRecieveTheUseMessageListener() 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);
-
- }
-
- 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/Final/java/client/src/test/java/org/apache/qpid/client/ResetMessageListenerTest.java b/Final/java/client/src/test/java/org/apache/qpid/client/ResetMessageListenerTest.java
deleted file mode 100644
index 21f3e273aa..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/client/ResetMessageListenerTest.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.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 _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 TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(ResetMessageListenerTest.class);
-
- Context _context;
-
- private static final int MSG_COUNT = 6;
- private int receivedCount1ML1 = 0;
- private int receivedCount1ML2 = 0;
- private int receivedCount2 = 0;
- private Connection _clientConnection, _producerConnection;
- private MessageConsumer _consumer1;
- private MessageConsumer _consumer2;
- MessageProducer _producer;
- Session _clientSession, _producerSession;
-
- private final CountDownLatch _allFirstMessagesSent = new CountDownLatch(2); // all messages Sent Lock
- private final CountDownLatch _allSecondMessagesSent = new CountDownLatch(2); // all messages Sent Lock
-
- private String oldImmediatePrefetch;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
-
- oldImmediatePrefetch = System.getProperty(AMQSession.IMMEDIATE_PREFETCH);
- System.setProperty(AMQSession.IMMEDIATE_PREFETCH, "true");
-
- 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", "direct://amq.direct//ResetMessageListenerTest");
-
- _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);
-
- _consumer1 = _clientSession.createConsumer(queue);
-
- // Create Client 2 on same session
- _consumer2 = _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();
- if (oldImmediatePrefetch == null)
- {
- oldImmediatePrefetch = AMQSession.IMMEDIATE_PREFETCH_DEFAULT;
- }
- System.setProperty(AMQSession.IMMEDIATE_PREFETCH, oldImmediatePrefetch);
- TransportConnection.killAllVMBrokers();
- }
-
- public void testAsynchronousRecieve()
- {
-
- _logger.info("Test Start");
-
- // Set default Message Listener
- try
- {
- _consumer1.setMessageListener(new MessageListener()
- {
- public void onMessage(Message message)
- {
- _logger.info("Client 1 ML 1 Received Message(" + receivedCount1ML1 + "):" + message);
-
- receivedCount1ML1++;
- if (receivedCount1ML1 == (MSG_COUNT / 2))
- {
- _allFirstMessagesSent.countDown();
- }
- }
- });
- }
- catch (JMSException e)
- {
- _logger.error("Error Setting Default ML on consumer1");
- }
-
- try
- {
- _consumer2.setMessageListener(new MessageListener()
- {
- public void onMessage(Message message)
- {
- _logger.info("Client 2 Received Message(" + receivedCount2 + "):" + message);
-
- receivedCount2++;
- if (receivedCount2 == (MSG_COUNT / 2))
- {
- _logger.info("Client 2 received all its messages1");
- _allFirstMessagesSent.countDown();
- }
-
- if (receivedCount2 == MSG_COUNT)
- {
- _logger.info("Client 2 received all its messages2");
- _allSecondMessagesSent.countDown();
- }
- }
- });
-
- _clientConnection.start();
- }
- catch (JMSException e)
- {
- _logger.error("Error Setting Default ML on consumer2");
-
- }
-
- try
- {
- _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 to better listener while connection stopped, will restart session");
- try
- {
- _consumer1.setMessageListener(new MessageListener()
- {
- public void onMessage(Message message)
- {
- _logger.info("Client 1 ML2 Received Message(" + receivedCount1ML1 + "):" + message);
-
- receivedCount1ML2++;
- if (receivedCount1ML2 == (MSG_COUNT / 2))
- {
- _allSecondMessagesSent.countDown();
- }
- }
- });
-
- _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");
-
- 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);
- }
-
- _logger.info("Waiting upto 2 seconds for messages");
-
- try
- {
- _allSecondMessagesSent.await(5000, 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());
- assertEquals("Client 1 ML1 didn't get all messages", MSG_COUNT / 2, receivedCount1ML1);
- assertEquals("Client 2 didn't get all messages", MSG_COUNT, receivedCount2);
- assertEquals("Client 1 ML2 didn't get all messages", MSG_COUNT / 2, receivedCount1ML2);
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(ResetMessageListenerTest.class);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/client/SpecificMethodFrameListenerTest.java b/Final/java/client/src/test/java/org/apache/qpid/client/SpecificMethodFrameListenerTest.java
deleted file mode 100644
index 4cffcecf8a..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/client/SpecificMethodFrameListenerTest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.apache.qpid.framing;
-
-import junit.framework.TestCase;
-import org.apache.qpid.client.state.listener.SpecificMethodFrameListener;
-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 class SpecificMethodFrameListenerTest extends TestCase
-{
-
- SpecificMethodFrameListener close1a = new SpecificMethodFrameListener(1, ChannelCloseOkBody.class);
- SpecificMethodFrameListener close1b = new SpecificMethodFrameListener(1, ChannelCloseOkBody.class);
- SpecificMethodFrameListener close2 = new SpecificMethodFrameListener(2, ChannelCloseOkBody.class);
- SpecificMethodFrameListener open1a = new SpecificMethodFrameListener(1, ChannelOpenOkBody.class);
- SpecificMethodFrameListener open1b = new SpecificMethodFrameListener(1, ChannelOpenOkBody.class);
-
- public void testEquals()
- {
- //Check that the the same objects are equal
- assertEquals("ChannelCloseOKBody a should equal a", close1a, close1a);
- assertEquals("ChannelOpenOkBody a should equal a", open1a, open1a);
-
- //check that the same values in differnt objects are equal
- assertEquals("ChannelCloseOKBody b should equal a", close1b, close1a);
- assertEquals("ChannelCloseOKBody a should equal b", close1a, close1b);
- assertEquals("ChannelOpenOkBody a should equal b", open1a, open1b);
- assertEquals("ChannelOpenOkBody a should equal b", open1a, open1b);
-
- //Chec that different values fail
- //Different channels
- assertFalse("ChannelCloseOKBody channel 1 should NOT equal channel 2", close1a.equals(close2));
- assertFalse("ChannelCloseOKBody channel 1 should NOT equal channel 2", close2.equals(close1a));
-
- //Different Bodies
- assertFalse("ChannelCloseOKBody should not equal ChannelOpenOkBody", close1a.equals(open1a));
- assertFalse("ChannelOpenOkBody should not equal ChannelCloseOKBody", open1a.equals(close1a));
- }
-
- public void testProcessMethod() throws AMQFrameDecodingException
- {
- ChannelCloseOkBody ccob = (ChannelCloseOkBody) ChannelCloseOkBody.getFactory().newInstance((byte) 8, (byte) 0, ByteBuffer.allocate(0), 0);
- ChannelOpenOkBody coob = (ChannelOpenOkBody) ChannelOpenOkBody.getFactory().newInstance((byte) 8, (byte) 0, ByteBuffer.allocate(0), 0);
-
- assertTrue("This SpecificMethodFrameListener should process a ChannelCloseOkBody", close1a.processMethod(1, ccob));
- assertFalse("This SpecificMethodFrameListener should NOT process a ChannelOpenOkBody", close1a.processMethod(1, coob));
-
-
-
-
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/client/message/NonQpidObjectMessage.java b/Final/java/client/src/test/java/org/apache/qpid/client/message/NonQpidObjectMessage.java
deleted file mode 100644
index 60a26c8e62..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/client/message/NonQpidObjectMessage.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.client.message;
-
-import java.io.Serializable;
-import java.util.Enumeration;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-
-public class NonQpidObjectMessage implements ObjectMessage {
-
- private JMSObjectMessage _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
- */
- public NonQpidObjectMessage()
- {
- _realMessage = new JMSObjectMessage();
- }
-
- 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/Final/java/client/src/test/java/org/apache/qpid/client/message/TestMessageHelper.java b/Final/java/client/src/test/java/org/apache/qpid/client/message/TestMessageHelper.java
deleted file mode 100644
index 9b477c19e2..0000000000
--- a/Final/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();
- }
-
- public static JMSBytesMessage newJMSBytesMessage() throws JMSException
- {
- return new JMSBytesMessage();
- }
-
- public static JMSMapMessage newJMSMapMessage() throws JMSException
- {
- return new JMSMapMessage();
- }
-
- public static JMSStreamMessage newJMSStreamMessage()
- {
- return new JMSStreamMessage();
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/ack/RecoverTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/ack/RecoverTest.java
deleted file mode 100644
index b6f46b4acc..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/ack/RecoverTest.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.ack;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.framing.AMQShortString;
-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.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 TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(RecoverTest.class);
-
- private Exception _error;
- private AtomicInteger count;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- _error = null;
- count = new AtomicInteger();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- count = null;
- }
-
- public void testRecoverResendsMsgs() throws Exception
- {
- AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
-
- 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 = 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. 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 = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
-
- 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 = 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();
- 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 = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
-
- 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 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "test");
- 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();
- 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 = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
-
- 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 = 300000L;
- 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/BytesMessageTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/BytesMessageTest.java
deleted file mode 100644
index da1b46ee2c..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/BytesMessageTest.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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 junit.framework.TestCase;
-
-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.testutil.VMBrokerSetup;
-
-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 TestCase 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(new AMQConnection(_connectionString, "guest", "guest", randomize("Client"), "test"));
- }
-
- 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();
- }
-
- public static junit.framework.Test suite()
- {
- return new VMBrokerSetup(new junit.framework.TestSuite(BytesMessageTest.class));
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableKeyEnumeratorTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableKeyEnumeratorTest.java
deleted file mode 100644
index ddbc69826d..0000000000
--- a/Final/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/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableMessageTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableMessageTest.java
deleted file mode 100644
index aff496becf..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTableMessageTest.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.test.unit.basic;
-
-import junit.framework.TestCase;
-
-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.testutil.VMBrokerSetup;
-
-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;
-
-public class FieldTableMessageTest extends TestCase 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";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- init(new AMQConnection(_connectionString, "guest", "guest", randomize("Client"), "test"));
- }
-
- 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;
- send(count);
- waitFor(count);
- 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 waitFor(int count) throws InterruptedException
- {
- synchronized (received)
- {
- while (received.size() < count)
- {
- received.wait();
- }
- }
- }
-
- 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);
- received.notify();
- }
- }
-
- 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();
- }
-
- public static junit.framework.Test suite()
- {
- return new VMBrokerSetup(new junit.framework.TestSuite(FieldTableMessageTest.class));
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTablePropertyTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/FieldTablePropertyTest.java
deleted file mode 100644
index 60ed688897..0000000000
--- a/Final/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/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.java
deleted file mode 100644
index 83846e0081..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/InvalidDestinationTest.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.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.AMQQueue;
-import org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException;
-import org.apache.qpid.client.transport.TransportConnection;
-
-import junit.framework.TestCase;
-
-import javax.jms.MessageConsumer;
-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 TestCase
-{
- private AMQConnection _connection;
- private AMQDestination _destination;
- private AMQSession _session;
- private MessageConsumer _consumer;
-
- private static final String VM_BROKER = "vm://:1";
-
-
- protected void setUp() throws Exception
- {
- super.setUp();
- createVMBroker();
- _connection = new AMQConnection(VM_BROKER, "guest", "guest", "ReceiveTestClient", "test");
- }
-
- public void createVMBroker()
- {
- try
- {
- TransportConnection.createVMBroker(1);
- }
- catch (AMQVMBrokerCreationException e)
- {
- fail("Unable to create broker: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- _connection.close();
- TransportConnection.killVMBroker(1);
- 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 :-(
- MessageConsumer consumer = 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java
deleted file mode 100644
index 03698b2ab2..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.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.
- *
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import junit.framework.TestCase;
-
-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.client.transport.TransportConnection;
-
-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;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class LargeMessageTest extends TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(LargeMessageTest.class);
-
- private AMQConnection _connection;
- private Destination _destination;
- private AMQSession _session;
- private final List<JMSTextMessage> received = new ArrayList<JMSTextMessage>();
- public String _broker = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- try
- {
- init(new AMQConnection(_broker, "guest", "guest", "LargeMessageTest", "test"));
- }
- catch (Exception e)
- {
- fail("Unable to initialilse connection: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- _session.close();
- _connection.close();
- TransportConnection.killAllVMBrokers();
- }
-
- 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
- {
- _connection = connection;
- _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/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java
deleted file mode 100644
index 6708fefa86..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java
+++ /dev/null
@@ -1,1277 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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 junit.framework.TestCase;
-
-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.client.transport.TransportConnection;
-
-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 TestCase 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
- {
- TransportConnection.createVMBroker(1);
- init(new AMQConnection(_connectionString, "guest", "guest", randomize("Client"), "test"));
- }
- catch (Exception e)
- {
- fail("Unable to initialilse connection: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- _logger.info("Tearing Down unit.basic.MapMessageTest");
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- 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) Byte.MAX_VALUE);
- message.setBytes("bytes", _bytes);
- message.setChar("char", (char) 'c');
- message.setDouble("double", (double) Double.MAX_VALUE);
- message.setFloat("float", (float) Float.MAX_VALUE);
- message.setFloat("smallfloat", 100);
- message.setInt("messageNumber", i);
- message.setInt("int", (int) Integer.MAX_VALUE);
- message.setLong("long", (long) Long.MAX_VALUE);
- message.setShort("short", (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
- {
- List<String> actual = new ArrayList<String>();
- int count = 0;
- for (JMSMapMessage m : received)
- {
- actual.add(m.getString("message"));
-
- 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:" + (JMSMapMessage) 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java
deleted file mode 100644
index 65b3d60ad9..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.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.test.unit.basic;
-
-import junit.framework.TestCase;
-
-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.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 TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(MultipleConnectionTest.class);
-
- public static final String _defaultBroker = "vm://:1";
- public String _connectionString = _defaultBroker;
-
- private static class Receiver
- {
- private AMQConnection _connection;
- private Session[] _sessions;
- private MessageCounter[] _counters;
-
- Receiver(String broker, AMQDestination dest, int sessions) throws Exception
- {
- this(new AMQConnection(broker, "guest", "guest", randomize("Client"), "test"), 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 static class Publisher
- {
- private AMQConnection _connection;
- private Session _session;
- private MessageProducer _producer;
-
- Publisher(String broker, AMQDestination dest) throws Exception
- {
- this(new AMQConnection(broker, "guest", "guest", randomize("Client"), "test"), 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/ObjectMessageTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/ObjectMessageTest.java
deleted file mode 100644
index 9237555734..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/ObjectMessageTest.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.test.unit.basic;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-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.client.transport.TransportConnection;
-
-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 TestCase 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();
- TransportConnection.createVMBroker(1);
- try
- {
- init(new AMQConnection(_connectionString, "guest", "guest", randomize("Client"), "test"));
- }
- catch (Exception e)
- {
- fail("Uable to initialise: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- 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)
- {
- while (received.size() < count)
- {
- received.wait();
- }
- }
- }
-
- 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.java
deleted file mode 100644
index dce9667ff2..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/PropertyValueTest.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.test.unit.basic;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.message.AMQMessage;
-import org.apache.qpid.client.message.JMSTextMessage;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.framing.AMQShortString;
-
-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.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;
-
-public class PropertyValueTest extends TestCase 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";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killVMBroker(1);
- }
-
- 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();
- }
-
- 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(new AMQConnection(_connectionString, "guest", "guest", randomize("Client"), "test"));
- }
- catch (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.trace("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");
-
- // AMQP Specific values
-
- // Timestamp
- long nano = System.nanoTime();
- m.setStringProperty("time-str", String.valueOf(nano));
- ((AMQMessage) m).setTimestampProperty(new AMQShortString("time"), nano);
-
- // Decimal
- BigDecimal bd = new BigDecimal(Integer.MAX_VALUE);
- ((AMQMessage) m).setDecimalProperty(new AMQShortString("decimal"), bd.setScale(Byte.MAX_VALUE));
-
- bd = new BigDecimal((long) Integer.MAX_VALUE + 1L);
-
- try
- {
- ((AMQMessage) m).setDecimalProperty(new AMQShortString("decimal-bad-value"), bd.setScale(Byte.MAX_VALUE));
- fail("UnsupportedOperationException should be thrown as value can't be correctly transmitted");
- }
- catch (UnsupportedOperationException uoe)
- {
- // normal path.
- }
-
- try
- {
- ((AMQMessage) m).setDecimalProperty(new AMQShortString("decimal-bad-scale"),
- bd.setScale(Byte.MAX_VALUE + 1));
- fail("UnsupportedOperationException should be thrown as scale can't be correctly transmitted");
- }
- catch (UnsupportedOperationException uoe)
- {
- // normal path.
- }
-
- // Void
- ((AMQMessage) m).setVoidProperty(new AMQShortString("void"));
-
- _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
- {
- 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", m.getStringProperty("TempQueue"),
- m.getJMSReplyTo().toString());
-
- 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"));
- }
-
- 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/PubSubTwoConnectionTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/PubSubTwoConnectionTest.java
deleted file mode 100644
index a3d0cf6dcd..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/PubSubTwoConnectionTest.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.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 junit.framework.TestCase;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.transport.TransportConnection;
-
-/**
- * @author Apache Software Foundation
- */
-public class PubSubTwoConnectionTest extends TestCase
-{
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- /**
- * This tests that a consumer is set up synchronously
- * @throws Exception
- */
- public void testTwoConnections() throws Exception
- {
-
- AMQConnection con1 = new AMQConnection("vm://:1", "guest", "guest", "Client1", "test");
-
- Topic topic = new AMQTopic(con1, "MyTopic");
-
- Session session1 = con1.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- MessageProducer producer = session1.createProducer(topic);
-
- Connection con2 = new AMQConnection("vm://:1", "guest", "guest", "Client2", "test");
- 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());
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/ReceiveTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/ReceiveTest.java
deleted file mode 100644
index 668233f356..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/ReceiveTest.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 javax.jms.MessageConsumer;
-
-import junit.framework.TestCase;
-
-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.transport.TransportConnection;
-import org.apache.qpid.client.vmbroker.AMQVMBrokerCreationException;
-
-public class ReceiveTest extends TestCase
-{
- private AMQConnection _connection;
- private AMQDestination _destination;
- private AMQSession _session;
- private MessageConsumer _consumer;
-
- private static final String VM_BROKER = "vm://:1";
- public String _connectionString = VM_BROKER;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- if (_connectionString.equals(VM_BROKER))
- {
- createVMBroker();
- String broker = _connectionString;
- init(new AMQConnection(broker, "guest", "guest", "ReceiveTestClient", "test"));
- }
- }
-
- public void createVMBroker()
- {
- try
- {
- TransportConnection.createVMBroker(1);
- }
- catch (AMQVMBrokerCreationException e)
- {
- fail("Unable to create broker: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- if (_connectionString.equals(VM_BROKER))
- {
- TransportConnection.killVMBroker(1);
- }
- 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
- {
- _consumer.receive(5000);
- _connection.close();
- }
-
- public static void main(String[] argv) throws Exception
- {
- ReceiveTest test = new ReceiveTest();
- test._connectionString = argv.length == 0 ? VM_BROKER : argv[0];
- test.setUp();
- test.test();
- test.tearDown();
- }
-
- 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/SelectorTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/SelectorTest.java
deleted file mode 100644
index 40c712c1c9..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/SelectorTest.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.basic;
-
-import junit.framework.TestCase;
-
-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.transport.TransportConnection;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-
-public class SelectorTest extends TestCase 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";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- init(new AMQConnection(_connectionString, "guest", "guest", randomize("Client"), "test"));
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- private void init(AMQConnection connection) throws Exception
- {
- init(connection, new AMQQueue(connection, randomize("SessionStartTest"), true));
- }
-
- private void init(AMQConnection connection, AMQDestination destination) throws Exception
- {
- _connection = connection;
- _destination = destination;
- connection.start();
-
- String selector = null;
- // selector = "Cost = 2 AND JMSDeliveryMode=" + DeliveryMode.NON_PERSISTENT;
- // 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 synchronized void test() throws JMSException, InterruptedException
- {
- try
- {
- Message msg = _session.createTextMessage("Message");
- msg.setJMSPriority(1);
- msg.setIntProperty("Cost", 2);
- msg.setJMSType("Special");
-
- _logger.info("Sending Message:" + msg);
-
- ((BasicMessageProducer) _session.createProducer(_destination)).send(msg, DeliveryMode.NON_PERSISTENT);
- _logger.info("Message sent, waiting for response...");
- wait(1000);
-
- if (count > 0)
- {
- _logger.info("Got message");
- }
-
- if (count == 0)
- {
- fail("Did not get message!");
- // throw new RuntimeException("Did not get message!");
- }
- }
- finally
- {
- _session.close();
- _connection.close();
- }
- }
-
- public synchronized void onMessage(Message message)
- {
- count++;
- _logger.info("Got Message:" + message);
- notify();
- }
-
- 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:5672" : argv[0];
- test.setUp();
- test.test();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(SelectorTest.class);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/SessionStartTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/SessionStartTest.java
deleted file mode 100644
index cc18169a5b..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/SessionStartTest.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.basic;
-
-import junit.framework.TestCase;
-
-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.testutil.VMBrokerSetup;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-
-public class SessionStartTest extends TestCase 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(new AMQConnection(_connectionString, "guest", "guest", randomize("Client"), "test"));
- }
-
- 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();
- }
-
- public static junit.framework.Test suite()
- {
- return new VMBrokerSetup(new junit.framework.TestSuite(SessionStartTest.class));
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/TextMessageTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/TextMessageTest.java
deleted file mode 100644
index 000fb9ab88..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/TextMessageTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.unit.basic;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-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.testutil.VMBrokerSetup;
-
-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;
-
-public class TextMessageTest extends TestCase 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";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- try
- {
- init(new AMQConnection(_connectionString, "guest", "guest", randomize("Client"), "test"));
- }
- 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
- _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++)
- {
- String text = "Message " + i;
- messages.add(text);
- Message m = _session.createTextMessage(text);
- m.setStringProperty("String", "hello");
-
- _logger.info("Sending Msg:" + m);
- producer.send(m);
- }
- }
-
- void waitFor(int count) throws InterruptedException
- {
- synchronized (received)
- {
- while (received.size() < count)
- {
- received.wait();
- }
- }
- }
-
- 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)
- {
- received.add((JMSTextMessage) message);
- received.notify();
- }
- }
-
- private static String randomize(String in)
- {
- return in + System.currentTimeMillis();
- }
-
- public static void main(String[] argv) throws Exception
- {
- TextMessageTest test = new TextMessageTest();
- 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 VMBrokerSetup(new junit.framework.TestSuite(TextMessageTest.class));
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/close/CloseTests.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/close/CloseTests.java
deleted file mode 100644
index 690ba7f01b..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/basic/close/CloseTests.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.test.unit.basic.close;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.url.AMQBindingURL;
-import org.apache.qpid.url.URLSyntaxException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-
-public class CloseTests extends TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(CloseTests.class);
-
- private static final String BROKER = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
-
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- super.setUp();
-
- TransportConnection.killVMBroker(1);
- }
-
- public void testCloseQueueReceiver() throws AMQException, URLSyntaxException, JMSException
- {
- AMQConnection connection = new AMQConnection(BROKER, "guest", "guest", this.getName(), "test");
-
- 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");
-
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/AMQConnectionTest.java
deleted file mode 100644
index 0e15341615..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/AMQConnectionTest.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.test.unit.client;
-
-import javax.jms.JMSException;
-import javax.jms.QueueSession;
-import javax.jms.TopicSession;
-
-import junit.framework.TestCase;
-
-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.transport.TransportConnection;
-import org.apache.qpid.framing.AMQShortString;
-
-public class AMQConnectionTest extends TestCase
-{
- 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();
- TransportConnection.createVMBroker(1);
- _connection = new AMQConnection("vm://:1", "guest", "guest", "fred", "test");
- _topic = new AMQTopic(_connection.getDefaultTopicExchangeName(), new AMQShortString("mytopic"));
- _queue = new AMQQueue(_connection.getDefaultQueueExchangeName(), new AMQShortString("myqueue"));
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- try
- {
- _connection.close();
- }
- catch (JMSException e)
- {
- //ignore
- }
- TransportConnection.killAllVMBrokers();
- }
-
- /**
- * 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 static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(AMQConnectionTest.class);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/AMQSessionTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/AMQSessionTest.java
deleted file mode 100644
index 78b7976f55..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/AMQSessionTest.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.client;
-
-import javax.jms.JMSException;
-import javax.jms.QueueReceiver;
-import javax.jms.TopicSubscriber;
-
-import junit.framework.TestCase;
-
-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.testutil.VMBrokerSetup;
-
-/**
- * Tests for QueueReceiver and TopicSubscriber creation methods on AMQSession
- */
-public class AMQSessionTest extends TestCase
-{
-
- private static AMQSession _session;
- private static AMQTopic _topic;
- private static AMQQueue _queue;
- private static AMQConnection _connection;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- _connection = new AMQConnection("vm://:1", "guest", "guest", "fred", "test");
- _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, "mysubname", "abc", false);
- assertEquals("Topic names should match from durable TopicSubscriber with selector", _topic.getTopicName(), subscriber.getTopic().getTopicName());
- }
-
- 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;
- }
-
- public static junit.framework.Test suite()
- {
- return new VMBrokerSetup(new junit.framework.TestSuite(AMQSessionTest.class));
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java
deleted file mode 100644
index e513f25e3d..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.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.BrokerDetails;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.AMQBrokerDetails;
-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.getOption("timeout").equals("200"));
- assertTrue(broker.getOption("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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.java
deleted file mode 100644
index 575d542633..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseMethodHandlerNoCloseOk.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.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.AMQStateManager;
-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.apache.qpid.protocol.AMQMethodEvent;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ChannelCloseMethodHandlerNoCloseOk implements StateAwareMethodListener
-{
- private static final Logger _logger = LoggerFactory.getLogger(ChannelCloseMethodHandlerNoCloseOk.class);
-
- private static ChannelCloseMethodHandlerNoCloseOk _handler = new ChannelCloseMethodHandlerNoCloseOk();
-
- public static ChannelCloseMethodHandlerNoCloseOk getInstance()
- {
- return _handler;
- }
-
- public void methodReceived(AMQStateManager stateManager, AMQProtocolSession protocolSession, AMQMethodEvent evt)
- throws AMQException
- {
- _logger.debug("ChannelClose method received");
- ChannelCloseBody method = (ChannelCloseBody) evt.getMethod();
-
- AMQConstant errorCode = AMQConstant.getConstant(method.replyCode);
- AMQShortString reason = method.replyText;
- 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);
- }
- else if (errorCode == AMQConstant.NO_ROUTE)
- {
- throw new AMQNoRouteException("Error: " + reason, null);
- }
- else if (errorCode == AMQConstant.INVALID_ARGUMENT)
- {
- _logger.debug("Broker responded with Invalid Argument.");
-
- throw new AMQInvalidArgumentException(String.valueOf(reason));
- }
- else if (errorCode == AMQConstant.INVALID_ROUTING_KEY)
- {
- _logger.debug("Broker responded with Invalid Routing Key.");
-
- throw new AMQInvalidRoutingKeyException(String.valueOf(reason));
- }
- else
- {
- throw new AMQChannelClosedException(errorCode, "Error: " + reason);
- }
-
- }
-
- protocolSession.channelClosed(evt.getChannelId(), errorCode, String.valueOf(reason));
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.java
deleted file mode 100644
index 559e9a4741..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseOkTest.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.test.unit.client.channelclose;
-
-import junit.framework.TestCase;
-
-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.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 TestCase
-{
- 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 = new AMQConnection(_connectionString, "guest", "guest", randomize("Client"), "test");
-
- _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();
- TransportConnection.killAllVMBrokers();
- 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
- {
- synchronized (received)
- {
- while (received.size() < count)
- {
- try
- {
- received.wait();
- }
- 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java
deleted file mode 100644
index f1099ca5ab..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/ChannelCloseTest.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.framework.TestCase;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.AMQTimeoutException;
-import org.apache.qpid.client.AMQConnection;
-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.protocol.AMQProtocolSession;
-import org.apache.qpid.client.protocol.AMQProtocolHandler;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ChannelCloseOkBody;
-import org.apache.qpid.framing.ChannelOpenBody;
-import org.apache.qpid.framing.ChannelOpenOkBody;
-import org.apache.qpid.framing.ExchangeDeclareBody;
-import org.apache.qpid.framing.ExchangeDeclareOkBody;
-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 TestCase 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 = 5000;
- 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
- {
- _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
- */
- public void testSendingMethodsAfterClose() throws Exception
- {
- 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();
- 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)
- {
- AMQFrame frame =
- ChannelCloseOkBody.createAMQFrame(channel,
- ((AMQConnection) _connection).getProtocolHandler().getProtocolMajorVersion(),
- ((AMQConnection) _connection).getProtocolHandler().getProtocolMinorVersion());
-
- ((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.createTemporaryQueue();
-
- 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.AUTO_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(final int channelId, final String _type, final String _name, final boolean nowait)
- throws AMQException, FailoverException
- {
-// new FailoverRetrySupport<Object, AMQException>(new FailoverProtectedOperation<Object, AMQException>()
-// {
-// public Object execute() throws AMQException, FailoverException
-// {
-
- AMQProtocolHandler protocolHandler = ((AMQConnection) _connection).getProtocolHandler();
-
- AMQFrame exchangeDeclare =
- ExchangeDeclareBody.createAMQFrame(channelId,
- protocolHandler.getProtocolMajorVersion(),
- protocolHandler.getProtocolMinorVersion(), null, // arguments
- false, // autoDelete
- false, // durable
- new AMQShortString(_name), // exchange
- false, // internal
- nowait, // nowait
- true, // passive
- 0, // ticket
- new AMQShortString(_type)); // type
-
- 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
- {
- ((AMQConnection) _connection).getProtocolHandler().syncWrite(ChannelOpenBody.createAMQFrame(channelId,
- ((AMQConnection) _connection).getProtocolHandler().getProtocolMajorVersion(),
- ((AMQConnection) _connection).getProtocolHandler().getProtocolMinorVersion(), null), // 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java
deleted file mode 100644
index 9600d1e9d3..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java
+++ /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.
- *
- */
-package org.apache.qpid.test.unit.client.channelclose;
-
-import javax.jms.Connection;
-import javax.jms.MessageConsumer;
-import javax.jms.Session;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.transport.TransportConnection;
-
-/**
- * @author Apache Software Foundation
- */
-public class CloseWithBlockingReceiveTest extends TestCase
-{
-
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
-
- public void testReceiveReturnsNull() throws Exception
- {
- final AMQConnection connection = new AMQConnection("vm://:1", "guest", "guest",
- "fred", "test");
- 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/NoCloseOKStateManager.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/NoCloseOKStateManager.java
deleted file mode 100644
index d128f30727..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/NoCloseOKStateManager.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.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);
- }
-
- protected void registerListeners()
- {
- Map frame2handlerMap = new HashMap();
-
- // 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.put(null, frame2handlerMap);
-
- frame2handlerMap = new HashMap();
- frame2handlerMap.put(ConnectionStartBody.class, ConnectionStartMethodHandler.getInstance());
- frame2handlerMap.put(ConnectionCloseBody.class, ConnectionCloseMethodHandler.getInstance());
- _state2HandlersMap.put(AMQState.CONNECTION_NOT_STARTED, frame2handlerMap);
-
- frame2handlerMap = new HashMap();
- frame2handlerMap.put(ConnectionTuneBody.class, ConnectionTuneMethodHandler.getInstance());
- frame2handlerMap.put(ConnectionSecureBody.class, ConnectionSecureMethodHandler.getInstance());
- frame2handlerMap.put(ConnectionCloseBody.class, ConnectionCloseMethodHandler.getInstance());
- _state2HandlersMap.put(AMQState.CONNECTION_NOT_TUNED, frame2handlerMap);
-
- frame2handlerMap = new HashMap();
- frame2handlerMap.put(ConnectionOpenOkBody.class, ConnectionOpenOkMethodHandler.getInstance());
- frame2handlerMap.put(ConnectionCloseBody.class, ConnectionCloseMethodHandler.getInstance());
- _state2HandlersMap.put(AMQState.CONNECTION_NOT_OPENED, frame2handlerMap);
-
- //
- // ConnectionOpen handlers
- //
- frame2handlerMap = new HashMap();
- // Use Test Handler for Close methods to not send Close-OKs
- frame2handlerMap.put(ChannelCloseBody.class, ChannelCloseMethodHandlerNoCloseOk.getInstance());
-
- frame2handlerMap.put(ChannelCloseOkBody.class, ChannelCloseOkMethodHandler.getInstance());
- frame2handlerMap.put(ConnectionCloseBody.class, ConnectionCloseMethodHandler.getInstance());
- frame2handlerMap.put(BasicDeliverBody.class, BasicDeliverMethodHandler.getInstance());
- frame2handlerMap.put(BasicReturnBody.class, BasicReturnMethodHandler.getInstance());
- frame2handlerMap.put(BasicCancelOkBody.class, BasicCancelOkMethodHandler.getInstance());
- frame2handlerMap.put(ChannelFlowOkBody.class, ChannelFlowOkMethodHandler.getInstance());
- frame2handlerMap.put(QueueDeleteOkBody.class, QueueDeleteOkMethodHandler.getInstance());
- frame2handlerMap.put(ExchangeBoundOkBody.class, ExchangeBoundOkMethodHandler.getInstance());
- _state2HandlersMap.put(AMQState.CONNECTION_OPEN, frame2handlerMap);
- }
-
-
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java
deleted file mode 100644
index 1d108b9c5c..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.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.test.unit.client.connection;
-
-import junit.framework.TestCase;
-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 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 javax.jms.Queue;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-/**
- * ConnectionStartTest:
- * This test verifies that a fresh connection is not started and no messages are delivered until the connection is
- * started.
- *
- * After the connection is started then the message should be there, and the connection started.
- *
- * This Test verifies that using receive() and a messageListener does not cause message delivery before start is called.
- *
- */
-public class ConnectionStartTest extends TestCase
-{
-
- String _broker = "vm://:1";
-
- AMQConnection _connection;
- private Session _consumerSess;
- private MessageConsumer _consumer;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
-
- try
- {
- // Create Consumer Connection
- _connection = new AMQConnection(_broker, "guest", "guest", "fred", "test");
-
- _consumerSess = _connection.createSession(false, AMQSession.AUTO_ACKNOWLEDGE);
-
- Queue queue = _consumerSess.createQueue("ConnectionStartTest");
-
- _consumer = _consumerSess.createConsumer(queue);
-
-
- // Create Producer Connection to send message
- AMQConnection pubCon = new AMQConnection(_broker, "guest", "guest", "fred", "test");
-
- Session pubSess = pubCon.createSession(false, AMQSession.AUTO_ACKNOWLEDGE);
-
- MessageProducer pub = pubSess.createProducer(queue);
-
- pub.send(pubSess.createTextMessage("Initial Message"));
-
- pubCon.close();
-
- }
- catch (Exception e)
- {
- fail("Connection to " + _broker + " should succeed. Reason: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- _connection.close();
- TransportConnection.killVMBroker(1);
- 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
- assertNull("There should not be messages waiting for the consumer", _consumer.receiveNoWait());
- _connection.start();
- assertNotNull("There should be messages waiting for the consumer", _consumer.receive(1000));
- 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());
- _consumerSess.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());
- }
- }
- });
-
- // Ensure that setting a ML doesn't start the connection
- assertTrue("Connection should not be started", !_connection.started());
- // Ensure that the message wasn't delivered while the connection was stopped.
- assertEquals("Message latch should still be set",1,_gotMessage.getCount());
-
- _connection.start();
- assertTrue("Connection should be started", _connection.started());
-
- try
- {
- _gotMessage.await(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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
deleted file mode 100644
index 56394fee27..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.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.
- *
- */
-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.client.AMQAuthenticationException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.jms.Session;
-
-import junit.framework.TestCase;
-
-import javax.jms.Connection;
-import javax.jms.QueueSession;
-import javax.jms.TopicSession;
-
-public class ConnectionTest extends TestCase
-{
-
- String _broker = "vm://:1";
- String _broker_NotRunning = "vm://:2";
- String _broker_BadDNS = "tcp://hg3sgaaw4lgihjs";
-
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- TransportConnection.killVMBroker(1);
- }
-
- public void testSimpleConnection()
- {
- try
- {
- AMQConnection conn = new AMQConnection(_broker, "guest", "guest", "fred", "test");
- conn.close();
- }
- catch (Exception e)
- {
- fail("Connection to " + _broker + " should succeed. Reason: " + e);
- }
- }
-
-
- public void testDefaultExchanges()
- {
- try
- {
- AMQConnection conn = new AMQConnection("amqp://guest:guest@clientid/test?brokerlist='"
- + _broker
- + "?retries='1''&defaultQueueExchange='test.direct'"
- + "&defaultTopicExchange='test.topic'"
- + "&temporaryQueueExchange='tmp.direct'"
- + "&temporaryTopicExchange='tmp.topic'");
-
- 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();
-
-
- conn.close();
- }
- catch (Exception e)
- {
- fail("Connection to " + _broker + " should succeed. Reason: " + e);
- }
- }
-
- //fixme AMQAuthenticationException is not propogaged
- public void PasswordFailureConnection() throws Exception
- {
- try
- {
- new AMQConnection("amqp://guest:rubbishpassword@clientid/test?brokerlist='" + _broker + "?retries='1''");
- fail("Connection should not be established password is wrong.");
- }
- catch (AMQException amqe)
- {
- if (!(amqe instanceof AMQAuthenticationException))
- {
- fail("Correct exception not thrown. Excpected 'AMQAuthenticationException' got: " + amqe);
- }
- }
- }
-
- public void testConnectionFailure() throws Exception
- {
- try
- {
- 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);
- }
- }
-
- }
-
- public void testUnresolvedHostFailure() throws Exception
- {
- try
- {
- 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);
- }
- }
- }
-
- public void testClientIdCannotBeChanged() throws Exception
- {
- Connection connection = new AMQConnection(_broker, "guest", "guest",
- "fred", "test");
- try
- {
- connection.setClientID("someClientId");
- fail("No IllegalStateException thrown when resetting clientid");
- }
- catch (javax.jms.IllegalStateException e)
- {
- // PASS
- }
- }
-
- public void testClientIdIsPopulatedAutomatically() throws Exception
- {
- Connection connection = new AMQConnection(_broker, "guest", "guest",
- null, "test");
- assertNotNull(connection.getClientID());
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(ConnectionTest.class);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java
deleted file mode 100644
index bfbba61913..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/connectionurl/ConnectionURLTest.java
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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'";
-
- 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("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',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 static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(ConnectionURLTest.class);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java
deleted file mode 100644
index 66be1ebc73..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.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.test.unit.client.destinationurl;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.url.AMQBindingURL;
-import org.apache.qpid.url.URLSyntaxException;
-
-public class DestinationURLTest extends TestCase
-{
- public void testFullURL() throws URLSyntaxException
- {
-
- 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 URLSyntaxException
- {
-
- 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 URLSyntaxException
- {
-
- 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 URLSyntaxException
- {
-
- 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 URLSyntaxException
- {
-
- 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 URLSyntaxException
- {
-
- 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 URLSyntaxException
- {
-
- 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 static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(DestinationURLTest.class);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Client.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Client.java
deleted file mode 100644
index 19ef612bcc..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Client.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.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.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.jms.Message;
-import javax.jms.MessageListener;
-
-/**
- * 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;
-
- Client(String broker, int expected) throws Exception
- {
- this(connect(broker), expected);
- }
-
- 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");
- Message request = _session.createTextMessage("Request!");
- request.setJMSReplyTo(response);
- _session.createProducer(service).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(10000L);
- }
-
- 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");
- }
-
- 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java
deleted file mode 100644
index 9cde24dd92..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.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.test.unit.client.forwardall;
-
-import junit.framework.TestCase;
-import org.apache.qpid.testutil.VMBrokerSetup;
-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 TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(CombinedTest.class);
- private int run = 0;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- }
-
- protected void tearDown() throws Exception
- {
- ServiceCreator.closeAll();
- super.tearDown();
- }
-
- public void testForwardAll() throws Exception
- {
- while (run < 10)
- {
- int services = 2;
- 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 VMBrokerSetup(new junit.framework.TestSuite(CombinedTest.class));
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Service.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Service.java
deleted file mode 100644
index 6593f7d86a..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Service.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.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;
-
-/**
- * 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;
-
- 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);
- _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");
- }
-
-// public static void main(String[] argv) throws Exception
-// {
-// String broker = argv.length == 0? "localhost:5672" : argv[0];
-// new Service(broker);
-// }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/ServiceCreator.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/ServiceCreator.java
deleted file mode 100644
index be16f6b7ae..0000000000
--- a/Final/java/client/src/test/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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/SpecialQueue.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/SpecialQueue.java
deleted file mode 100644
index 27371b0397..0000000000
--- a/Final/java/client/src/test/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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/BytesMessageTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/BytesMessageTest.java
deleted file mode 100644
index bbabf0b57d..0000000000
--- a/Final/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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/MapMessageTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/MapMessageTest.java
deleted file mode 100644
index 3e04c36b38..0000000000
--- a/Final/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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java
deleted file mode 100644
index cd03b523d1..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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 junit.framework.TestCase;
-
-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.testutil.VMBrokerSetup;
-
-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 TestCase 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 = new AMQConnection(_broker, "guest", "guest", randomize("Client"), "test");
- 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
- {
- 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);
- }
- finally
- {
- close();
- }
- }
-
- 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();
- }
-
- public static junit.framework.Test suite()
- {
- return new VMBrokerSetup(new junit.framework.TestSuite(ObjectMessageTest.class));
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/StreamMessageTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/StreamMessageTest.java
deleted file mode 100644
index 802f1e6c2e..0000000000
--- a/Final/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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/TextMessageTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/message/TextMessageTest.java
deleted file mode 100644
index 30f3b0b4eb..0000000000
--- a/Final/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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/protocol/TestIoSession.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/protocol/TestIoSession.java
deleted file mode 100644
index d14e0b771f..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/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.unit.client.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/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.java
deleted file mode 100644
index 241c9177a8..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/client/temporaryqueue/TemporaryQueueTest.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.test.unit.client.temporaryqueue;
-
-import javax.jms.Connection;
-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 javax.jms.Queue;
-
-import junit.framework.TestCase;
-import junit.framework.Assert;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.url.URLSyntaxException;
-
-import java.util.List;
-import java.util.LinkedList;
-
-public class TemporaryQueueTest extends TestCase
-{
-
- String _broker = "vm://:1";
-
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- TransportConnection.killAllVMBrokers();
- }
-
- protected Connection createConnection() throws AMQException, URLSyntaxException
- {
- return new AMQConnection(_broker, "guest", "guest",
- "fred", "test");
- }
-
- public void testTempoaryQueue() 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 JMSException, AMQException, URLSyntaxException
- {
- 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 JMSException, AMQException, URLSyntaxException
- {
- 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 static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TemporaryQueueTest.class);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.java
deleted file mode 100644
index 5a61480f6a..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.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.test.unit.close;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.transport.TransportConnection;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import uk.co.thebadgerset.junit.concurrency.TestRunnable;
-import uk.co.thebadgerset.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 TestCase
-{
- 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();
- TransportConnection.createVMBroker(1);
-
- connection = new AMQConnection("vm://:1", "guest", "guest", getName(), "test");
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killVMBroker(1);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
deleted file mode 100644
index bf8802c803..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.TestCase;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.testutil.QpidClientConnection;
-import org.apache.qpid.url.URLSyntaxException;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-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;
-import java.util.UUID;
-
-public class MessageRequeueTest extends TestCase
-{
- 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 String payload = "Message:";
-
- protected final String BROKER = "vm://:1";
- private boolean testReception = true;
-
- private long[] receieved = new long[numTestMessages + 1];
- private boolean passed = false;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
-
-
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
-
- TransportConnection.killVMBroker(1);
- }
-
- /**
- * multiple consumers
- *
- * @throws javax.jms.JMSException if a JMS problem occurs
- * @throws InterruptedException on timeout
- */
- public void testDrain() throws JMSException, InterruptedException
- {
- final String queueName = "direct://amq.direct//queue" + UUID.randomUUID().toString();
-
- QpidClientConnection conn = new QpidClientConnection(BROKER);
-
- conn.connect();
- // clear queue
- conn.consume(queueName, consumeTimeout);
- // load test data
- _logger.info("creating test data, " + numTestMessages + " messages");
- conn.put(queueName, payload, numTestMessages);
- // close this connection
- conn.disconnect();
-
- conn = new QpidClientConnection(BROKER);
-
- conn.connect();
-
- _logger.info("consuming queue " + queueName);
- Queue q = conn.getSession().createQueue(queueName);
-
- 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);
- }
-
- conn.getSession().commit();
- consumer.close();
- assertEquals("number of consumed messages does not match initial data", (int) numTestMessages, messagesReceived);
-
- int index = 0;
- StringBuilder list = new StringBuilder();
- list.append("Failed to receive:");
- int failed = 0;
-
- 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);
- _logger.info("consumed: " + messagesReceived);
- conn.disconnect();
- passed = true;
-
- }
-
-
-
- /** multiple consumers
- * Based on code subbmitted by client FT-304
- */
- public void testCompetingConsumers() throws JMSException, InterruptedException
- {
- final String queueName = "direct://amq.direct//queue" + UUID.randomUUID().toString();
-
- QpidClientConnection conn = new QpidClientConnection(BROKER);
-
- conn.connect();
- // clear queue
- conn.consume(queueName, consumeTimeout);
- // load test data
- _logger.info("creating test data, " + numTestMessages + " messages");
- conn.put(queueName, payload, numTestMessages);
- // close this connection
- conn.disconnect();
-
- Consumer c1 = new Consumer(queueName);
- Consumer c2 = new Consumer(queueName);
- Consumer c3 = new Consumer(queueName);
- Consumer c4 = new Consumer(queueName);
-
- 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("Uanble 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;
-
- for (long b : receieved)
- {
- if ((b == 0) && (index != 0)) // delivery tag of zero shouldn't exist (and we don't have msg 0)
- {
- fail("Index: " + index + " was not received.");
- list.append(" ");
- list.append(index);
- list.append(":");
- list.append(b);
- failed++;
- }
-
- index++;
- }
-
- assertEquals(list.toString() + "-" + numTestMessages + "-" + totalConsumed, 0, failed);
- assertTrue("number of consumed messages does not match initial data: " + totalConsumed, numTestMessages <= totalConsumed);
-
- }
-
- class Consumer implements Runnable
- {
- private Integer count = 0;
- private Integer id;
- private final String _queueName;
-
- public Consumer(String queueName)
- {
- _queueName = queueName;
- 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(_queueName, 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, InterruptedException
- {
- final String queue = "direct://amq.direct//queue" + UUID.randomUUID().toString();
-
- QpidClientConnection 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();
-
- 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 + "'";
-
- AMQConnection amqConn = new AMQConnection(brokerUrl);
- Session session = amqConn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
- Queue q = session.createQueue(queue);
-
- _logger.debug("Create Consumer");
- MessageConsumer consumer = session.createConsumer(q);
-
- amqConn.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");
- amqConn.close();
- }
- }
-
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.java
deleted file mode 100644
index 5e2703d5a5..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.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.unit.close;
-
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.transport.TransportConnection;
-
-/**
- * @author Apache Software Foundation
- */
-public class TopicPublisherCloseTest extends TestCase
-{
-
- public String _connectionString = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- public void testAllMethodsThrowAfterConnectionClose() throws Exception
- {
- AMQConnection connection = new AMQConnection(_connectionString, "guest", "guest", "Client", "test");
-
- 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java
deleted file mode 100644
index a1d9af558c..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSDestinationTest.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.message;
-
-import junit.framework.TestCase;
-
-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.framing.AMQShortString;
-
-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 TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(JMSDestinationTest.class);
-
- public String _connectionString = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- public void testJMSDestination() throws Exception
- {
- AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
- 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 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "test");
- 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/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
deleted file mode 100644
index 3012909daa..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.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.message;
-
-import junit.framework.TestCase;
-
-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.client.transport.TransportConnection;
-import org.apache.qpid.framing.AMQShortString;
-
-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;
-
-/**
- * @author Apache Software Foundation
- */
-public class JMSPropertiesTest extends TestCase
-{
-
- 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();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- public void testJMSProperties() throws Exception
- {
- AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
- 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 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "test");
- 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();
- sentMsg.setJMSCorrelationID(JMS_CORR_ID);
- sentMsg.setJMSDeliveryMode(JMS_DELIV_MODE);
- sentMsg.setJMSType(JMS_TYPE);
- sentMsg.setJMSReplyTo(JMS_REPLY_TO);
-
- // send it
- producer.send(sentMsg);
-
- con2.close();
-
- con.start();
-
- // get message and check JMS properties
- ObjectMessage rm = (ObjectMessage) consumer.receive();
- 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());
-
- con.close();
- }
-
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/MessageConverterTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/MessageConverterTest.java
deleted file mode 100644
index fd425b9930..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/MessageConverterTest.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.test.unit.message;
-
-import javax.jms.Destination;
-import javax.jms.JMSException;
-import javax.jms.MapMessage;
-import javax.jms.Message;
-import javax.jms.TextMessage;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.message.AbstractJMSMessage;
-import org.apache.qpid.client.message.JMSMapMessage;
-import org.apache.qpid.client.message.JMSTextMessage;
-import org.apache.qpid.client.message.MessageConverter;
-import org.apache.qpid.exchange.ExchangeDefaults;
-
-
-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;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- testTextMessage = new JMSTextMessage();
-
- //Set Message Text
- testTextMessage.setText("testTextMessage text");
- setMessageProperties(testTextMessage);
-
- testMapMessage = new JMSMapMessage();
- testMapMessage.setString("testMapString", "testMapStringValue");
- testMapMessage.setDouble("testMapDouble", Double.MAX_VALUE);
- }
-
- public void testSetProperties() throws Exception
- {
- AbstractJMSMessage newMessage = new MessageConverter((TextMessage) testTextMessage).getConvertedMessage();
- mesagePropertiesTest(testTextMessage, newMessage);
- }
-
- public void testJMSTextMessageConversion() throws Exception
- {
- AbstractJMSMessage newMessage = new MessageConverter((TextMessage) testTextMessage).getConvertedMessage();
- assertEquals("Converted message text mismatch", ((JMSTextMessage) newMessage).getText(), testTextMessage.getText());
- }
-
- public void testJMSMapMessageConversion() throws Exception
- {
- AbstractJMSMessage newMessage = new MessageConverter((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/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/NonQpidMessage.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/NonQpidMessage.java
deleted file mode 100644
index df53c796b2..0000000000
--- a/Final/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/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.java
deleted file mode 100644
index 9c4f2af107..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.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.test.unit.message;
-
-import junit.framework.TestCase;
-
-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.transport.TransportConnection;
-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.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 TestCase
-{
-
- private static final Logger _logger = LoggerFactory.getLogger(StreamMessageTest.class);
-
- public String _connectionString = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- public void testStreamMessageEOF() throws Exception
- {
- Connection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
- 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, AMQSession.DEFAULT_PREFETCH_LOW_MARK,
- AMQSession.DEFAULT_PREFETCH_HIGH_MARK, 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 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "test");
-
- 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();
-
- msg2.readByte();
- try
- {
- msg2.readByte();
- }
- catch (Exception e)
- {
- assertTrue("Expected MessageEOFException: " + e, e instanceof MessageEOFException);
- }
- }
-
- public void testModifyReceivedMessageExpandsBuffer() throws Exception
- {
- AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
- 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 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "test");
- 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);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java
deleted file mode 100644
index a0a8eb10ed..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.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.unit.topic;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.url.URLSyntaxException;
-
-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.Session;
-import javax.jms.TextMessage;
-import javax.jms.TopicSubscriber;
-
-public class DurableSubscriptionTest extends TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(DurableSubscriptionTest.class);
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- public void testUnsubscribe() throws AMQException, JMSException, URLSyntaxException
- {
- AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "test", "test");
- AMQTopic topic = new AMQTopic(con, "MyTopic");
- _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 testDurabilityNOACK() throws AMQException, JMSException, URLSyntaxException
- {
- durabilityImpl(AMQSession.NO_ACKNOWLEDGE);
- }
-
- public void testDurabilityAUTOACK() throws AMQException, JMSException, URLSyntaxException
- {
- durabilityImpl(Session.AUTO_ACKNOWLEDGE);
- }
-
- private void durabilityImpl(int ackMode) throws AMQException, JMSException, URLSyntaxException
- {
-
- AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "test", "test");
- AMQTopic topic = new AMQTopic(con, "MyTopic");
- Session session1 = con.createSession(false, ackMode);
- MessageConsumer consumer1 = session1.createConsumer(topic);
-
- Session sessionProd = con.createSession(false, ackMode);
- MessageProducer producer = sessionProd.createProducer(topic);
-
- Session session2 = con.createSession(false, ackMode);
- TopicSubscriber consumer2 = session2.createDurableSubscriber(topic, "MySubscription");
-
- con.start();
-
- producer.send(session1.createTextMessage("A"));
-
- Message msg;
- 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);
-
- consumer2.close();
-
- Session session3 = con.createSession(false, ackMode);
- MessageConsumer consumer3 = session3.createDurableSubscriber(topic, "MySubscription");
-
- 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);
-
- _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();
-
- con.close();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(DurableSubscriptionTest.class);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.java
deleted file mode 100644
index 929e2799a9..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.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.test.unit.topic;
-
-import javax.jms.MessageConsumer;
-import javax.jms.TextMessage;
-import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
-
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.transport.TransportConnection;
-
-/**
- * @author Apache Software Foundation
- */
-public class TopicPublisherTest extends TestCase
-{
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
- public void testUnidentifiedProducer() throws Exception
- {
-
- AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "test", "test");
- 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
- }
-
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TopicPublisherTest.class);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
deleted file mode 100644
index 065b06a87d..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.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.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 junit.framework.TestCase;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.transport.TransportConnection;
-
-
-/** @author Apache Software Foundation */
-public class TopicSessionTest extends TestCase
-{
- private static final String BROKER = "vm://:1";
-
- protected void setUp() throws Exception
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
- TransportConnection.killAllVMBrokers();
- }
-
-
- public void testTopicSubscriptionUnsubscription() throws Exception
- {
-
- AMQConnection con = new AMQConnection(BROKER+"?retries='0'", "guest", "guest", "test", "test");
- 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 = new AMQConnection("vm://:1?retries='0'", "guest", "guest", "test", "test");
- AMQTopic topic = new AMQTopic(con, "MyTopic1" + String.valueOf(shutdown));
- AMQTopic topic2 = new AMQTopic(con, "MyOtherTopic1" + String.valueOf(shutdown));
-
- TopicSession session1 = con.createTopicSession(false, AMQSession.NO_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 = new AMQConnection("vm://:1?retries='0'", "guest", "guest", "test", "test");
- 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());
- con.close();
- }
-
- public void testUnsubscriptionAfterConnectionClose() throws Exception
- {
- AMQConnection con1 = new AMQConnection("vm://:1?retries='0'", "guest", "guest", "test", "test");
- AMQTopic topic = new AMQTopic(con1, "MyTopic3");
-
- TopicSession session1 = con1.createTopicSession(false, AMQSession.NO_ACKNOWLEDGE);
- TopicPublisher publisher = session1.createPublisher(topic);
-
- AMQConnection con2 = new AMQConnection("vm://:1?retries='0'", "guest", "guest", "test2", "test");
- TopicSession session2 = con2.createTopicSession(false, AMQSession.NO_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 = new AMQConnection("vm://:1?retries='0'", "guest", "guest", "test2", "test");
- 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());
- con1.close();
- con2.close();
- }
-
- public void testTextMessageCreation() throws Exception
- {
-
- AMQConnection con = new AMQConnection("vm://:1?retries='0'", "guest", "guest", "test", "test");
- 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(200000L);
- assertNotNull(tm);
- String msgText = tm.getText();
- assertEquals("Hello", msgText);
- tm = session1.createTextMessage();
- msgText = tm.getText();
- assertNull(msgText);
- publisher.publish(tm);
- tm = (TextMessage) consumer1.receive(20000000L);
- 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 = new AMQConnection("vm://:1?retries='0'", "guest", "guest", "test", "test");
- 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 = new AMQConnection("vm://:1?retries='0'", "guest", "guest", "test", "test");
- 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 = new AMQConnection(BROKER + "?retries='0'", "guest", "guest", "test", "test");
-
- AMQTopic topic = new AMQTopic(con, "testNoLocal");
-
- TopicSession session1 = con.createTopicSession(false, AMQSession.NO_ACKNOWLEDGE);
- TopicSubscriber noLocal = session1.createDurableSubscriber(topic, "noLocal", "", true);
- TopicSubscriber select = session1.createDurableSubscriber(topic, "select", "Selector = 'select'", false);
- TopicSubscriber normal = session1.createDurableSubscriber(topic, "normal");
-
- 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(5000);
- assertNotNull(m);
-
- //test selector subscriber doesn't message
- m = (TextMessage) select.receive(2000);
- assertNull(m);
-
- //test nolocal subscriber doesn't message
- m = (TextMessage) noLocal.receive(2000);
- 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(5000);
- assertNotNull(m);
-
- //test selector subscriber does get message
- m = (TextMessage) select.receive(2000);
- assertNotNull(m);
-
- //test nolocal subscriber doesn't message
- m = (TextMessage) noLocal.receive(1000);
- assertNull(m);
-
- AMQConnection con2 = new AMQConnection(BROKER + "?retries='0'", "guest", "guest", "test2", "test");
- 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(2000);
- assertNotNull(m);
-
- //test selector subscriber does get message
- m = (TextMessage) select.receive(2000);
- assertNotNull(m);
-
- //test nolocal subscriber does message
- m = (TextMessage) noLocal.receive(2000);
- assertNotNull(m);
-
-
- con.close();
- con2.close();
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TopicSessionTest.class);
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
deleted file mode 100644
index 224463a446..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.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.transacted;
-
-import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.url.URLSyntaxException;
-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.Queue;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-/**
- * This class tests a number of commits and roll back scenarios
- *
- * Assumptions; - Assumes empty Queue
- */
-public class CommitRollbackTest extends TestCase
-{
- 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 static final String BROKER = "vm://:1";
- private boolean _gotone = false;
- private boolean _gottwo = false;
- private boolean _gottwoRedelivered = false;
-
- protected void setUp() throws Exception
- {
- super.setUp();
- if (BROKER.startsWith("vm"))
- {
- TransportConnection.createVMBroker(1);
- }
-
- testMethod++;
- queue += testMethod;
-
- newConnection();
- }
-
- private void newConnection() throws AMQException, URLSyntaxException, JMSException
- {
- conn = new AMQConnection("amqp://guest:guest@client/test?brokerlist='" + BROKER + "'");
-
- _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
- {
- super.tearDown();
-
- conn.close();
- if (BROKER.startsWith("vm"))
- {
- TransportConnection.killVMBroker(1);
- }
- }
-
- /**
- * 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(5000);
- assertNotNull("retrieved message is null", msg);
-
- _logger.info("closing connection");
- conn.close();
-
- newConnection();
-
- _logger.info("receiving result");
- Message result = _consumer.receive(5000);
-
- _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(5000);
- 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(5000);
-
- _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("Messasge 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(5000);
-
- 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(5000);
-
- _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("Messasge 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(5000);
-
- 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());
- _gotone = true;
-
- }
- else
- {
- assertEquals("2", ((TextMessage) result).getText());
-
- if (result.getJMSRedelivered())
- {
- _logger.info("Got 2 redelivered, message was prefetched");
- _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");
-
-// NOTE: Both msg 1 & 2 will be marked as redelivered as they have both will have been rejected.
-// Only the occasion where it is not rejected will it mean it hasn't arrived at the client yet.
- result = _consumer.receive(5000);
- assertNotNull("test message was consumed and rolled back, but is gone", result);
-
-// The first message back will be either 1 or 2 being redelivered
- if (result.getJMSRedelivered())
- {
- assertTrue("Messasge is not marked as redelivered" + result, result.getJMSRedelivered());
- }
- else // or it will be msg 2 arriving the first time due to latency.
- {
- _logger.info("Message 2 wasn't prefetched so wasn't rejected");
- assertEquals("2", ((TextMessage) result).getText());
- }
-
- Message result2 = _consumer.receive(5000);
- assertNotNull("test message was consumed and rolled back, but is gone", result2);
-
- // if this is message 1 then it should be marked as redelivered
- if("1".equals(((TextMessage) result2).getText()))
- {
- assertTrue("Messasge is not marked as redelivered" + result2, result2.getJMSRedelivered());
- }
-
- assertNotSame("Messages should not have the same content",((TextMessage) result2).getText(), ((TextMessage) result).getText() );
-
- 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(5000));
-
- _publisher.send(_pubSession.createTextMessage(MESSAGE_TEXT));
-
- _logger.info("rolling back");
- _pubSession.rollback();
-
- _logger.info("receiving result");
- Message result = _consumer.receive(5000);
- assertNull("test message was put and rolled back, but is still present", result);
-
- _publisher.send(_pubSession.createTextMessage(MESSAGE_TEXT));
-
- _pubSession.commit();
-
- assertNotNull(_consumer.receive(5000));
-
- }
-
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java b/Final/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.java
deleted file mode 100644
index 678474a18b..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/test/unit/transacted/TransactedTest.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.test.unit.transacted;
-
-import junit.framework.TestCase;
-
-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.framing.AMQShortString;
-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.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.TextMessage;
-
-public class TransactedTest extends TestCase
-{
- private AMQQueue queue1;
- private AMQQueue queue2;
-
- 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
- {
- super.setUp();
- TransportConnection.createVMBroker(1);
- _logger.info("Create Connection");
- con = new AMQConnection("vm://:1", "guest", "guest", "TransactedTest", "test");
-
- _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");
- 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 = new AMQConnection("vm://:1", "guest", "guest", "PrepConnection", "test");
-
- _logger.info("Create prep session");
- prepSession = prepCon.createSession(false, AMQSession.NO_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 = new AMQConnection("vm://:1", "guest", "guest", "TestConnection", "test");
- _logger.info("Create test session");
- testSession = testCon.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- _logger.info("Create test consumer of q2");
- testConsumer2 = testSession.createConsumer(queue2);
- }
-
- protected void tearDown() throws Exception
- {
- _logger.info("Close connection");
- con.close();
- _logger.info("Close test connection");
- testCon.close();
- _logger.info("Close prep connection");
- prepCon.close();
- _logger.info("Kill broker");
- TransportConnection.killAllVMBrokers();
- super.tearDown();
- }
-
- public void testCommit() throws Exception
- {
- // 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));
- }
-
- public void testRollback() throws Exception
- {
- // 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));
- }
-
- public void testResendsMsgsAfterSessionClose() throws Exception
- {
- AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
-
- 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 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "test");
- 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();
- }
-
- 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/Final/java/client/src/test/java/org/apache/qpid/testutil/Config.java b/Final/java/client/src/test/java/org/apache/qpid/testutil/Config.java
deleted file mode 100644
index b777cf93b6..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/testutil/Config.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.testutil;
-
-import javax.jms.Connection;
-import javax.jms.Destination;
-
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQHeadersExchange;
-import org.apache.qpid.client.AMQQueue;
-import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.exchange.ExchangeDefaults;
-
-public class Config
-{
- public static final String QUEUE = "queue";
- public static final String TOPIC = "topic";
- public static final String HEADERS = "headers";
-
- private String host = "localhost";
- private int port = 5672;
- private String type;
- private String name = "simple_test_queue";
-
- public Config()
- {
- this("localhost", 5672, QUEUE, "simple_test_queue");
- }
-
- public Config(String host, int port, String type, String name)
- {
- setHost(host);
- setPort(port);
- setType(type);
- setName(name);
- }
-
- 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 getType()
- {
- return type;
- }
-
- public void setType(String type)
- {
- this.type = type;
- }
-
- public boolean isQueue()
- {
- return QUEUE.equalsIgnoreCase(type);
- }
-
- public boolean isTopic()
- {
- return TOPIC.equalsIgnoreCase(type);
- }
-
- private boolean isHeaders()
- {
- return HEADERS.equalsIgnoreCase(type);
- }
-
- public void setQueue(boolean queue)
- {
- type = queue ? QUEUE : TOPIC;
- }
-
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- public Destination getDestination()
- {
- if(isQueue())
- {
- System.out.println("Using queue named " + name);
- return new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME,name);
- }
- else if(isTopic())
- {
- System.out.println("Using topic named " + name);
- return new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_NAME,name);
- }
- else if(isHeaders())
- {
- System.out.println("Using headers exhange named " + name);
- return new AMQHeadersExchange(name);
- }
- return null;
- }
-
- public Connection getConnection() throws Exception
- {
- System.out.println("Connecting to " + host + " on " + port + "...");
- return new AMQConnection(host, port, "guest", "guest", "Client" + System.currentTimeMillis(), "/test");
- }
-
- 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;
- }
-
- private 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("-name".equalsIgnoreCase(key))
- {
- setName(value);
- }
- else if("-type".equalsIgnoreCase(key))
- {
- if(QUEUE.equalsIgnoreCase(value)
- || TOPIC.equalsIgnoreCase(value)
- || HEADERS.equalsIgnoreCase(value))
- {
- type = value;
- }
- else{
- throw new RuntimeException("Bad destination type: " + value);
- }
- }
- else
- {
- System.out.println("Ignoring unrecognised option: " + key);
- }
- }
-}
diff --git a/Final/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java b/Final/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java
deleted file mode 100644
index 7eb2abe7eb..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.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.testutil;
-
-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 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 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 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) 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/Final/java/client/src/test/java/org/apache/qpid/testutil/VMBrokerSetup.java b/Final/java/client/src/test/java/org/apache/qpid/testutil/VMBrokerSetup.java
deleted file mode 100644
index cedf1ac824..0000000000
--- a/Final/java/client/src/test/java/org/apache/qpid/testutil/VMBrokerSetup.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.testutil;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-
-import org.apache.qpid.client.transport.TransportConnection;
-
-public class VMBrokerSetup extends TestSetup
-{
- public VMBrokerSetup(Test t)
- {
- super(t);
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- try
- {
- TransportConnection.createVMBroker(1);
- }
- catch (Exception e)
- {
- fail("Unable to create broker: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- TransportConnection.killVMBroker(1);
- super.tearDown();
- }
-}
diff --git a/Final/java/client/test/bin/IBM-JNDI-Setup.bat b/Final/java/client/test/bin/IBM-JNDI-Setup.bat
deleted file mode 100644
index eb6a87fa9e..0000000000
--- a/Final/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/Final/java/client/test/bin/IBM-JNDI-Setup.sh b/Final/java/client/test/bin/IBM-JNDI-Setup.sh
deleted file mode 100755
index e3112f812d..0000000000
--- a/Final/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/Final/java/client/test/bin/IBM-Publisher.bat b/Final/java/client/test/bin/IBM-Publisher.bat
deleted file mode 100644
index 5bb4343c4c..0000000000
--- a/Final/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/Final/java/client/test/bin/IBM-Publisher.sh b/Final/java/client/test/bin/IBM-Publisher.sh
deleted file mode 100755
index adecf040bc..0000000000
--- a/Final/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/Final/java/client/test/bin/IBM-PutGet.bat b/Final/java/client/test/bin/IBM-PutGet.bat
deleted file mode 100644
index c4316f1256..0000000000
--- a/Final/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/Final/java/client/test/bin/IBM-PutGet.sh b/Final/java/client/test/bin/IBM-PutGet.sh
deleted file mode 100755
index c75667c9f6..0000000000
--- a/Final/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/Final/java/client/test/bin/IBM-README.txt b/Final/java/client/test/bin/IBM-README.txt
deleted file mode 100644
index b076f3b3ca..0000000000
--- a/Final/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/Final/java/client/test/bin/IBM-Receiver.bat b/Final/java/client/test/bin/IBM-Receiver.bat
deleted file mode 100644
index dff44d472a..0000000000
--- a/Final/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/Final/java/client/test/bin/IBM-Receiver.sh b/Final/java/client/test/bin/IBM-Receiver.sh
deleted file mode 100755
index f50f0f744e..0000000000
--- a/Final/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/Final/java/client/test/bin/IBM-Sender.bat b/Final/java/client/test/bin/IBM-Sender.bat
deleted file mode 100644
index b8826322e5..0000000000
--- a/Final/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/Final/java/client/test/bin/IBM-Sender.sh b/Final/java/client/test/bin/IBM-Sender.sh
deleted file mode 100755
index b99429fd54..0000000000
--- a/Final/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/Final/java/client/test/bin/IBM-Subscriber.bat b/Final/java/client/test/bin/IBM-Subscriber.bat
deleted file mode 100644
index 5245639eba..0000000000
--- a/Final/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/Final/java/client/test/bin/IBM-Subscriber.sh b/Final/java/client/test/bin/IBM-Subscriber.sh
deleted file mode 100755
index 43550100be..0000000000
--- a/Final/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/Final/java/client/test/bin/headersListener.sh b/Final/java/client/test/bin/headersListener.sh
deleted file mode 100755
index 81930b7043..0000000000
--- a/Final/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/Final/java/client/test/bin/headersListenerGroup.sh b/Final/java/client/test/bin/headersListenerGroup.sh
deleted file mode 100755
index e1cc05cfd2..0000000000
--- a/Final/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/Final/java/client/test/bin/headersPublisher.sh b/Final/java/client/test/bin/headersPublisher.sh
deleted file mode 100755
index fd9fd26416..0000000000
--- a/Final/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/Final/java/client/test/bin/run_many.sh b/Final/java/client/test/bin/run_many.sh
deleted file mode 100755
index cca2ffec21..0000000000
--- a/Final/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/Final/java/client/test/bin/serviceProvidingClient.sh b/Final/java/client/test/bin/serviceProvidingClient.sh
deleted file mode 100755
index cbcf5a0f4b..0000000000
--- a/Final/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/Final/java/client/test/bin/serviceRequestingClient.sh b/Final/java/client/test/bin/serviceRequestingClient.sh
deleted file mode 100755
index 213f44c00b..0000000000
--- a/Final/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/Final/java/client/test/bin/testService.sh b/Final/java/client/test/bin/testService.sh
deleted file mode 100755
index 20161c3abf..0000000000
--- a/Final/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/Final/java/client/test/bin/topicListener.sh b/Final/java/client/test/bin/topicListener.sh
deleted file mode 100755
index ac0cb63c91..0000000000
--- a/Final/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/Final/java/client/test/bin/topicPublisher.sh b/Final/java/client/test/bin/topicPublisher.sh
deleted file mode 100755
index e35c131fe8..0000000000
--- a/Final/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/Final/java/client/test/etc/ApacheDS.properties b/Final/java/client/test/etc/ApacheDS.properties
deleted file mode 100644
index 6c5cb4cec4..0000000000
--- a/Final/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/Final/java/client/test/example_build.xml b/Final/java/client/test/example_build.xml
deleted file mode 100644
index a12862be04..0000000000
--- a/Final/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/Final/java/cluster/doc/design.doc b/Final/java/cluster/doc/design.doc
deleted file mode 100644
index c5bbf0f8a4..0000000000
--- a/Final/java/cluster/doc/design.doc
+++ /dev/null
Binary files differ
diff --git a/Final/java/cluster/pom.xml b/Final/java/cluster/pom.xml
deleted file mode 100644
index aaaf7d2f26..0000000000
--- a/Final/java/cluster/pom.xml
+++ /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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-cluster</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid Cluster</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-common</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-broker</artifactId>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.java
deleted file mode 100644
index 2baaa344ef..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQConnectionWaitException.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.cluster;
-
-import org.apache.qpid.AMQException;
-
-/**
- * AMQConnectionWaitException represents a failure to connect to a cluster peer in a timely manner.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents failure to connect to a cluster peer in a timely manner.
- * </table>
- *
- * @todo Not an AMQP exception as no status code.
- */
-public class AMQConnectionWaitException extends AMQException
-{
- public AMQConnectionWaitException(String s, Throwable e)
- {
- super(s, e);
-
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.java
deleted file mode 100644
index 951bd22df0..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedBodyTypeException.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.cluster;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQBody;
-
-/**
- * AMQUnexpectedBodyTypeException represents a failure where a message body does not match its expected type. For example,
- * and AMQP method should have a method body.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td> Represents a failure where a message body does not match 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. Check that the framing layer will pick up the error first.
- */
-public class AMQUnexpectedBodyTypeException extends AMQException
-{
- public AMQUnexpectedBodyTypeException(Class<? extends AMQBody> expectedClass, AMQBody body)
- {
- super("Unexpected body type. Expected: " + expectedClass.getName() + "; got: " + body.getClass().getName());
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.java
deleted file mode 100644
index 4dd318f90d..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/AMQUnexpectedFrameTypeException.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.cluster;
-
-import org.apache.qpid.AMQException;
-
-/**
- * AMQUnexpectedFrameTypeException 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 AMQUnexpectedFrameTypeException extends AMQException
-{
- public AMQUnexpectedFrameTypeException(String s)
- {
- super(s);
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BlockingHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BlockingHandler.java
deleted file mode 100644
index 39508df566..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BlockingHandler.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.server.cluster;
-
-import org.apache.qpid.framing.AMQMethodBody;
-
-public class BlockingHandler implements ResponseHandler
-{
- private final Class _expected;
- private boolean _completed;
- private AMQMethodBody _response;
-
-
- public BlockingHandler()
- {
- this(AMQMethodBody.class);
- }
-
- public BlockingHandler(Class<? extends AMQMethodBody> expected)
- {
- _expected = expected;
- }
-
- public void responded(AMQMethodBody response)
- {
- if (_expected.isInstance(response))
- {
- _response = response;
- completed();
- }
- }
-
- public void removed()
- {
- completed();
- }
-
- private synchronized void completed()
- {
- _completed = true;
- notifyAll();
- }
-
- synchronized void waitForCompletion()
- {
- while (!_completed)
- {
- try
- {
- wait();
- }
- catch (InterruptedException ignore)
- {
-
- }
- }
- }
-
- AMQMethodBody getResponse()
- {
- return _response;
- }
-
- boolean failed()
- {
- return _response == null;
- }
-
- boolean isCompleted()
- {
- return _completed;
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BroadcastPolicy.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BroadcastPolicy.java
deleted file mode 100644
index 145aa58574..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BroadcastPolicy.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.cluster;
-
-public interface BroadcastPolicy
-{
- public boolean isComplete(int responded, int members);
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Broker.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Broker.java
deleted file mode 100644
index 7e2cf6da83..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Broker.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.cluster;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.log4j.Logger;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * An implementation of the Member interface (through which data is sent to other
- * peers in the cluster). This class provides a base from which subclasses can
- * inherit some common behaviour for broadcasting GroupRequests and sending methods
- * that may expect a response. It also extends the Member abstraction to support
- * a richer set of operations that are useful within the package but should not be
- * exposed outside of it.
- *
- */
-abstract class Broker extends SimpleMemberHandle implements Member
-{
- private static final Logger _logger = Logger.getLogger(Broker.class);
- private static final int DEFAULT_CHANNEL = 1;
- private static final int START_CHANNEL = 2;
- private static final int END_CHANNEL = 10000;
-
-
- private MemberFailureListener _listener;
- //a wrap-around counter to allocate _requests a unique channel:
- private int _nextChannel = START_CHANNEL;
- //outstanding _requests:
- private final Map<Integer, ResponseHandler> _requests = new HashMap<Integer, ResponseHandler>();
-
- Broker(String host, int port)
- {
- super(host, port);
- }
-
- /**
- * Allows a listener to be registered that will receive callbacks when communication
- * to the peer this broker instance represents fails.
- * @param listener the callback to be notified of failures
- */
- public void addFailureListener(MemberFailureListener listener)
- {
- _listener = listener;
- }
-
- /**
- * Allows subclasses to signal comunication failures
- */
- protected void failed()
- {
- if (_listener != null)
- {
- _listener.failed(this);
- }
- }
-
- /**
- * Subclasses should call this on receiving message responses from the remote
- * peer. They are matched to any outstanding request they might be response
- * to, with the completion and callback of that request being managed if
- * required.
- *
- * @param channel the channel on which the method was received
- * @param response the response received
- * @return true if the response matched an outstanding request
- */
- protected synchronized boolean handleResponse(int channel, AMQMethodBody response)
- {
- ResponseHandler request = _requests.get(channel);
- if (request == null)
- {
- if(!_requests.isEmpty())
- {
- _logger.warn(new LogMessage("[next channel={3, integer}]: Response {0} on channel {1, integer} failed to match outstanding requests: {2}", response, channel, _requests, _nextChannel));
- }
- return false;
- }
- else
- {
- request.responded(response);
- return true;
- }
- }
-
- /**
- * Called when this broker is excluded from the group. Any requests made on
- * it are informed this member has left the group.
- */
- synchronized void remove()
- {
- for (ResponseHandler r : _requests.values())
- {
- r.removed();
- }
- }
-
- /**
- * Engages this broker in the specified group request
- *
- * @param request the request being made to a group of brokers
- * @throws AMQException if there is any failure
- */
- synchronized void invoke(GroupRequest request) throws AMQException
- {
- int channel = nextChannel();
- _requests.put(channel, new GroupRequestAdapter(request, channel));
- request.send(channel, this);
- }
-
- /**
- * Sends a message to the remote peer and undertakes to notify the specified
- * handler of the response.
- *
- * @param msg the message to send
- * @param handler the callback to notify of responses (or the removal of this broker
- * from the group)
- * @throws AMQException
- */
- synchronized void send(Sendable msg, ResponseHandler handler) throws AMQException
- {
- int channel;
- if (handler != null)
- {
- channel = nextChannel();
- _requests.put(channel, new RemovingWrapper(handler, channel));
- }
- else
- {
- channel = DEFAULT_CHANNEL;
- }
-
- msg.send(channel, this);
- }
-
- private int nextChannel()
- {
- int channel = _nextChannel++;
- if(_nextChannel >= END_CHANNEL)
- {
- _nextChannel = START_CHANNEL;
- }
- return channel;
- }
-
- /**
- * extablish connection without handling redirect
- */
- abstract boolean connect() throws IOException, InterruptedException;
-
- /**
- * Start connection process, including replay
- */
- abstract void connectAsynch(Iterable<AMQMethodBody> msgs);
-
- /**
- * Replay messages to the remote peer this instance represents. These messages
- * must be sent before any others whose transmission is requested through send() etc.
- *
- * @param msgs
- */
- abstract void replay(Iterable<AMQMethodBody> msgs);
-
- /**
- * establish connection, handling redirect if required...
- */
- abstract Broker connectToCluster() throws IOException, InterruptedException;
-
- private class GroupRequestAdapter implements ResponseHandler
- {
- private final GroupRequest request;
- private final int channel;
-
- GroupRequestAdapter(GroupRequest request, int channel)
- {
- this.request = request;
- this.channel = channel;
- }
-
- public void responded(AMQMethodBody response)
- {
- request.responseReceived(Broker.this, response);
- _requests.remove(channel);
- }
-
- public void removed()
- {
- request.removed(Broker.this);
- }
-
- public String toString()
- {
- return "GroupRequestAdapter{" + channel + ", " + request + "}";
- }
- }
-
- private class RemovingWrapper implements ResponseHandler
- {
- private final ResponseHandler handler;
- private final int channel;
-
- RemovingWrapper(ResponseHandler handler, int channel)
- {
- this.handler = handler;
- this.channel = channel;
- }
-
- public void responded(AMQMethodBody response)
- {
- handler.responded(response);
- _requests.remove(channel);
- }
-
- public void removed()
- {
- handler.removed();
- }
-
- public String toString()
- {
- return "RemovingWrapper{" + channel + ", " + handler + "}";
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BrokerFactory.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BrokerFactory.java
deleted file mode 100644
index 92c3c4e7bf..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BrokerFactory.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.cluster;
-
-interface BrokerFactory
-{
- public Broker create(MemberHandle handle);
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BrokerGroup.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BrokerGroup.java
deleted file mode 100644
index 755a341607..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/BrokerGroup.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.qpid.server.cluster;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.cluster.replay.ReplayManager;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.qpid.server.cluster.util.InvokeMultiple;
-import org.apache.qpid.framing.AMQMethodBody;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Manages the membership list of a group and the set of brokers representing the
- * remote peers. The group should be initialised through a call to establish()
- * or connectToLeader().
- *
- */
-class BrokerGroup
-{
- private static final Logger _logger = Logger.getLogger(BrokerGroup.class);
-
- private final InvokeMultiple<MembershipChangeListener> _changeListeners = new InvokeMultiple<MembershipChangeListener>(MembershipChangeListener.class);
- private final ReplayManager _replayMgr;
- private final MemberHandle _local;
- private final BrokerFactory _factory;
- private final Object _lock = new Object();
- private final Set<MemberHandle> _synch = new HashSet<MemberHandle>();
- private List<MemberHandle> _members;
- private List<Broker> _peers = new ArrayList<Broker>();
- private JoinState _state = JoinState.UNINITIALISED;
-
- /**
- * Creates an unitialised group.
- *
- * @param local a handle that represents the local broker
- * @param replayMgr the replay manager to use when creating new brokers
- * @param factory the factory through which broker instances are created
- */
- BrokerGroup(MemberHandle local, ReplayManager replayMgr, BrokerFactory factory)
- {
- _replayMgr = replayMgr;
- _local = local;
- _factory = factory;
- }
-
- /**
- * Called to establish the local broker as the leader of a new group
- */
- void establish()
- {
- synchronized (_lock)
- {
- setState(JoinState.JOINED);
- _members = new ArrayList<MemberHandle>();
- _members.add(_local);
- }
- fireChange();
- }
-
- /**
- * Called by prospect to connect to group
- */
- Broker connectToLeader(MemberHandle handle) throws Exception
- {
- Broker leader = _factory.create(handle);
- leader = leader.connectToCluster();
- synchronized (_lock)
- {
- setState(JoinState.JOINING);
- _members = new ArrayList<MemberHandle>();
- _members.add(leader);
- _peers.add(leader);
- }
- fireChange();
- return leader;
- }
-
- /**
- * Called by leader when handling a join request
- */
- Broker connectToProspect(MemberHandle handle) throws IOException, InterruptedException
- {
- Broker prospect = _factory.create(handle);
- prospect.connect();
- synchronized (_lock)
- {
- _members.add(prospect);
- _peers.add(prospect);
- }
- fireChange();
- return prospect;
- }
-
- /**
- * Called in reponse to membership announcements.
- *
- * @param members the list of members now part of the group
- */
- void setMembers(List<MemberHandle> members)
- {
- if (isJoined())
- {
- List<Broker> old = _peers;
-
- synchronized (_lock)
- {
- _peers = getBrokers(members);
- _members = new ArrayList<MemberHandle>(members);
- }
-
- //remove those that are still members
- old.removeAll(_peers);
-
- //handle failure of any brokers that haven't survived
- for (Broker peer : old)
- {
- peer.remove();
- }
- }
- else
- {
- synchronized (_lock)
- {
- setState(JoinState.INITIATION);
- _members = new ArrayList<MemberHandle>(members);
- _synch.addAll(_members);
- _synch.remove(_local);
- }
- }
- fireChange();
- }
-
- List<MemberHandle> getMembers()
- {
- synchronized (_lock)
- {
- return Collections.unmodifiableList(_members);
- }
- }
-
- List<Broker> getPeers()
- {
- synchronized (_lock)
- {
- return _peers;
- }
- }
-
- /**
- * Removes the member presented from the group
- * @param peer the broker that should be removed
- */
- void remove(Broker peer)
- {
- synchronized (_lock)
- {
- _peers.remove(peer);
- _members.remove(peer);
- }
- fireChange();
- }
-
- MemberHandle getLocal()
- {
- return _local;
- }
-
- Broker getLeader()
- {
- synchronized (_lock)
- {
- return _peers.size() > 0 ? _peers.get(0) : null;
- }
- }
-
- /**
- * Allows a Broker instance to be retrieved for a given handle
- *
- * @param handle the handle for which a broker is sought
- * @param create flag to indicate whther a broker should be created for the handle if
- * one is not found within the list of known peers
- * @return the broker corresponding to handle or null if a match cannot be found and
- * create is false
- */
- Broker findBroker(MemberHandle handle, boolean create)
- {
- if (handle instanceof Broker)
- {
- return (Broker) handle;
- }
- else
- {
- for (Broker b : getPeers())
- {
- if (b.matches(handle))
- {
- return b;
- }
- }
- }
- if (create)
- {
- Broker b = _factory.create(handle);
- List<AMQMethodBody> msgs = _replayMgr.replay(isLeader(_local));
- _logger.info(new LogMessage("Replaying {0} from {1} to {2}", msgs, _local, b));
- b.connectAsynch(msgs);
-
- return b;
- }
- else
- {
- return null;
- }
- }
-
- /**
- * @param member the member to test for leadership
- * @return true if the passed in member is the group leader, false otherwise
- */
- boolean isLeader(MemberHandle member)
- {
- synchronized (_lock)
- {
- return member.matches(_members.get(0));
- }
- }
-
- /**
- * @return true if the local broker is the group leader, false otherwise
- */
- boolean isLeader()
- {
- return isLeader(_local);
- }
-
- /**
- * Used when the leader fails and the next broker in the list needs to
- * assume leadership
- * @return true if the action succeeds
- */
- boolean assumeLeadership()
- {
- boolean valid;
- synchronized (_lock)
- {
- valid = _members.size() > 1 && _local.matches(_members.get(1));
- if (valid)
- {
- _members.remove(0);
- _peers.remove(0);
- }
- }
- fireChange();
- return valid;
- }
-
- /**
- * Called in response to a Cluster.Synch message being received during the join
- * process. This indicates that the member mentioned has replayed all necessary
- * messages to the local broker.
- *
- * @param member the member from whom the synch messages was received
- */
- void synched(MemberHandle member)
- {
- _logger.info(new LogMessage("Synchronised with {0}", member));
- synchronized (_lock)
- {
- if (isLeader(member))
- {
- setState(JoinState.INDUCTION);
- }
- _synch.remove(member);
- if (_synch.isEmpty())
- {
- _peers = getBrokers(_members);
- setState(JoinState.JOINED);
- }
- }
- }
-
-
- /**
- * @return the state of the group
- */
- JoinState getState()
- {
- synchronized (_lock)
- {
- return _state;
- }
- }
-
- void addMemberhipChangeListener(MembershipChangeListener l)
- {
- _changeListeners.addListener(l);
- }
-
- void removeMemberhipChangeListener(MembershipChangeListener l)
- {
- _changeListeners.removeListener(l);
- }
-
-
-
- private void setState(JoinState state)
- {
- _logger.info(new LogMessage("Changed state from {0} to {1}", _state, state));
- _state = state;
- }
-
- private boolean isJoined()
- {
- return inState(JoinState.JOINED);
- }
-
- private boolean inState(JoinState state)
- {
- return _state.equals(state);
- }
-
- private List<Broker> getBrokers(List<MemberHandle> handles)
- {
- List<Broker> brokers = new ArrayList<Broker>();
- for (MemberHandle handle : handles)
- {
- if (!_local.matches(handle))
- {
- brokers.add(findBroker(handle, true));
- }
- }
- return brokers;
- }
-
- private void fireChange()
- {
- List<MemberHandle> members;
- synchronized(this)
- {
- members = new ArrayList(_members);
- }
- _changeListeners.getProxy().changed(Collections.unmodifiableList(members));
- }
-} \ No newline at end of file
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientAdapter.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientAdapter.java
deleted file mode 100644
index 1b4a3e8327..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientAdapter.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.cluster;
-
-import org.apache.mina.common.IoSession;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.client.state.AMQStateManager;
-import org.apache.qpid.framing.AMQMethodBody;
-
-/**
- * Hack to assist with reuse of the client handlers for connection setup in
- * the inter-broker communication within the cluster.
- *
- */
-class ClientAdapter implements MethodHandler
-{
- private final AMQProtocolSession _session;
- private final AMQStateManager _stateMgr;
-
- ClientAdapter(IoSession session, AMQStateManager stateMgr)
- {
- this(session, stateMgr, "guest", "guest", session.toString(), "/cluster");
- }
-
- ClientAdapter(IoSession session, AMQStateManager stateMgr, String user, String password, String name, String path)
- {
- _session = new SessionAdapter(session, new ConnectionAdapter(user, password, name, path));
- _stateMgr = stateMgr;
- }
-
- public void handle(int channel, AMQMethodBody method) throws AMQException
- {
- AMQMethodEvent evt = new AMQMethodEvent(channel, method);
- _stateMgr.methodReceived(evt);
- }
-
- private class SessionAdapter extends AMQProtocolSession
- {
- public SessionAdapter(IoSession session, AMQConnection connection)
- {
- super(null, session, connection);
- }
- }
-
- private static class ConnectionAdapter extends AMQConnection
- {
- ConnectionAdapter(String username, String password, String clientName, String virtualPath)
- {
- super(username, password, clientName, virtualPath);
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.java
deleted file mode 100644
index c1caf8bbff..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClientHandlerRegistry.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.server.cluster;
-
-import org.apache.qpid.client.handler.ConnectionCloseMethodHandler;
-import org.apache.qpid.client.handler.ConnectionOpenOkMethodHandler;
-import org.apache.qpid.client.handler.ConnectionSecureMethodHandler;
-import org.apache.qpid.client.handler.ConnectionStartMethodHandler;
-import org.apache.qpid.client.handler.ConnectionTuneMethodHandler;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.client.state.AMQStateManager;
-// import org.apache.qpid.client.state.IllegalStateTransitionException;
-import org.apache.qpid.client.state.StateAwareMethodListener;
-import org.apache.qpid.client.protocol.AMQProtocolSession;
-import org.apache.qpid.framing.*;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * An extension of client.AMQStateManager that allows different handlers to be registered.
- *
- */
-public class ClientHandlerRegistry extends AMQStateManager
-{
- private final Map<AMQState, ClientRegistry> _handlers = new HashMap<AMQState, ClientRegistry>();
- private final MemberHandle _identity;
-
- protected ClientHandlerRegistry(MemberHandle local, AMQProtocolSession protocolSession)
- {
- super(AMQState.CONNECTION_NOT_STARTED, false, protocolSession);
-
- _identity = local;
-
- addHandler(ConnectionStartBody.class, ConnectionStartMethodHandler.getInstance(),
- AMQState.CONNECTION_NOT_STARTED);
-
- addHandler(ConnectionTuneBody.class, new ConnectionTuneHandler(),
- AMQState.CONNECTION_NOT_TUNED);
- addHandler(ConnectionSecureBody.class, ConnectionSecureMethodHandler.getInstance(),
- AMQState.CONNECTION_NOT_TUNED);
- addHandler(ConnectionOpenOkBody.class, ConnectionOpenOkMethodHandler.getInstance(),
- AMQState.CONNECTION_NOT_OPENED);
-
- addHandlers(ConnectionCloseBody.class, ConnectionCloseMethodHandler.getInstance(),
- AMQState.CONNECTION_NOT_STARTED,
- AMQState.CONNECTION_NOT_TUNED,
- AMQState.CONNECTION_NOT_OPENED);
-
- }
-
- private ClientRegistry state(AMQState state)
- {
- ClientRegistry registry = _handlers.get(state);
- if (registry == null)
- {
- registry = new ClientRegistry();
- _handlers.put(state, registry);
- }
- return registry;
- }
-
- protected StateAwareMethodListener findStateTransitionHandler(AMQState state, AMQMethodBody frame) //throws IllegalStateTransitionException
- {
- ClientRegistry registry = _handlers.get(state);
- return registry == null ? null : registry.getHandler(frame);
- }
-
-
- <A extends Class<AMQMethodBody>> void addHandlers(Class type, StateAwareMethodListener handler, AMQState... states)
- {
- for (AMQState state : states)
- {
- addHandler(type, handler, state);
- }
- }
-
- <A extends Class<AMQMethodBody>> void addHandler(Class type, StateAwareMethodListener handler, AMQState state)
- {
- ClientRegistry registry = _handlers.get(state);
- if (registry == null)
- {
- registry = new ClientRegistry();
- _handlers.put(state, registry);
- }
- registry.add(type, handler);
- }
-
- static class ClientRegistry
- {
- private final Map<Class<? extends AMQMethodBody>, StateAwareMethodListener> registry
- = new HashMap<Class<? extends AMQMethodBody>, StateAwareMethodListener>();
-
- <A extends Class<AMQMethodBody>> void add(A type, StateAwareMethodListener handler)
- {
- registry.put(type, handler);
- }
-
- StateAwareMethodListener getHandler(AMQMethodBody frame)
- {
- return registry.get(frame.getClass());
- }
- }
-
- class ConnectionTuneHandler extends ConnectionTuneMethodHandler
- {
- protected AMQFrame createConnectionOpenFrame(int channel, AMQShortString path, AMQShortString capabilities, boolean insist, byte major, byte minor)
- {
- return super.createConnectionOpenFrame(channel, path, new AMQShortString(ClusterCapability.add(capabilities, _identity)), insist, major, minor);
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusterBuilder.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusterBuilder.java
deleted file mode 100644
index 80f9ef62b1..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusterBuilder.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.cluster;
-
-import org.apache.qpid.server.cluster.handler.ClusterMethodHandlerFactory;
-import org.apache.qpid.server.cluster.replay.RecordingMethodHandlerFactory;
-import org.apache.qpid.server.cluster.replay.ReplayStore;
-
-import java.net.InetSocketAddress;
-
-class ClusterBuilder
-{
- private final LoadTable loadTable = new LoadTable();
- private final ReplayStore replayStore = new ReplayStore();
- private final MemberHandle handle;
- private final GroupManager groupMgr;
-
- ClusterBuilder(InetSocketAddress address)
- {
- handle = new SimpleMemberHandle(address.getHostName(), address.getPort()).resolve();
- groupMgr = new DefaultGroupManager(handle, getBrokerFactory(), replayStore, loadTable);
- }
-
- GroupManager getGroupManager()
- {
- return groupMgr;
- }
-
- ServerHandlerRegistry getHandlerRegistry()
- {
- return new ServerHandlerRegistry(getHandlerFactory(), null, null);
- }
-
- private MethodHandlerFactory getHandlerFactory()
- {
- MethodHandlerFactory factory = new ClusterMethodHandlerFactory(groupMgr, loadTable);
- //need to wrap relevant handlers with recording handler for easy replay:
- return new RecordingMethodHandlerFactory(factory, replayStore);
- }
-
- private BrokerFactory getBrokerFactory()
- {
- return new MinaBrokerProxyFactory(handle);
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusterCapability.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusterCapability.java
deleted file mode 100644
index 57c48f0611..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusterCapability.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.cluster;
-
-import org.apache.qpid.framing.AMQShortString;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class ClusterCapability
-{
- public static final String PATTERN = ".*\\bcluster_peer=(\\S*:\\d*)\b*.*";
- public static final String PEER = "cluster_peer";
-
- public static AMQShortString add(AMQShortString original, MemberHandle identity)
- {
- return original == null ? peer(identity) : new AMQShortString(original + " " + peer(identity));
- }
-
- private static AMQShortString peer(MemberHandle identity)
- {
- return new AMQShortString(PEER + "=" + identity.getDetails());
- }
-
- public static boolean contains(AMQShortString in)
- {
- return in != null; // && in.contains(in);
- }
-
- public static MemberHandle getPeer(AMQShortString in)
- {
- Matcher matcher = Pattern.compile(PATTERN).matcher(in);
- if (matcher.matches())
- {
- return new SimpleMemberHandle(matcher.group(1));
- }
- else
- {
- throw new RuntimeException("Could not find peer in '" + in + "'");
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusteredProtocolHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusteredProtocolHandler.java
deleted file mode 100644
index ee5aa48db9..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusteredProtocolHandler.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.server.cluster;
-
-import org.apache.log4j.Logger;
-import org.apache.mina.common.IoSession;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.framing.AMQBody;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.ConnectionOpenBody;
-import org.apache.qpid.framing.ConnectionSecureOkBody;
-import org.apache.qpid.framing.ConnectionStartOkBody;
-import org.apache.qpid.framing.ConnectionTuneOkBody;
-import org.apache.qpid.framing.ClusterMembershipBody;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.protocol.AMQPFastProtocolHandler;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-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.cluster.util.LogMessage;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-
-import java.net.InetSocketAddress;
-
-public class ClusteredProtocolHandler extends AMQPFastProtocolHandler implements InductionBuffer.MessageHandler
-{
- private static final Logger _logger = Logger.getLogger(ClusteredProtocolHandler.class);
- private final InductionBuffer _peerBuffer = new InductionBuffer(this);
- private final InductionBuffer _clientBuffer = new InductionBuffer(this);
- private final GroupManager _groupMgr;
- private final ServerHandlerRegistry _handlers;
-
- public ClusteredProtocolHandler(InetSocketAddress address)
- {
- this(ApplicationRegistry.getInstance(), address);
- }
-
- public ClusteredProtocolHandler(IApplicationRegistry registry, InetSocketAddress address)
- {
- super(registry);
- ClusterBuilder builder = new ClusterBuilder(address);
- _groupMgr = builder.getGroupManager();
- _handlers = builder.getHandlerRegistry();
- }
-
- public ClusteredProtocolHandler(ClusteredProtocolHandler handler)
- {
- super(handler);
- _groupMgr = handler._groupMgr;
- _handlers = handler._handlers;
- }
-
- protected void createSession(IoSession session, VirtualHostRegistry virtualHostRegistry, AMQProtocolSession protocolSession, AMQCodecFactory codec) throws AMQException
- {
- new ClusteredProtocolSession(session, virtualHostRegistry, codec, new ServerHandlerRegistry(_handlers, virtualHostRegistry, protocolSession));
- }
-
- void connect(String join) throws Exception
- {
- if (join == null)
- {
- _groupMgr.establish();
- }
- else
- {
- _groupMgr.join(new SimpleMemberHandle(join));
- }
- }
-
- private boolean inState(JoinState state)
- {
- return _groupMgr.getState().equals(state);
- }
-
- public void messageReceived(IoSession session, Object msg) throws Exception
- {
- JoinState state = _groupMgr.getState();
- switch (state)
- {
- case JOINED:
- _logger.debug(new LogMessage("Received {0}", msg));
- super.messageReceived(session, msg);
- break;
- case JOINING:
- case INITIATION:
- case INDUCTION:
- buffer(session, msg);
- break;
- default:
- throw new AMQException("Received message while in state: " + state);
- }
- JoinState latest = _groupMgr.getState();
- if (!latest.equals(state))
- {
- switch (latest)
- {
- case INDUCTION:
- _logger.info("Reached induction, delivering buffered message from peers");
- _peerBuffer.deliver();
- break;
- case JOINED:
- _logger.info("Reached joined, delivering buffered message from clients");
- _clientBuffer.deliver();
- break;
- }
- }
- }
-
- private void buffer(IoSession session, Object msg) throws Exception
- {
- if (isBufferable(msg))
- {
- MemberHandle peer = ClusteredProtocolSession.getSessionPeer(session);
- if (peer == null)
- {
- _logger.debug(new LogMessage("Buffering {0} for client", msg));
- _clientBuffer.receive(session, msg);
- }
- else if (inState(JoinState.JOINING) && isMembershipAnnouncement(msg))
- {
- _logger.debug(new LogMessage("Initial membership [{0}] received from {1}", msg, peer));
- super.messageReceived(session, msg);
- }
- else if (inState(JoinState.INITIATION) && _groupMgr.isLeader(peer))
- {
- _logger.debug(new LogMessage("Replaying {0} from leader ", msg));
- super.messageReceived(session, msg);
- }
- else if (inState(JoinState.INDUCTION))
- {
- _logger.debug(new LogMessage("Replaying {0} from peer {1}", msg, peer));
- super.messageReceived(session, msg);
- }
- else
- {
- _logger.debug(new LogMessage("Buffering {0} for peer {1}", msg, peer));
- _peerBuffer.receive(session, msg);
- }
- }
- else
- {
- _logger.debug(new LogMessage("Received {0}", msg));
- super.messageReceived(session, msg);
- }
- }
-
- public void deliver(IoSession session, Object msg) throws Exception
- {
- _logger.debug(new LogMessage("Delivering {0}", msg));
- super.messageReceived(session, msg);
- }
-
- private boolean isMembershipAnnouncement(Object msg)
- {
- return msg instanceof AMQFrame && (((AMQFrame) msg).getBodyFrame() instanceof ClusterMembershipBody);
- }
-
- private boolean isBufferable(Object msg)
- {
- return msg instanceof AMQFrame && isBuffereable(((AMQFrame) msg).getBodyFrame());
- }
-
- private boolean isBuffereable(AMQBody body)
- {
- return !(body instanceof ConnectionStartOkBody ||
- body instanceof ConnectionTuneOkBody ||
- body instanceof ConnectionSecureOkBody ||
- body instanceof ConnectionOpenBody);
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusteredProtocolSession.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusteredProtocolSession.java
deleted file mode 100644
index eea660c4f0..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ClusteredProtocolSession.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.server.cluster;
-
-import org.apache.mina.common.IoSession;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.protocol.AMQMinaProtocolSession;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.AMQMessage;
-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.state.AMQStateManager;
-
-public class ClusteredProtocolSession extends AMQMinaProtocolSession
-{
- private MemberHandle _peer;
-
- public ClusteredProtocolSession(IoSession session, VirtualHostRegistry virtualHostRegistry, AMQCodecFactory codecFactory, AMQStateManager stateManager) throws AMQException
-// public ClusteredProtocolSession(IoSession session, QueueRegistry queueRegistry,
-// ExchangeRegistry exchangeRegistry, AMQCodecFactory codecFactory) throws AMQException
- {
- super(session, virtualHostRegistry, codecFactory, stateManager);
-// super(session, queueRegistry, exchangeRegistry, codecFactory);
- }
-
- public boolean isPeerSession()
- {
- return _peer != null;
- }
-
- public void setSessionPeer(MemberHandle peer)
- {
- _peer = peer;
- }
-
- public MemberHandle getSessionPeer()
- {
- return _peer;
- }
-
- public AMQChannel getChannel(int channelId)
- throws AMQException
- {
- AMQChannel channel = super.getChannel(channelId);
- if (isPeerSession() && channel == null)
- {
- channel = new OneUseChannel(channelId, getVirtualHost());
- addChannel(channel);
- }
- return channel;
- }
-
- public static boolean isPeerSession(IoSession session)
- {
- return isPeerSession(getAMQProtocolSession(session));
- }
-
- public static boolean isPeerSession(AMQProtocolSession session)
- {
- return session instanceof ClusteredProtocolSession && ((ClusteredProtocolSession) session).isPeerSession();
- }
-
- public static void setSessionPeer(AMQProtocolSession session, MemberHandle peer)
- {
- ((ClusteredProtocolSession) session).setSessionPeer(peer);
- }
-
- public static MemberHandle getSessionPeer(AMQProtocolSession session)
- {
- return ((ClusteredProtocolSession) session).getSessionPeer();
- }
-
- public static MemberHandle getSessionPeer(IoSession session)
- {
- return getSessionPeer(getAMQProtocolSession(session));
- }
-
- /**
- * Cleans itself up after delivery of a message (publish frame, header and optional body frame(s))
- */
- private class OneUseChannel extends AMQChannel
- {
- public OneUseChannel(int channelId, VirtualHost virtualHost)
- throws AMQException
- {
- super(ClusteredProtocolSession.this,channelId,
- virtualHost.getMessageStore(),
- virtualHost.getExchangeRegistry());
- }
-
- protected void routeCurrentMessage() throws AMQException
- {
- super.routeCurrentMessage();
- removeChannel(getChannelId());
- }
- }
-
- public static boolean isPayloadFromPeer(AMQMessage payload)
- {
- return isPeerSession(payload.getPublisher());
- }
-
- public static boolean canRelay(AMQMessage payload, MemberHandle target)
- {
- //can only relay client messages that have not already been relayed to the given target
- return !isPayloadFromPeer(payload) && !payload.checkToken(target);
- }
-
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ConnectionStatusMonitor.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ConnectionStatusMonitor.java
deleted file mode 100644
index a1f01eff46..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ConnectionStatusMonitor.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.server.cluster;
-
-import java.io.IOException;
-
-class ConnectionStatusMonitor
-{
- private boolean _complete;
- private boolean _redirected;
- private String _host;
- private int _port;
- private RuntimeException _error;
-
- synchronized void opened()
- {
- _complete = true;
- notifyAll();
- }
-
- synchronized void redirect(String host, int port)
- {
- _complete = true;
- _redirected = true;
- this._host = host;
- this._port = port;
- }
-
- synchronized void failed(RuntimeException e)
- {
- _error = e;
- _complete = true;
- }
-
- synchronized boolean waitUntilOpen() throws InterruptedException
- {
- while (!_complete)
- {
- wait();
- }
- if (_error != null)
- {
- throw _error;
- }
- return !_redirected;
- }
-
- synchronized boolean isOpened()
- {
- return _complete;
- }
-
- String getHost()
- {
- return _host;
- }
-
- int getPort()
- {
- return _port;
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/DefaultGroupManager.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/DefaultGroupManager.java
deleted file mode 100644
index 2f473b63fb..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/DefaultGroupManager.java
+++ /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.
- *
- */
-package org.apache.qpid.server.cluster;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.server.cluster.policy.StandardPolicies;
-import org.apache.qpid.server.cluster.replay.ReplayManager;
-import org.apache.qpid.server.cluster.util.LogMessage;
-
-import java.util.List;
-
-public class DefaultGroupManager implements GroupManager, MemberFailureListener, BrokerFactory, StandardPolicies
-{
- private static final Logger _logger = Logger.getLogger(DefaultGroupManager.class);
- private final LoadTable _loadTable;
- private final BrokerFactory _factory;
- private final ReplayManager _replayMgr;
- private final BrokerGroup _group;
-
- DefaultGroupManager(MemberHandle handle, BrokerFactory factory, ReplayManager replayMgr)
- {
- this(handle, factory, replayMgr, new LoadTable());
- }
-
- DefaultGroupManager(MemberHandle handle, BrokerFactory factory, ReplayManager replayMgr, LoadTable loadTable)
- {
- handle = SimpleMemberHandle.resolve(handle);
- _logger.info(handle);
- _loadTable = loadTable;
- _factory = factory;
- _replayMgr = replayMgr;
- _group = new BrokerGroup(handle, _replayMgr, this);
- }
-
- public JoinState getState()
- {
- return _group.getState();
- }
-
- public void addMemberhipChangeListener(MembershipChangeListener l)
- {
- _group.addMemberhipChangeListener(l);
- }
-
- public void removeMemberhipChangeListener(MembershipChangeListener l)
- {
- _group.removeMemberhipChangeListener(l);
- }
-
- public void broadcast(Sendable message) throws AMQException
- {
- for (Broker b : _group.getPeers())
- {
- b.send(message, null);
- }
- }
-
- public void broadcast(Sendable message, BroadcastPolicy policy, GroupResponseHandler callback) throws AMQException
- {
- GroupRequest request = new GroupRequest(message, policy, callback);
- for (Broker b : _group.getPeers())
- {
- b.invoke(request);
- }
- request.finishedSend();
- }
-
- public void send(MemberHandle broker, Sendable message) throws AMQException
- {
- Broker destination = findBroker(broker);
- if(destination == null)
- {
- _logger.warn(new LogMessage("Invalid destination sending {0}. {1} not known", message, broker));
- }
- else
- {
- destination.send(message, null);
- _logger.debug(new LogMessage("Sent {0} to {1}", message, broker));
- }
- }
-
- private void send(Broker broker, Sendable message, ResponseHandler handler) throws AMQException
- {
- broker.send(message, handler);
- }
-
- private void ping(Broker b) throws AMQException
- {
- // 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.
- ClusterPingBody ping = new ClusterPingBody((byte)8,
- (byte)0,
- ClusterPingBody.getClazz((byte)8, (byte)0),
- ClusterPingBody.getMethod((byte)8, (byte)0),
- _group.getLocal().getDetails(),
- _loadTable.getLocalLoad(),
- true);
- BlockingHandler handler = new BlockingHandler();
- send(getLeader(), new SimpleBodySendable(ping), handler);
- handler.waitForCompletion();
- if (handler.failed())
- {
- if (isLeader())
- {
- handleFailure(b);
- }
- else
- {
- suspect(b);
- }
- }
- else
- {
- _loadTable.setLoad(b, ((ClusterPingBody) handler.getResponse()).load);
- }
- }
-
- public void handlePing(MemberHandle member, long load)
- {
- _loadTable.setLoad(findBroker(member), load);
- }
-
- public Member redirect()
- {
- return _loadTable.redirect();
- }
-
- public void establish()
- {
- _group.establish();
- _logger.info("Established cluster");
- }
-
- public void join(MemberHandle member) throws AMQException
- {
- member = SimpleMemberHandle.resolve(member);
-
- Broker leader = connectToLeader(member);
- _logger.info(new LogMessage("Connected to {0}. joining", leader));
- // 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.
- ClusterJoinBody join = new ClusterJoinBody((byte)8,
- (byte)0,
- ClusterJoinBody.getClazz((byte)8, (byte)0),
- ClusterJoinBody.getMethod((byte)8, (byte)0),
- _group.getLocal().getDetails());
-
- send(leader, new SimpleBodySendable(join));
- }
-
- private Broker connectToLeader(MemberHandle member) throws AMQException
- {
- try
- {
- return _group.connectToLeader(member);
- }
- catch (Exception e)
- {
- throw new AMQException("Could not connect to leader: " + e, e);
- }
- }
-
- public void leave() throws AMQException
- {
- // 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.
- ClusterLeaveBody leave = new ClusterLeaveBody((byte)8,
- (byte)0,
- ClusterLeaveBody.getClazz((byte)8, (byte)0),
- ClusterLeaveBody.getMethod((byte)8, (byte)0),
- _group.getLocal().getDetails());
-
- send(getLeader(), new SimpleBodySendable(leave));
- }
-
- private void suspect(MemberHandle broker) throws AMQException
- {
- if (_group.isLeader(broker))
- {
- //need new leader, if this broker is next in line it can assume leadership
- if (_group.assumeLeadership())
- {
- announceMembership();
- }
- else
- {
- _logger.warn(new LogMessage("Leader failed. Expecting {0} to succeed.", _group.getMembers().get(1)));
- }
- }
- else
- {
- // 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.
- ClusterSuspectBody suspect = new ClusterSuspectBody((byte)8,
- (byte)0,
- ClusterSuspectBody.getClazz((byte)8, (byte)0),
- ClusterSuspectBody.getMethod((byte)8, (byte)0),
- broker.getDetails());
-
- send(getLeader(), new SimpleBodySendable(suspect));
- }
- }
-
-
- public void handleJoin(MemberHandle member) throws AMQException
- {
- _logger.info(new LogMessage("Handling join request for {0}", member));
- if(isLeader())
- {
- //connect to the host and port specified:
- Broker prospect = connectToProspect(member);
- announceMembership();
- List<AMQMethodBody> msgs = _replayMgr.replay(true);
- _logger.info(new LogMessage("Replaying {0} from leader to {1}", msgs, prospect));
- prospect.replay(msgs);
- }
- else
- {
- //pass request on to leader:
- // 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.
- ClusterJoinBody request = new ClusterJoinBody((byte)8, (byte)0,
- ClusterJoinBody.getClazz((byte)8, (byte)0),
- ClusterJoinBody.getMethod((byte)8, (byte)0),
- member.getDetails());
-
- Broker leader = getLeader();
- send(leader, new SimpleBodySendable(request));
- _logger.info(new LogMessage("Passed join request for {0} to {1}", member, leader));
- }
- }
-
- private Broker connectToProspect(MemberHandle member) throws AMQException
- {
- try
- {
- return _group.connectToProspect(member);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- throw new AMQException("Could not connect to prospect: " + e, e);
- }
- }
-
- public void handleLeave(MemberHandle member) throws AMQException
- {
- handleFailure(findBroker(member));
- announceMembership();
- }
-
- public void handleSuspect(MemberHandle member) throws AMQException
- {
- Broker b = findBroker(member);
- if(b != null)
- {
- //ping it to check it has failed, ping will handle failure if it has
- ping(b);
- announceMembership();
- }
- }
-
- public void handleSynch(MemberHandle member)
- {
- _group.synched(member);
- }
-
- private ClusterMembershipBody createAnnouncement(String membership)
- {
- // 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.
- ClusterMembershipBody announce = new ClusterMembershipBody((byte)8, (byte)0,
- ClusterMembershipBody.getClazz((byte)8, (byte)0),
- ClusterMembershipBody.getMethod((byte)8, (byte)0),
- membership.getBytes());
-
-
- return announce;
- }
-
- private void announceMembership() throws AMQException
- {
- String membership = SimpleMemberHandle.membersToString(_group.getMembers());
- ClusterMembershipBody announce = createAnnouncement(membership);
- broadcast(new SimpleBodySendable(announce));
- _logger.info(new LogMessage("Membership announcement sent: {0}", membership));
- }
-
- private void handleFailure(Broker peer)
- {
- peer.remove();
- _group.remove(peer);
- }
-
- public void handleMembershipAnnouncement(String membership) throws AMQException
- {
- _group.setMembers(SimpleMemberHandle.stringToMembers(membership));
- _logger.info(new LogMessage("Membership announcement received: {0}", membership));
- }
-
- public boolean isLeader()
- {
- return _group.isLeader();
- }
-
- public boolean isLeader(MemberHandle handle)
- {
- return _group.isLeader(handle);
- }
-
- public Broker getLeader()
- {
- return _group.getLeader();
- }
-
- private Broker findBroker(MemberHandle handle)
- {
- return _group.findBroker(handle, false);
- }
-
- public Member getMember(MemberHandle handle)
- {
- return findBroker(handle);
- }
-
- public boolean isMember(MemberHandle member)
- {
- for (MemberHandle handle : _group.getMembers())
- {
- if (handle.matches(member))
- {
- return true;
- }
- }
- return false;
- }
-
- public MemberHandle getLocal()
- {
- return _group.getLocal();
- }
-
- public void failed(MemberHandle member)
- {
- if (isLeader())
- {
- handleFailure(findBroker(member));
- try
- {
- announceMembership();
- }
- catch (AMQException e)
- {
- _logger.error("Error announcing failure: " + e, e);
- }
- }
- else
- {
- try
- {
- suspect(member);
- }
- catch (AMQException e)
- {
- _logger.error("Error sending suspect: " + e, e);
- }
- }
- }
-
- public Broker create(MemberHandle handle)
- {
- Broker broker = _factory.create(handle);
- broker.addFailureListener(this);
- return broker;
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/GroupManager.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/GroupManager.java
deleted file mode 100644
index 5599ae4b1f..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/GroupManager.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.cluster;
-
-import org.apache.qpid.AMQException;
-
-public interface GroupManager
-{
- /**
- * Establish a new cluster with the local member as the leader.
- */
- public void establish();
-
- /**
- * Join the cluster to which member belongs
- */
- public void join(MemberHandle member) throws AMQException;
-
- public void broadcast(Sendable message) throws AMQException;
-
- public void broadcast(Sendable message, BroadcastPolicy policy, GroupResponseHandler callback) throws AMQException;
-
- public void send(MemberHandle broker, Sendable message) throws AMQException;
-
- public void leave() throws AMQException;
-
- public void handleJoin(MemberHandle member) throws AMQException;
-
- public void handleLeave(MemberHandle member) throws AMQException;
-
- public void handleSuspect(MemberHandle member) throws AMQException;
-
- public void handlePing(MemberHandle member, long load);
-
- public void handleMembershipAnnouncement(String membership) throws AMQException;
-
- public void handleSynch(MemberHandle member);
-
- public boolean isLeader();
-
- public boolean isLeader(MemberHandle handle);
-
- public boolean isMember(MemberHandle member);
-
- public MemberHandle redirect();
-
- public MemberHandle getLocal();
-
- public JoinState getState();
-
- public void addMemberhipChangeListener(MembershipChangeListener l);
-
- public void removeMemberhipChangeListener(MembershipChangeListener l);
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/GroupRequest.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/GroupRequest.java
deleted file mode 100644
index 8ab7856e87..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/GroupRequest.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.server.cluster;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * Represents a method sent to a group of Member instances. Manages the responses,
- * completion and callback.
- *
- */
-class GroupRequest
-{
- private final Map<Member, AMQMethodBody> _responses = new HashMap<Member, AMQMethodBody>();
- private final List<Member> _brokers = new ArrayList<Member>();
- private boolean _sent;
-
- private final Sendable _request;
- private final BroadcastPolicy _policy;
- private final GroupResponseHandler _callback;
-
- GroupRequest(Sendable request, BroadcastPolicy policy, GroupResponseHandler callback)
- {
- _request = request;
- _policy = policy;
- _callback = callback;
- }
-
- void send(int channel, Member session) throws AMQException
- {
- _brokers.add(session);
- _request.send(channel, session);
- }
-
- boolean finishedSend()
- {
- _sent = true;
- return checkCompletion();
- }
-
- public boolean responseReceived(Member broker, AMQMethodBody response)
- {
- _responses.put(broker, response);
- return checkCompletion();
- }
-
- public boolean removed(Member broker)
- {
- _brokers.remove(broker);
- return checkCompletion();
- }
-
- private synchronized boolean checkCompletion()
- {
- return isComplete() && callback();
- }
-
- boolean isComplete()
- {
- return _sent && _policy != null && _policy.isComplete(_responses.size(), _brokers.size());
- }
-
- boolean callback()
- {
- _callback.response(getResults(), _brokers);
- return true;
- }
-
- List<AMQMethodBody> getResults()
- {
- List<AMQMethodBody> results = new ArrayList<AMQMethodBody>(_brokers.size());
- for (Member b : _brokers)
- {
- results.add(_responses.get(b));
- }
- return results;
- }
-
- public String toString()
- {
- return "GroupRequest{request=" + _request +", brokers=" + _brokers + ", responses=" + _responses + "}";
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/GroupResponseHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/GroupResponseHandler.java
deleted file mode 100644
index d2e9de2f39..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/GroupResponseHandler.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.server.cluster;
-
-import org.apache.qpid.framing.AMQMethodBody;
-
-import java.util.List;
-
-public interface GroupResponseHandler
-{
- //Note: this implies that the response to a group request will always be a method body...
- public void response(List<AMQMethodBody> responses, List<Member> members);
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/InductionBuffer.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/InductionBuffer.java
deleted file mode 100644
index 586d7d4ae8..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/InductionBuffer.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.server.cluster;
-
-import org.apache.mina.common.IoSession;
-
-import java.util.LinkedList;
-import java.util.Queue;
-
-/**
- * Buffers any received messages until join completes.
- *
- */
-class InductionBuffer
-{
- private final Queue<Message> _buffer = new LinkedList<Message>();
- private final MessageHandler _handler;
- private boolean _buffering = true;
-
- InductionBuffer(MessageHandler handler)
- {
- _handler = handler;
- }
-
- private void process() throws Exception
- {
- for (Message o = _buffer.poll(); o != null; o = _buffer.poll())
- {
- o.deliver(_handler);
- }
- _buffering = false;
- }
-
- synchronized void deliver() throws Exception
- {
- process();
- }
-
- synchronized void receive(IoSession session, Object msg) throws Exception
- {
- if (_buffering)
- {
- _buffer.offer(new Message(session, msg));
- }
- else
- {
- _handler.deliver(session, msg);
- }
- }
-
- private static class Message
- {
- private final IoSession _session;
- private final Object _msg;
-
- Message(IoSession session, Object msg)
- {
- _session = session;
- _msg = msg;
- }
-
- void deliver(MessageHandler handler) throws Exception
- {
- handler.deliver(_session, _msg);
- }
- }
-
- static interface MessageHandler
- {
- public void deliver(IoSession session, Object msg) throws Exception;
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/JoinState.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/JoinState.java
deleted file mode 100644
index 5f92aa2971..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/JoinState.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.cluster;
-
-public enum JoinState
-{
- UNINITIALISED, JOINING, INITIATION, INDUCTION, JOINED
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/LoadTable.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/LoadTable.java
deleted file mode 100644
index 13465a8615..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/LoadTable.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.server.cluster;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.PriorityQueue;
-
-/**
- * Maintains loading information about the local member and its cluster peers.
- *
- */
-public class LoadTable
-{
- private final Map<MemberHandle, Loading> _peers = new HashMap<MemberHandle, Loading>();
- private final PriorityQueue<Loading> _loads = new PriorityQueue<Loading>();
- private final Loading _local = new Loading(null);
-
- public LoadTable()
- {
- _loads.add(_local);
- }
-
- public void setLoad(Member member, long load)
- {
- synchronized (_peers)
- {
- Loading loading = _peers.get(member);
- if (loading == null)
- {
- loading = new Loading(member);
- synchronized (_loads)
- {
- _loads.add(loading);
- }
- _peers.put(member, loading);
- }
- loading.load = load;
- }
- }
-
- public void incrementLocalLoad()
- {
- synchronized (_local)
- {
- _local.load++;
- }
- }
-
- public void decrementLocalLoad()
- {
- synchronized (_local)
- {
- _local.load--;
- }
- }
-
- public long getLocalLoad()
- {
- synchronized (_local)
- {
- return _local.load;
- }
- }
-
- public Member redirect()
- {
- synchronized (_loads)
- {
- return _loads.peek().member;
- }
- }
-
- private static class Loading implements Comparable
- {
- private final Member member;
- private long load;
-
- Loading(Member member)
- {
- this.member = member;
- }
-
- public int compareTo(Object o)
- {
- return (int) (load - ((Loading) o).load);
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Main.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Main.java
deleted file mode 100644
index 15752353d1..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Main.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.server.cluster;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-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.log4j.Logger;
-import org.apache.mina.common.IoAcceptor;
-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 org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.ConfigurationFileApplicationRegistry;
-import org.apache.qpid.server.transport.ConnectorConfiguration;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-
-/**
- * TODO: This is a cut-and-paste from the original broker Main class. Would be preferrable to make that class more
- * reuseable to avoid all this duplication.
- */
-public class Main extends org.apache.qpid.server.Main
-{
- private static final Logger _logger = Logger.getLogger(Main.class);
-
- protected Main(String[] args)
- {
- super(args);
- }
-
- protected void setOptions(Options otions)
- {
- super.setOptions(options);
-
- //extensions:
- Option join = OptionBuilder.withArgName("join").hasArg().withDescription("Join the specified cluster member. Overrides any value in the config file").
- withLongOpt("join").create("j");
- options.addOption(join);
- }
-
- protected void bind(int port, ConnectorConfiguration connectorConfig)
- {
- try
- {
- IoAcceptor acceptor = new SocketAcceptor();
- SocketAcceptorConfig sconfig = (SocketAcceptorConfig) acceptor.getDefaultConfig();
- SocketSessionConfig sc = (SocketSessionConfig) sconfig.getSessionConfig();
-
- sc.setReceiveBufferSize(connectorConfig.socketReceiveBufferSize);
- sc.setSendBufferSize(connectorConfig.socketWriteBuferSize);
- sc.setTcpNoDelay(true);
-
- // 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());
- }
-
- String host = InetAddress.getLocalHost().getHostName();
- ClusteredProtocolHandler handler = new ClusteredProtocolHandler(new InetSocketAddress(host, port));
- if (!connectorConfig.enableSSL)
- {
- acceptor.bind(new InetSocketAddress(port), handler, sconfig);
- _logger.info("Qpid.AMQP listening on non-SSL port " + port);
- handler.connect(commandLine.getOptionValue("j"));
- }
- else
- {
- ClusteredProtocolHandler sslHandler = new ClusteredProtocolHandler(handler);
- acceptor.bind(new InetSocketAddress(connectorConfig.sslPort), sslHandler, sconfig);
- _logger.info("Qpid.AMQP listening on SSL port " + connectorConfig.sslPort);
- }
- }
- catch (IOException e)
- {
- _logger.error("Unable to bind service to registry: " + e, e);
- }
- catch (Exception e)
- {
- _logger.error("Unable to connect to cluster: " + e, e);
- }
- }
-
- public static void main(String[] args)
- {
- new Main(args);
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Member.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Member.java
deleted file mode 100644
index 3fbdfdde70..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Member.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.server.cluster;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQDataBlock;
-
-public interface Member extends MemberHandle
-{
- public void send(AMQDataBlock data) throws AMQException;
-
- public void addFailureListener(MemberFailureListener listener);
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MemberFailureListener.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MemberFailureListener.java
deleted file mode 100644
index 7ce45dffaa..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MemberFailureListener.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.cluster;
-
-interface MemberFailureListener
-{
- public void failed(MemberHandle member);
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MemberHandle.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MemberHandle.java
deleted file mode 100644
index b8099a12f7..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MemberHandle.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.cluster;
-
-import org.apache.qpid.framing.AMQShortString;
-
-public interface MemberHandle
-{
- public String getHost();
-
- public int getPort();
-
- public boolean matches(MemberHandle m);
-
- public boolean matches(String host, int port);
-
- public AMQShortString getDetails();
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MembershipChangeListener.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MembershipChangeListener.java
deleted file mode 100644
index 591e652e32..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MembershipChangeListener.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.cluster;
-
-import java.util.List;
-
-public interface MembershipChangeListener
-{
- public void changed(List<MemberHandle> members);
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MethodHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MethodHandler.java
deleted file mode 100644
index a83f034021..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MethodHandler.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.cluster;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-
-interface MethodHandler
-{
- public void handle(int channel, AMQMethodBody method) throws AMQException;
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MethodHandlerFactory.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MethodHandlerFactory.java
deleted file mode 100644
index 9bf04f5458..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MethodHandlerFactory.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.cluster;
-
-import org.apache.qpid.server.state.AMQState;
-
-public interface MethodHandlerFactory
-{
- public MethodHandlerRegistry register(AMQState state, MethodHandlerRegistry registry);
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MethodHandlerRegistry.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MethodHandlerRegistry.java
deleted file mode 100644
index 748a660bb8..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MethodHandlerRegistry.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.cluster;
-
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class MethodHandlerRegistry
-{
- private final Map<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>> registry =
- new HashMap<Class<? extends AMQMethodBody>, StateAwareMethodListener<? extends AMQMethodBody>>();
-
- public <A extends AMQMethodBody, B extends Class<A>> MethodHandlerRegistry addHandler(B type, StateAwareMethodListener<A> handler)
- {
- registry.put(type, handler);
- return this;
- }
-
- public <B extends AMQMethodBody> StateAwareMethodListener<B> getHandler(B frame)
- {
- return (StateAwareMethodListener<B>) registry.get(frame.getClass());
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MinaBrokerProxy.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MinaBrokerProxy.java
deleted file mode 100644
index b01ec491ec..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MinaBrokerProxy.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.server.cluster;
-
-import org.apache.log4j.Logger;
-import org.apache.mina.common.ConnectFuture;
-import org.apache.mina.common.IoHandlerAdapter;
-import org.apache.mina.common.IoSession;
-import org.apache.mina.common.RuntimeIOException;
-import org.apache.mina.filter.codec.ProtocolCodecFilter;
-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 org.apache.qpid.AMQException;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.qpid.client.state.AMQState;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.framing.AMQBody;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.ConnectionRedirectBody;
-import org.apache.qpid.framing.ProtocolInitiation;
-import org.apache.qpid.framing.ProtocolVersion;
-
-import java.io.IOException;
-import java.net.InetSocketAddress;
-
-/**
- * A 'client stub' for a remote cluster peer, using MINA for IO Layer
- *
- */
-public class MinaBrokerProxy extends Broker implements MethodHandler
-{
- private static final Logger _logger = Logger.getLogger(MinaBrokerProxy.class);
- private final ConnectionStatusMonitor _connectionMonitor = new ConnectionStatusMonitor();
- private final ClientHandlerRegistry _legacyHandler;
- private final MinaBinding _binding = new MinaBinding();
- private final MemberHandle _local;
- private IoSession _session;
- private MethodHandler _handler;
- private Iterable<AMQMethodBody> _replay;
-
- MinaBrokerProxy(String host, int port, MemberHandle local)
- {
- super(host, port);
- _local = local;
- _legacyHandler = new ClientHandlerRegistry(local, null);
- }
-
- private void init(IoSession session)
- {
- _session = session;
- _handler = new ClientAdapter(session, _legacyHandler);
- }
-
- private ConnectFuture connectImpl()
- {
- _logger.info("Connecting to cluster peer: " + getDetails());
- SocketConnector ioConnector = new SocketConnector();
- SocketConnectorConfig cfg = (SocketConnectorConfig) ioConnector.getDefaultConfig();
-
- SocketSessionConfig scfg = (SocketSessionConfig) cfg.getSessionConfig();
- scfg.setTcpNoDelay(true);
- scfg.setSendBufferSize(32768);
- scfg.setReceiveBufferSize(32768);
- InetSocketAddress address = new InetSocketAddress(getHost(), getPort());
- return ioConnector.connect(address, _binding);
- }
-
- //extablish connection without handling redirect
- boolean connect() throws IOException, InterruptedException
- {
- ConnectFuture future = connectImpl();
- // wait for connection to complete
- future.join();
- // we call getSession which throws an IOException if there has been an error connecting
- try
- {
- future.getSession();
- }
- catch (RuntimeIOException e)
- {
- _connectionMonitor.failed(e);
- _logger.error(new LogMessage("Could not connect to {0}: {1}", this, e), e);
- throw e;
- }
- return _connectionMonitor.waitUntilOpen();
- }
-
- void connectAsynch(Iterable<AMQMethodBody> msgs)
- {
- _replay = msgs;
- connectImpl();
- }
-
- void replay(Iterable<AMQMethodBody> msgs)
- {
- _replay = msgs;
- if(_connectionMonitor.isOpened())
- {
- replay();
- }
- }
-
- //establish connection, handling redirect if required...
- Broker connectToCluster() throws IOException, InterruptedException
- {
- connect();
- //wait until the connection is open or get a redirection
- if (_connectionMonitor.waitUntilOpen())
- {
- return this;
- }
- else
- {
- Broker broker = new MinaBrokerProxy(_connectionMonitor.getHost(), _connectionMonitor.getPort(), _local);
- broker.connect();
- return broker;
- }
- }
-
- public void send(AMQDataBlock data) throws AMQConnectionWaitException
- {
- if (_session == null)
- {
- try
- {
- _connectionMonitor.waitUntilOpen();
- }
- catch (InterruptedException e)
- {
- throw new AMQConnectionWaitException("Failed to send " + data + ": " + e, e);
- }
- }
- _session.write(data);
- }
-
- private void replay()
- {
- if(_replay != null)
- {
- for(AMQMethodBody b : _replay)
- {
- _session.write(new AMQFrame(0, b));
- }
- }
- }
-
- public void handle(int channel, AMQMethodBody method) throws AMQException
- {
- _logger.info(new LogMessage("Handling method: {0} for channel {1}", method, channel));
- if (!handleResponse(channel, method))
- {
- _logger.warn(new LogMessage("Unhandled method: {0} for channel {1}", method, channel));
- }
- }
-
- private void handleMethod(int channel, AMQMethodBody method) throws AMQException
- {
- if (method instanceof ConnectionRedirectBody)
- {
- //signal redirection to waiting thread
- ConnectionRedirectBody redirect = (ConnectionRedirectBody) method;
- String[] parts = redirect.host.toString().split(":");
- _connectionMonitor.redirect(parts[0], Integer.parseInt(parts[1]));
- }
- else
- {
- _handler.handle(channel, method);
- if (AMQState.CONNECTION_OPEN.equals(_legacyHandler.getCurrentState()) && _handler != this)
- {
- _handler = this;
- _logger.info(new LogMessage("Connection opened, handler switched"));
- //replay any messages:
- replay();
- //signal waiting thread:
- _connectionMonitor.opened();
- }
- }
- }
-
- private void handleFrame(AMQFrame frame) throws AMQException
- {
- AMQBody body = frame.getBodyFrame();
- if (body instanceof AMQMethodBody)
- {
- handleMethod(frame.getChannel(), (AMQMethodBody) body);
- }
- else
- {
- throw new AMQUnexpectedBodyTypeException(AMQMethodBody.class, body);
- }
- }
-
- public String toString()
- {
- return "MinaBrokerProxy[" + (_session == null ? super.toString() : _session.getRemoteAddress()) + "]";
- }
-
- private class MinaBinding extends IoHandlerAdapter
- {
- public void sessionCreated(IoSession session) throws Exception
- {
- init(session);
- _logger.info(new LogMessage("{0}: created", MinaBrokerProxy.this));
- ProtocolCodecFilter pcf = new ProtocolCodecFilter(new AMQCodecFactory(false));
- session.getFilterChain().addLast("protocolFilter", pcf);
-
- /* 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. */
-
- session.write(new ProtocolInitiation(ProtocolVersion.getLatestSupportedVersion()));
- }
-
- public void sessionOpened(IoSession session) throws Exception
- {
- _logger.info(new LogMessage("{0}: opened", MinaBrokerProxy.this));
- }
-
- public void sessionClosed(IoSession session) throws Exception
- {
- _logger.info(new LogMessage("{0}: closed", MinaBrokerProxy.this));
- }
-
- public void exceptionCaught(IoSession session, Throwable throwable) throws Exception
- {
- _logger.error(new LogMessage("{0}: received {1}", MinaBrokerProxy.this, throwable), throwable);
- if (! (throwable instanceof IOException))
- {
- _session.close();
- }
- failed();
- }
-
- public void messageReceived(IoSession session, Object object) throws Exception
- {
- if (object instanceof AMQFrame)
- {
- handleFrame((AMQFrame) object);
- }
- else
- {
- throw new AMQUnexpectedFrameTypeException("Received message of unrecognised type: " + object);
- }
- }
-
- public void messageSent(IoSession session, Object object) throws Exception
- {
- _logger.debug(new LogMessage("{0}: sent {1}", MinaBrokerProxy.this, object));
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MinaBrokerProxyFactory.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MinaBrokerProxyFactory.java
deleted file mode 100644
index 5e70de7665..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/MinaBrokerProxyFactory.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.cluster;
-
-public class MinaBrokerProxyFactory implements BrokerFactory
-{
- private final MemberHandle _local;
-
- MinaBrokerProxyFactory(MemberHandle local)
- {
- _local = local;
- }
-
- public Broker create(MemberHandle handle)
- {
- return new MinaBrokerProxy(handle.getHost(), handle.getPort(), _local);
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ResponseHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ResponseHandler.java
deleted file mode 100644
index fe76ca6505..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ResponseHandler.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.cluster;
-
-import org.apache.qpid.framing.AMQMethodBody;
-
-public interface ResponseHandler
-{
- public void responded(AMQMethodBody response);
-
- public void removed();
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Sendable.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Sendable.java
deleted file mode 100644
index 159612331c..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/Sendable.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.cluster;
-
-import org.apache.qpid.AMQException;
-
-public interface Sendable
-{
- public void send(int channel, Member member) throws AMQException;
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.java
deleted file mode 100644
index aadcfa4b4c..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/ServerHandlerRegistry.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.cluster;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.state.AMQState;
-import org.apache.qpid.server.state.AMQStateManager;
-//import org.apache.qpid.server.state.IllegalStateTransitionException;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * An extension of server.AMQStateManager that allows different handlers to be registered.
- *
- */
-class ServerHandlerRegistry extends AMQStateManager
-{
- private final Logger _logger = Logger.getLogger(ServerHandlerRegistry.class);
- private final Map<AMQState, MethodHandlerRegistry> _handlers = new HashMap<AMQState, MethodHandlerRegistry>();
-
- ServerHandlerRegistry(VirtualHostRegistry virtualHostRegistry, AMQProtocolSession protocolSession)
- {
- super(AMQState.CONNECTION_NOT_STARTED, false, virtualHostRegistry, protocolSession);
- }
-
- ServerHandlerRegistry(ServerHandlerRegistry s, VirtualHostRegistry virtualHostRegistry, AMQProtocolSession protocolSession)
- {
- this(virtualHostRegistry, protocolSession);
- _handlers.putAll(s._handlers);
- }
-
- ServerHandlerRegistry(MethodHandlerFactory factory, VirtualHostRegistry virtualHostRegistry, AMQProtocolSession protocolSession)
- {
- this(virtualHostRegistry, protocolSession);
- init(factory);
- }
-
- void setHandlers(AMQState state, MethodHandlerRegistry handlers)
- {
- _handlers.put(state, handlers);
- }
-
- void init(MethodHandlerFactory factory)
- {
- for (AMQState s : AMQState.values())
- {
- setHandlers(s, factory.register(s, new MethodHandlerRegistry()));
- }
- }
-
- protected <B extends AMQMethodBody> StateAwareMethodListener<B> findStateTransitionHandler(AMQState state, B frame) //throws IllegalStateTransitionException
- {
- MethodHandlerRegistry registry = _handlers.get(state);
- StateAwareMethodListener<B> handler = (registry == null) ? null : registry.getHandler(frame);
- if (handler == null)
- {
- _logger.warn(new LogMessage("No handler for {0}, {1}", state, frame));
- }
- return handler;
- }
-
- <A extends AMQMethodBody, B extends Class<A>> void addHandler(AMQState state, B type, StateAwareMethodListener<A> handler)
- {
- MethodHandlerRegistry registry = _handlers.get(state);
- if (registry == null)
- {
- registry = new MethodHandlerRegistry();
- _handlers.put(state, registry);
- }
- registry.addHandler(type, handler);
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleBodySendable.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleBodySendable.java
deleted file mode 100644
index bd3757bf97..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleBodySendable.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.cluster;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQBody;
-import org.apache.qpid.framing.AMQFrame;
-
-/**
- */
-public class SimpleBodySendable implements Sendable
-{
- private final AMQBody _body;
-
- public SimpleBodySendable(AMQBody body)
- {
- _body = body;
- }
-
- public void send(int channel, Member member) throws AMQException
- {
- member.send(new AMQFrame(channel, _body));
- }
-
- public String toString()
- {
- return _body.toString();
- }
-
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleMemberHandle.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleMemberHandle.java
deleted file mode 100644
index 1255094b1d..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleMemberHandle.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.server.cluster;
-
-import org.apache.qpid.framing.AMQShortString;
-
-import java.net.InetAddress;
-import java.net.InetSocketAddress;
-import java.net.UnknownHostException;
-import java.util.ArrayList;
-import java.util.List;
-
-public class SimpleMemberHandle implements MemberHandle
-{
- private final String _host;
- private final int _port;
-
- public SimpleMemberHandle(String host, int port)
- {
- _host = host;
- _port = port;
- }
-
- public SimpleMemberHandle(AMQShortString details)
- {
- this(details.toString());
- }
-
- public SimpleMemberHandle(String details)
- {
- String[] parts = details.split(":");
- _host = parts[0];
- _port = Integer.parseInt(parts[1]);
- }
-
- public SimpleMemberHandle(InetSocketAddress address) throws UnknownHostException
- {
- this(address.getAddress(), address.getPort());
- }
-
- public SimpleMemberHandle(InetAddress address, int port) throws UnknownHostException
- {
- this(canonical(address).getHostAddress(), port);
- }
-
- public String getHost()
- {
- return _host;
- }
-
- public int getPort()
- {
- return _port;
- }
-
- public int hashCode()
- {
- return getPort();
- }
-
- public boolean equals(Object o)
- {
- return o instanceof MemberHandle && matches((MemberHandle) o);
- }
-
- public boolean matches(MemberHandle m)
- {
- return matches(m.getHost(), m.getPort());
- }
-
- public boolean matches(String host, int port)
- {
- return _host.equals(host) && _port == port;
- }
-
- public AMQShortString getDetails()
- {
- return new AMQShortString(_host + ":" + _port);
- }
-
- public String toString()
- {
- return getDetails().toString();
- }
-
- static List<MemberHandle> stringToMembers(String membership)
- {
- String[] names = membership.split("\\s");
- List<MemberHandle> members = new ArrayList<MemberHandle>();
- for (String name : names)
- {
- members.add(new SimpleMemberHandle(name));
- }
- return members;
- }
-
- static String membersToString(List<MemberHandle> members)
- {
- StringBuffer buffer = new StringBuffer();
- boolean first = true;
- for (MemberHandle m : members)
- {
- if (first)
- {
- first = false;
- }
- else
- {
- buffer.append(" ");
- }
- buffer.append(m.getDetails());
- }
-
- return buffer.toString();
- }
-
- private static InetAddress canonical(InetAddress address) throws UnknownHostException
- {
- if (address.isLoopbackAddress())
- {
- return InetAddress.getLocalHost();
- }
- else
- {
- return address;
- }
- }
-
- public MemberHandle resolve()
- {
- return resolve(this);
- }
-
- public static MemberHandle resolve(MemberHandle handle)
- {
- try
- {
- return new SimpleMemberHandle(new InetSocketAddress(handle.getHost(), handle.getPort()));
- }
- catch (UnknownHostException e)
- {
- e.printStackTrace();
- return handle;
- }
- }
-
-
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleSendable.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleSendable.java
deleted file mode 100644
index 7e5563460f..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/SimpleSendable.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.cluster;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.MethodConverter_8_0;
-import org.apache.qpid.framing.abstraction.ContentChunk;
-import org.apache.qpid.framing.abstraction.ProtocolVersionMethodConverter;
-import org.apache.qpid.server.queue.AMQMessage;
-
-import java.util.Iterator;
-
-public class SimpleSendable implements Sendable
-{
-
- //todo fixme - remove 0-8 hard coding
- ProtocolVersionMethodConverter _methodConverter = new MethodConverter_8_0();
-
- private final AMQMessage _message;
-
- public SimpleSendable(AMQMessage message)
- {
- _message = message;
- }
-
- public void send(int channel, Member member) throws AMQException
- {
- member.send(new AMQFrame(channel, _methodConverter.convertToBody(_message.getMessagePublishInfo())));
- member.send(new AMQFrame(channel, _message.getContentHeaderBody()));
- Iterator<ContentChunk> it = _message.getContentBodyIterator();
- while (it.hasNext())
- {
- member.send(new AMQFrame(channel, _methodConverter.convertToBody(it.next())));
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ChainedClusterMethodHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ChainedClusterMethodHandler.java
deleted file mode 100644
index 86710e8a31..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ChainedClusterMethodHandler.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.cluster.handler;
-
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-
-import java.util.List;
-import java.util.ArrayList;
-
-public class ChainedClusterMethodHandler <A extends AMQMethodBody> extends ClusterMethodHandler<A>
-{
- private final List<ClusterMethodHandler<A>> _handlers;
-
- private ChainedClusterMethodHandler()
- {
- this(new ArrayList<ClusterMethodHandler<A>>());
- }
-
- public ChainedClusterMethodHandler(List<ClusterMethodHandler<A>> handlers)
- {
- _handlers = handlers;
- }
-
- public ChainedClusterMethodHandler(ClusterMethodHandler<A>... handlers)
- {
- this();
- for(ClusterMethodHandler<A>handler: handlers)
- {
- _handlers.add(handler);
- }
- }
-
- protected final void peer(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException
- {
- for(ClusterMethodHandler<A> handler : _handlers)
- {
- handler.peer(stateMgr, evt);
- }
- }
-
- protected final void client(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException
- {
- for(ClusterMethodHandler<A> handler : _handlers)
- {
- handler.client(stateMgr, evt);
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ChannelQueueManager.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ChannelQueueManager.java
deleted file mode 100644
index c9f6dbfb37..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ChannelQueueManager.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.server.cluster.handler;
-
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.qpid.server.virtualhost.VirtualHostRegistry;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.log4j.Logger;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * Maintains the default queue names for a channel, and alters subsequent frames where necessary
- * to use this (i.e. when no queue is explictly specified).
- *
- */
-class ChannelQueueManager
-{
- private static final Logger _logger = Logger.getLogger(ChannelQueueManager.class);
- private final Map<Integer, AMQShortString> _channelQueues = new HashMap<Integer, AMQShortString>();
-
- ClusterMethodHandler<QueueDeclareBody> createQueueDeclareHandler()
- {
- return new QueueDeclareHandler();
- }
-
- ClusterMethodHandler<QueueDeleteBody> createQueueDeleteHandler()
- {
- return new QueueDeleteHandler();
- }
-
- ClusterMethodHandler<QueueBindBody> createQueueBindHandler()
- {
- return new QueueBindHandler();
- }
-
- ClusterMethodHandler<BasicConsumeBody> createBasicConsumeHandler()
- {
- return new BasicConsumeHandler();
- }
-
- private void set(int channel, AMQShortString queue)
- {
- _channelQueues.put(channel, queue);
- _logger.info(new LogMessage("Set default queue for {0} to {1}", channel, queue));
- }
-
- private AMQShortString get(int channel)
- {
- AMQShortString queue = _channelQueues.get(channel);
- _logger.info(new LogMessage("Default queue for {0} is {1}", channel, queue));
- return queue;
- }
-
- private class QueueDeclareHandler extends ClusterMethodHandler<QueueDeclareBody>
- {
- protected void peer(AMQStateManager stateMgr, AMQMethodEvent<QueueDeclareBody> evt) throws AMQException
- {
- }
-
- protected void client(AMQStateManager stateMgr, AMQMethodEvent<QueueDeclareBody> evt) throws AMQException
- {
- set(evt.getChannelId(), evt.getMethod().queue);
- }
- }
- private class QueueBindHandler extends ClusterMethodHandler<QueueBindBody>
- {
- protected void peer(AMQStateManager stateMgr, AMQMethodEvent<QueueBindBody> evt) throws AMQException
- {
- }
-
- protected void client(AMQStateManager stateMgr, AMQMethodEvent<QueueBindBody> evt) throws AMQException
- {
- if(evt.getMethod().queue == null)
- {
- evt.getMethod().queue = get(evt.getChannelId());
- }
- }
- }
- private class QueueDeleteHandler extends ClusterMethodHandler<QueueDeleteBody>
- {
- protected void peer(AMQStateManager stateMgr, AMQMethodEvent<QueueDeleteBody> evt) throws AMQException
- {
- }
-
- protected void client(AMQStateManager stateMgr, AMQMethodEvent<QueueDeleteBody> evt) throws AMQException
- {
- if(evt.getMethod().queue == null)
- {
- evt.getMethod().queue = get(evt.getChannelId());
- }
- }
- }
-
- private class BasicConsumeHandler extends ClusterMethodHandler<BasicConsumeBody>
- {
- protected void peer(AMQStateManager stateMgr, AMQMethodEvent<BasicConsumeBody> evt) throws AMQException
- {
- }
-
- protected void client(AMQStateManager stateMgr, AMQMethodEvent<BasicConsumeBody> evt) throws AMQException
- {
- if(evt.getMethod().queue == null)
- {
- evt.getMethod().queue = get(evt.getChannelId());
- }
- }
- }
-
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ClusterMethodHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ClusterMethodHandler.java
deleted file mode 100644
index faab99b0f6..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ClusterMethodHandler.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.cluster.handler;
-
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.cluster.ClusteredProtocolSession;
-import org.apache.qpid.AMQException;
-
-public abstract class ClusterMethodHandler<A extends AMQMethodBody> implements StateAwareMethodListener<A>
-{
- public final void methodReceived(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException
- {
- AMQProtocolSession session = stateMgr.getProtocolSession();
-
- if (ClusteredProtocolSession.isPeerSession(session))
- {
- peer(stateMgr, evt);
- }
- else
- {
- client(stateMgr, evt);
- }
- }
-
- protected abstract void peer(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException;
- protected abstract void client(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException;
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ClusterMethodHandlerFactory.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ClusterMethodHandlerFactory.java
deleted file mode 100644
index e7509da32a..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ClusterMethodHandlerFactory.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.cluster.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.server.cluster.ClusterCapability;
-import org.apache.qpid.server.cluster.ClusteredProtocolSession;
-import org.apache.qpid.server.cluster.GroupManager;
-import org.apache.qpid.server.cluster.LoadTable;
-import org.apache.qpid.server.cluster.MemberHandle;
-import org.apache.qpid.server.cluster.MethodHandlerFactory;
-import org.apache.qpid.server.cluster.MethodHandlerRegistry;
-import org.apache.qpid.server.cluster.SimpleMemberHandle;
-import org.apache.qpid.server.handler.ChannelCloseHandler;
-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.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.ExchangeDeclareHandler;
-import org.apache.qpid.server.handler.ExchangeDeleteHandler;
-import org.apache.qpid.server.handler.BasicCancelMethodHandler;
-import org.apache.qpid.server.handler.BasicPublishMethodHandler;
-import org.apache.qpid.server.handler.QueueBindHandler;
-import org.apache.qpid.server.handler.QueueDeleteHandler;
-import org.apache.qpid.server.handler.BasicQosHandler;
-import org.apache.qpid.server.handler.TxSelectHandler;
-import org.apache.qpid.server.handler.TxCommitHandler;
-import org.apache.qpid.server.handler.TxRollbackHandler;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.state.AMQState;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class ClusterMethodHandlerFactory implements MethodHandlerFactory
-{
- private final GroupManager _groupMgr;
- private final LoadTable _loadTable;
-
- public ClusterMethodHandlerFactory(GroupManager groupMgr, LoadTable loadTable)
- {
- _groupMgr = groupMgr;
- _loadTable = loadTable;
- }
-
- public MethodHandlerRegistry register(AMQState state, MethodHandlerRegistry registry)
- {
- switch (state)
- {
- case CONNECTION_NOT_STARTED:
- return registry.addHandler(ConnectionStartOkBody.class, ConnectionStartOkMethodHandler.getInstance());
- case CONNECTION_NOT_AUTH:
- return registry.addHandler(ConnectionSecureOkBody.class, ConnectionSecureOkMethodHandler.getInstance());
- case CONNECTION_NOT_TUNED:
- return registry.addHandler(ConnectionTuneOkBody.class, ConnectionTuneOkMethodHandler.getInstance());
- case CONNECTION_NOT_OPENED:
- //connection.open override:
- return registry.addHandler(ConnectionOpenBody.class, new ConnectionOpenHandler());
- case CONNECTION_OPEN:
- return registerConnectionOpened(registry);
- }
- return registry;
- }
-
- private MethodHandlerRegistry registerConnectionOpened(MethodHandlerRegistry registry)
- {
- //new cluster method handlers:
- registry.addHandler(ClusterJoinBody.class, new JoinHandler());
- registry.addHandler(ClusterLeaveBody.class, new LeaveHandler());
- registry.addHandler(ClusterSuspectBody.class, new SuspectHandler());
- registry.addHandler(ClusterMembershipBody.class, new MembershipHandler());
- registry.addHandler(ClusterPingBody.class, new PingHandler());
- registry.addHandler(ClusterSynchBody.class, new SynchHandler());
-
- //connection.close override:
- registry.addHandler(ConnectionCloseBody.class, new ConnectionCloseHandler());
-
- //replicated handlers:
- registry.addHandler(ExchangeDeclareBody.class, replicated(ExchangeDeclareHandler.getInstance()));
- registry.addHandler(ExchangeDeleteBody.class, replicated(ExchangeDeleteHandler.getInstance()));
-
- ChannelQueueManager channelQueueMgr = new ChannelQueueManager();
-
-
- LocalQueueDeclareHandler handler = new LocalQueueDeclareHandler(_groupMgr);
- registry.addHandler(QueueDeclareBody.class,
- chain(new QueueNameGenerator(handler),
- channelQueueMgr.createQueueDeclareHandler(),
- new ReplicatingHandler<QueueDeclareBody>(_groupMgr, handler)));
-
- registry.addHandler(QueueBindBody.class, chain(channelQueueMgr.createQueueBindHandler(), replicated(QueueBindHandler.getInstance())));
- registry.addHandler(QueueDeleteBody.class, chain(channelQueueMgr.createQueueDeleteHandler(), replicated(alternate(new QueueDeleteHandler(false), new QueueDeleteHandler(true)))));
- registry.addHandler(BasicConsumeBody.class, chain(channelQueueMgr.createBasicConsumeHandler(), new ReplicatingConsumeHandler(_groupMgr)));
-
- //other modified handlers:
- registry.addHandler(BasicCancelBody.class, alternate(new RemoteCancelHandler(), BasicCancelMethodHandler.getInstance()));
-
- //other unaffected handlers:
- registry.addHandler(BasicPublishBody.class, BasicPublishMethodHandler.getInstance());
- registry.addHandler(BasicQosBody.class, BasicQosHandler.getInstance());
- registry.addHandler(ChannelOpenBody.class, ChannelOpenHandler.getInstance());
- registry.addHandler(ChannelCloseBody.class, ChannelCloseHandler.getInstance());
- registry.addHandler(ChannelFlowBody.class, ChannelFlowHandler.getInstance());
- registry.addHandler(TxSelectBody.class, TxSelectHandler.getInstance());
- registry.addHandler(TxCommitBody.class, TxCommitHandler.getInstance());
- registry.addHandler(TxRollbackBody.class, TxRollbackHandler.getInstance());
-
-
- return registry;
- }
-
- private class SynchHandler implements StateAwareMethodListener<ClusterSynchBody>
- {
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<ClusterSynchBody> evt) throws AMQException
- {
- _groupMgr.handleSynch(ClusteredProtocolSession.getSessionPeer(stateManager.getProtocolSession()));
- }
- }
-
- private class JoinHandler implements StateAwareMethodListener<ClusterJoinBody>
- {
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<ClusterJoinBody> evt) throws AMQException
- {
- _groupMgr.handleJoin(new SimpleMemberHandle(evt.getMethod().broker));
- }
- }
-
- private class LeaveHandler implements StateAwareMethodListener<ClusterLeaveBody>
- {
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<ClusterLeaveBody> evt) throws AMQException
- {
- _groupMgr.handleLeave(new SimpleMemberHandle(evt.getMethod().broker));
- }
- }
-
- private class SuspectHandler implements StateAwareMethodListener<ClusterSuspectBody>
- {
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<ClusterSuspectBody> evt) throws AMQException
- {
- _groupMgr.handleSuspect(new SimpleMemberHandle(evt.getMethod().broker));
- }
- }
-
- private class MembershipHandler implements StateAwareMethodListener<ClusterMembershipBody>
- {
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<ClusterMembershipBody> evt) throws AMQException
- {
- ClusterMembershipBody body = evt.getMethod();
- _groupMgr.handleMembershipAnnouncement(new String(body.members));
- }
- }
-
- private class PingHandler implements StateAwareMethodListener<ClusterPingBody>
- {
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<ClusterPingBody> evt) throws AMQException
- {
- MemberHandle peer = new SimpleMemberHandle(evt.getMethod().broker);
- _groupMgr.handlePing(peer, evt.getMethod().load);
- if (evt.getMethod().responseRequired)
- {
- evt.getMethod().load = _loadTable.getLocalLoad();
- stateManager.getProtocolSession().writeFrame(new AMQFrame(evt.getChannelId(), evt.getMethod()));
- }
- }
- }
-
- private class ConnectionOpenHandler extends ExtendedHandler<ConnectionOpenBody>
- {
- ConnectionOpenHandler()
- {
- super(ConnectionOpenMethodHandler.getInstance());
- }
-
- void postHandle(AMQStateManager stateMgr, AMQMethodEvent<ConnectionOpenBody> evt)
- {
- AMQShortString capabilities = evt.getMethod().capabilities;
- if (ClusterCapability.contains(capabilities))
- {
- ClusteredProtocolSession.setSessionPeer(stateMgr.getProtocolSession(), ClusterCapability.getPeer(capabilities));
- }
- else
- {
- _loadTable.incrementLocalLoad();
- }
- }
- }
-
- private class ConnectionCloseHandler extends ExtendedHandler<ConnectionCloseBody>
- {
- ConnectionCloseHandler()
- {
- super(ConnectionCloseMethodHandler.getInstance());
- }
-
- void postHandle(AMQStateManager stateMgr, AMQMethodEvent<ConnectionCloseBody> evt)
- {
- if (!ClusteredProtocolSession.isPeerSession(stateMgr.getProtocolSession()))
- {
- _loadTable.decrementLocalLoad();
- }
- }
- }
-
- private <B extends AMQMethodBody> ReplicatingHandler<B> replicated(StateAwareMethodListener<B> handler)
- {
- return new ReplicatingHandler<B>(_groupMgr, handler);
- }
-
- private <B extends AMQMethodBody> StateAwareMethodListener<B> alternate(StateAwareMethodListener<B> peer, StateAwareMethodListener<B> client)
- {
- return new PeerHandler<B>(peer, client);
- }
-
- private <B extends AMQMethodBody> StateAwareMethodListener<B> chain(ClusterMethodHandler<B>... h)
- {
- return new ChainedClusterMethodHandler<B>(h);
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ExtendedHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ExtendedHandler.java
deleted file mode 100644
index a2f62f714b..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ExtendedHandler.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.cluster.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-class ExtendedHandler<A extends AMQMethodBody> implements StateAwareMethodListener<A>
-{
- private final StateAwareMethodListener<A> _base;
-
- ExtendedHandler(StateAwareMethodListener<A> base)
- {
- _base = base;
- }
-
- public void methodReceived(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException
- {
- preHandle(stateMgr, evt);
- _base.methodReceived(stateMgr, evt);
- postHandle(stateMgr, evt);
- }
-
- void preHandle(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException
- {
- }
-
- void postHandle(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException
- {
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/HandlerUtils.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/HandlerUtils.java
deleted file mode 100644
index 0dc7fe00d2..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/HandlerUtils.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.cluster.handler;
-
-public abstract class HandlerUtils
-{
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/LocalQueueDeclareHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/LocalQueueDeclareHandler.java
deleted file mode 100644
index f01a8349f2..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/LocalQueueDeclareHandler.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.cluster.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.QueueDeclareBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.cluster.ClusteredProtocolSession;
-import org.apache.qpid.server.cluster.GroupManager;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.qpid.server.cluster.MemberHandle;
-import org.apache.qpid.server.handler.QueueDeclareHandler;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.ClusteredQueue;
-import org.apache.qpid.server.queue.PrivateQueue;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.RemoteQueueProxy;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class LocalQueueDeclareHandler extends QueueDeclareHandler
-{
- private static final Logger _logger = Logger.getLogger(LocalQueueDeclareHandler.class);
- private final GroupManager _groupMgr;
-
- LocalQueueDeclareHandler(GroupManager groupMgr)
- {
- _groupMgr = groupMgr;
- }
-
- protected AMQShortString createName()
- {
- return new AMQShortString(super.createName().toString() + "@" + _groupMgr.getLocal().getDetails());
- }
-
- protected AMQQueue createQueue(QueueDeclareBody body, VirtualHost virtualHost, AMQProtocolSession session) throws AMQException
- {
- //is it private or shared:
- if (body.exclusive)
- {
- if (ClusteredProtocolSession.isPeerSession(session))
- {
- //need to get peer from the session...
- MemberHandle peer = ClusteredProtocolSession.getSessionPeer(session);
- _logger.debug(new LogMessage("Creating proxied queue {0} on behalf of {1}", body.queue, peer));
- return new RemoteQueueProxy(peer, _groupMgr, body.queue, body.durable, new AMQShortString(peer.getDetails()), body.autoDelete, virtualHost);
- }
- else
- {
- _logger.debug(new LogMessage("Creating local private queue {0}", body.queue));
- return new PrivateQueue(_groupMgr, body.queue, body.durable, session.getContextKey(), body.autoDelete, virtualHost);
- }
- }
- else
- {
- _logger.debug(new LogMessage("Creating local shared queue {0}", body.queue));
- return new ClusteredQueue(_groupMgr, body.queue, body.durable, null, body.autoDelete, virtualHost);
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/NullListener.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/NullListener.java
deleted file mode 100644
index 8b0bb4b127..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/NullListener.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.cluster.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class NullListener<T extends AMQMethodBody> implements StateAwareMethodListener<T>
-{
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<T> evt) throws AMQException
- {
- }
-}
-
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/PeerHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/PeerHandler.java
deleted file mode 100644
index 447e51ccd9..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/PeerHandler.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.cluster.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.cluster.ClusteredProtocolSession;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-/**
- * Base for implementing handlers that carry out different actions based on whether the method they
- * are handling was sent by a peer (i.e. another broker in the cluster) or a client (i.e. an end-user
- * application).
- *
- */
-public class PeerHandler<A extends AMQMethodBody> extends ClusterMethodHandler<A>
-{
- private final StateAwareMethodListener<A> _peer;
- private final StateAwareMethodListener<A> _client;
-
- PeerHandler(StateAwareMethodListener<A> peer, StateAwareMethodListener<A> client)
- {
- _peer = peer;
- _client = client;
- }
-
- protected void peer(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException
- {
- _peer.methodReceived(stateMgr, evt);
- }
-
- protected void client(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException
- {
- _client.methodReceived(stateMgr, evt);
- }
-
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/QueueNameGenerator.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/QueueNameGenerator.java
deleted file mode 100644
index a669171d3c..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/QueueNameGenerator.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.cluster.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.QueueDeclareBody;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.state.AMQStateManager;
-
-/**
- * Generates queue names for queues declared with no name.
- *
- */
-class QueueNameGenerator extends ClusterMethodHandler<QueueDeclareBody>
-{
- private final LocalQueueDeclareHandler _handler;
-
- QueueNameGenerator(LocalQueueDeclareHandler handler)
- {
- _handler = handler;
- }
-
- protected void peer(AMQStateManager stateMgr, AMQMethodEvent<QueueDeclareBody> evt) throws AMQException
- {
- }
-
- protected void client(AMQStateManager stateMgr, AMQMethodEvent<QueueDeclareBody> evt)
- throws AMQException
- {
- setName(evt.getMethod());//need to set the name before propagating this method
- }
-
- protected void setName(QueueDeclareBody body)
- {
- if (body.queue == null)
- {
- body.queue = _handler.createName();
- }
- }
-}
-
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/RemoteCancelHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/RemoteCancelHandler.java
deleted file mode 100644
index f09763e1ad..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/RemoteCancelHandler.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.cluster.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicCancelBody;
-import org.apache.qpid.server.cluster.ClusteredProtocolSession;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.ClusteredQueue;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class RemoteCancelHandler implements StateAwareMethodListener<BasicCancelBody>
-{
- private final Logger _logger = Logger.getLogger(RemoteCancelHandler.class);
-
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<BasicCancelBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
-
-
- //By convention, consumers setup between brokers use the queue name as the consumer tag:
- AMQQueue queue = queueRegistry.getQueue(evt.getMethod().consumerTag);
- if (queue instanceof ClusteredQueue)
- {
- ((ClusteredQueue) queue).removeRemoteSubscriber(ClusteredProtocolSession.getSessionPeer(session));
- }
- else
- {
- _logger.warn("Got remote cancel request for non-clustered queue: " + queue);
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/RemoteConsumeHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/RemoteConsumeHandler.java
deleted file mode 100644
index 073b13688c..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/RemoteConsumeHandler.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.server.cluster.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicConsumeBody;
-import org.apache.qpid.framing.BasicConsumeOkBody;
-import org.apache.qpid.server.cluster.ClusteredProtocolSession;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.ClusteredQueue;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-/**
- * Handles consume requests from other cluster members.
- *
- */
-public class RemoteConsumeHandler implements StateAwareMethodListener<BasicConsumeBody>
-{
- private final Logger _logger = Logger.getLogger(RemoteConsumeHandler.class);
-
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent<BasicConsumeBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
-
- AMQQueue queue = queueRegistry.getQueue(evt.getMethod().queue);
- if (queue instanceof ClusteredQueue)
- {
- ((ClusteredQueue) queue).addRemoteSubcriber(ClusteredProtocolSession.getSessionPeer(session));
- // 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(BasicConsumeOkBody.createAMQFrame(evt.getChannelId(),
- (byte)8, (byte)0, // AMQP version (major, minor)
- evt.getMethod().queue // consumerTag
- ));
- }
- else
- {
- _logger.warn("Got remote consume request for non-clustered queue: " + queue);
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ReplicatingConsumeHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ReplicatingConsumeHandler.java
deleted file mode 100644
index 897f8e4fb7..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ReplicatingConsumeHandler.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.server.cluster.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicConsumeBody;
-import org.apache.qpid.server.cluster.BroadcastPolicy;
-import org.apache.qpid.server.cluster.GroupManager;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.handler.BasicConsumeMethodHandler;
-import org.apache.qpid.protocol.AMQMethodEvent;
-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.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-public class ReplicatingConsumeHandler extends ReplicatingHandler<BasicConsumeBody>
-{
- ReplicatingConsumeHandler(GroupManager groupMgr)
- {
- this(groupMgr, null);
- }
-
- ReplicatingConsumeHandler(GroupManager groupMgr, BroadcastPolicy policy)
- {
- super(groupMgr, base(), policy);
- }
-
- protected void replicate(AMQStateManager stateManager, AMQMethodEvent<BasicConsumeBody> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
-
- //only replicate if the queue in question is a shared queue
- if (isShared(queueRegistry.getQueue(evt.getMethod().queue)))
- {
- super.replicate(stateManager, evt);
- }
- else
- {
- _logger.info(new LogMessage("Handling consume for private queue ({0}) locally", evt.getMethod()));
- local(stateManager, evt);
- _logger.info(new LogMessage("Handled consume for private queue ({0}) locally", evt.getMethod()));
-
- }
- }
-
- protected boolean isShared(AMQQueue queue)
- {
- return queue != null && queue.isShared();
- }
-
- static StateAwareMethodListener<BasicConsumeBody> base()
- {
- return new PeerHandler<BasicConsumeBody>(peer(), client());
- }
-
- static StateAwareMethodListener<BasicConsumeBody> peer()
- {
- return new RemoteConsumeHandler();
- }
-
- static StateAwareMethodListener<BasicConsumeBody> client()
- {
- return BasicConsumeMethodHandler.getInstance();
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ReplicatingHandler.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ReplicatingHandler.java
deleted file mode 100644
index 888fa4e426..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ReplicatingHandler.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.cluster.handler;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.qpid.server.cluster.*;
-import org.apache.qpid.server.cluster.policy.StandardPolicies;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.util.List;
-
-/**
- * Basic template for handling methods that should be broadcast to the group and
- * processed locally after 'completion' of this broadcast.
- *
- */
-class ReplicatingHandler<A extends AMQMethodBody> extends ClusterMethodHandler<A> implements StandardPolicies
-{
- protected static final Logger _logger = Logger.getLogger(ReplicatingHandler.class);
-
- private final StateAwareMethodListener<A> _base;
- private final GroupManager _groupMgr;
- private final BroadcastPolicy _policy;
-
- ReplicatingHandler(GroupManager groupMgr, StateAwareMethodListener<A> base)
- {
- this(groupMgr, base, null);
- }
-
- ReplicatingHandler(GroupManager groupMgr, StateAwareMethodListener<A> base, BroadcastPolicy policy)
- {
- _groupMgr = groupMgr;
- _base = base;
- _policy = policy;
- }
-
- protected void peer(AMQStateManager stateManager, AMQMethodEvent<A> evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
- ExchangeRegistry exchangeRegistry = virtualHost.getExchangeRegistry();
- QueueRegistry queueRegistry = virtualHost.getQueueRegistry();
-
- local(stateManager, evt);
- _logger.debug(new LogMessage("Handled {0} locally", evt.getMethod()));
- }
-
- protected void client(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException
- {
- replicate(stateMgr, evt);
- }
-
- protected void replicate(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException
- {
- if (_policy == null)
- {
- //asynch delivery
- _groupMgr.broadcast(new SimpleBodySendable(evt.getMethod()));
- local(stateMgr, evt);
- }
- else
- {
- Callback callback = new Callback(stateMgr, evt);
- _groupMgr.broadcast(new SimpleBodySendable(evt.getMethod()), _policy, callback);
- }
- _logger.debug(new LogMessage("Replicated {0} to peers", evt.getMethod()));
- }
-
- protected void local(AMQStateManager stateMgr, AMQMethodEvent<A> evt) throws AMQException
- {
- _base.methodReceived(stateMgr, evt);
- }
-
- private class Callback implements GroupResponseHandler
- {
- private final AMQStateManager _stateMgr;
- private final AMQMethodEvent<A> _evt;
-
- Callback(AMQStateManager stateMgr, AMQMethodEvent<A> evt)
- {
- _stateMgr = stateMgr;
- _evt = evt;
- }
-
- public void response(List<AMQMethodBody> responses, List<Member> members)
- {
- try
- {
- local(_stateMgr, _evt);
- _logger.debug(new LogMessage("Handled {0} locally, in response to completion of replication", _evt.getMethod()));
- }
- catch (AMQException e)
- {
- _logger.error(new LogMessage("Error handling {0}:{1}", _evt.getMethod(), e), e);
- }
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappedListener.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappedListener.java
deleted file mode 100644
index 8b0c638d63..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappedListener.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.cluster.handler;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public class WrappedListener<T extends AMQMethodBody> implements StateAwareMethodListener<T>
-{
- private final StateAwareMethodListener<T> _primary;
- private final StateAwareMethodListener _post;
- private final StateAwareMethodListener _pre;
-
- WrappedListener(StateAwareMethodListener<T> primary, StateAwareMethodListener pre, StateAwareMethodListener post)
- {
- _pre = check(pre);
- _post = check(post);
- _primary = check(primary);
- }
-
- public void methodReceived(AMQStateManager stateMgr, AMQMethodEvent<T> evt) throws AMQException
- {
- _pre.methodReceived(stateMgr, evt);
- _primary.methodReceived(stateMgr, evt);
- _post.methodReceived(stateMgr, evt);
- }
-
- private static <T extends AMQMethodBody> StateAwareMethodListener<T> check(StateAwareMethodListener<T> in)
- {
- return in == null ? new NullListener<T>() : in;
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappingMethodHandlerFactory.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappingMethodHandlerFactory.java
deleted file mode 100644
index 5ec3c9660a..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappingMethodHandlerFactory.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.cluster.handler;
-
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.cluster.MethodHandlerFactory;
-import org.apache.qpid.server.cluster.MethodHandlerRegistry;
-import org.apache.qpid.server.state.AMQState;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-public abstract class WrappingMethodHandlerFactory implements MethodHandlerFactory
-{
- private final MethodHandlerFactory _delegate;
- private final StateAwareMethodListener _pre;
- private final StateAwareMethodListener _post;
-
- protected WrappingMethodHandlerFactory(MethodHandlerFactory delegate,
- StateAwareMethodListener pre,
- StateAwareMethodListener post)
- {
- _delegate = delegate;
- _pre = pre;
- _post = post;
- }
-
- public MethodHandlerRegistry register(AMQState state, MethodHandlerRegistry registry)
- {
- if (isWrappableState(state))
- {
- return wrap(_delegate.register(state, registry), state);
- }
- else
- {
- return _delegate.register(state, registry);
- }
- }
-
- protected abstract boolean isWrappableState(AMQState state);
-
- protected abstract Iterable<FrameDescriptor> getWrappableFrameTypes(AMQState state);
-
- private MethodHandlerRegistry wrap(MethodHandlerRegistry registry, AMQState state)
- {
- for (FrameDescriptor fd : getWrappableFrameTypes(state))
- {
- wrap(registry, fd.type, fd.instance);
- }
- return registry;
- }
-
- private <A extends AMQMethodBody, B extends Class<A>> void wrap(MethodHandlerRegistry r, B type, A frame)
- {
- r.addHandler(type, new WrappedListener<A>(r.getHandler(frame), _pre, _post));
- }
-
- protected static class FrameDescriptor<A extends AMQMethodBody, B extends Class<A>>
- {
- protected final A instance;
- protected final B type;
-
- public FrameDescriptor(B type, A instance)
- {
- this.instance = instance;
- this.type = type;
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/AsynchBroadcastPolicy.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/AsynchBroadcastPolicy.java
deleted file mode 100644
index 79cb558ede..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/AsynchBroadcastPolicy.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.server.cluster.policy;
-
-import org.apache.qpid.server.cluster.BroadcastPolicy;
-
-public class AsynchBroadcastPolicy implements BroadcastPolicy
-{
- public boolean isComplete(int responded, int members)
- {
- return true;
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/MajorityResponseBroadcastPolicy.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/MajorityResponseBroadcastPolicy.java
deleted file mode 100644
index 42382c6e7a..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/MajorityResponseBroadcastPolicy.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.server.cluster.policy;
-
-import org.apache.qpid.server.cluster.BroadcastPolicy;
-
-public class MajorityResponseBroadcastPolicy implements BroadcastPolicy
-{
- public boolean isComplete(int responded, int members)
- {
- return responded > members / 2;
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/OneResponseBroadcastPolicy.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/OneResponseBroadcastPolicy.java
deleted file mode 100644
index e3072a6a40..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/OneResponseBroadcastPolicy.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.server.cluster.policy;
-
-import org.apache.qpid.server.cluster.BroadcastPolicy;
-
-public class OneResponseBroadcastPolicy implements BroadcastPolicy
-{
- public boolean isComplete(int responded, int members)
- {
- return responded > 0;
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/StandardPolicies.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/StandardPolicies.java
deleted file mode 100644
index dbaf690d3a..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/StandardPolicies.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.cluster.policy;
-
-import org.apache.qpid.server.cluster.BroadcastPolicy;
-
-public interface StandardPolicies
-{
- public static final BroadcastPolicy ASYNCH_POLICY = new AsynchBroadcastPolicy();
- public static final BroadcastPolicy SYNCH_POLICY = new SynchBroadcastPolicy();
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/SynchBroadcastPolicy.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/SynchBroadcastPolicy.java
deleted file mode 100644
index 605b8dd51e..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/policy/SynchBroadcastPolicy.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.server.cluster.policy;
-
-import org.apache.qpid.server.cluster.BroadcastPolicy;
-
-public class SynchBroadcastPolicy implements BroadcastPolicy
-{
- public boolean isComplete(int responded, int members)
- {
- return responded == members;
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ChainedMethodRecorder.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ChainedMethodRecorder.java
deleted file mode 100644
index 3664be58bc..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ChainedMethodRecorder.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.cluster.replay;
-
-import org.apache.qpid.framing.AMQMethodBody;
-
-abstract class ChainedMethodRecorder <T extends AMQMethodBody> implements MethodRecorder<T>
-{
- private final MethodRecorder<T> _recorder;
-
- ChainedMethodRecorder()
- {
- this(null);
- }
-
- ChainedMethodRecorder(MethodRecorder<T> recorder)
- {
- _recorder = recorder;
- }
-
- public final void record(T method)
- {
- if(!doRecord(method) && _recorder != null)
- {
- _recorder.record(method);
- }
- }
-
- protected abstract boolean doRecord(T method);
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.java
deleted file mode 100644
index 5a433b869b..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.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.server.cluster.replay;
-
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.BasicConsumeBody;
-import org.apache.qpid.framing.AMQShortString;
-
-import java.util.Map;
-import java.util.HashMap;
-import java.util.List;
-
-class ConsumerCounts
-{
- private final Map<AMQShortString, Integer> _counts = new HashMap<AMQShortString, Integer>();
-
- synchronized void increment(AMQShortString queue)
- {
- _counts.put(queue, get(queue) + 1);
- }
-
- synchronized void decrement(AMQShortString queue)
- {
- _counts.put(queue, get(queue) - 1);
- }
-
- private int get(AMQShortString queue)
- {
- Integer count = _counts.get(queue);
- return count == null ? 0 : count;
- }
-
- synchronized void replay(List<AMQMethodBody> messages)
- {
- for(AMQShortString queue : _counts.keySet())
- {
- // 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.
- BasicConsumeBody m = new BasicConsumeBody((byte)8,
- (byte)0,
- BasicConsumeBody.getClazz((byte)8, (byte)0),
- BasicConsumeBody.getMethod((byte)8, (byte)0),
- null,
- queue,
- false,
- false,
- false,
- false,
- queue,
- 0);
- m.queue = queue;
- m.consumerTag = queue;
- replay(m, messages);
- }
- }
-
- private void replay(BasicConsumeBody msg, List<AMQMethodBody> messages)
- {
- int count = _counts.get(msg.queue);
- for(int i = 0; i < count; i++)
- {
- messages.add(msg);
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/MethodRecorder.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/MethodRecorder.java
deleted file mode 100644
index e45810438e..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/MethodRecorder.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.server.cluster.replay;
-
-import org.apache.qpid.framing.AMQMethodBody;
-
-/**
- * Abstraction through which a method can be recorded for replay
- *
- */
-interface MethodRecorder<T extends AMQMethodBody>
-{
- public void record(T method);
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/RecordingMethodHandlerFactory.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/RecordingMethodHandlerFactory.java
deleted file mode 100644
index 4d3fe1dbed..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/RecordingMethodHandlerFactory.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.cluster.replay;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.framing.BasicCancelBody;
-import org.apache.qpid.framing.BasicConsumeBody;
-import org.apache.qpid.framing.ExchangeDeclareBody;
-import org.apache.qpid.framing.ExchangeDeleteBody;
-import org.apache.qpid.framing.QueueBindBody;
-import org.apache.qpid.framing.QueueDeclareBody;
-import org.apache.qpid.framing.QueueDeleteBody;
-import org.apache.qpid.server.cluster.MethodHandlerFactory;
-import org.apache.qpid.server.cluster.MethodHandlerRegistry;
-import org.apache.qpid.server.cluster.handler.WrappingMethodHandlerFactory;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.state.AMQState;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-
-import java.util.Arrays;
-
-public class RecordingMethodHandlerFactory extends WrappingMethodHandlerFactory
-{
- // 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.
- private final byte major = (byte)8;
- private final byte minor = (byte)0;
- private final Iterable<FrameDescriptor> _frames = Arrays.asList(new FrameDescriptor[]
- {
- new FrameDescriptor(QueueDeclareBody.class, new QueueDeclareBody(major, minor, QueueDeclareBody.getClazz(major, minor), QueueDeclareBody.getMethod(major, minor),null,false,false,false,false,false,null,0)),
- new FrameDescriptor(QueueDeleteBody.class, new QueueDeleteBody(major, minor, QueueDeleteBody.getClazz(major, minor), QueueDeleteBody.getMethod(major, minor),false,false,false,null,0)),
- new FrameDescriptor(QueueBindBody.class, new QueueBindBody(major, minor, QueueBindBody.getClazz(major, minor), QueueBindBody.getMethod(major, minor),null,null,false,null,null,0)),
- new FrameDescriptor(ExchangeDeclareBody.class, new ExchangeDeclareBody(major, minor, ExchangeDeclareBody.getClazz(major, minor), ExchangeDeclareBody.getMethod(major, minor),null,false,false,null,false,false,false,0,null)),
- new FrameDescriptor(ExchangeDeleteBody.class, new ExchangeDeleteBody(major, minor, ExchangeDeleteBody.getClazz(major, minor), ExchangeDeleteBody.getMethod(major, minor),null,false,false,0)),
- new FrameDescriptor(BasicConsumeBody.class, new BasicConsumeBody(major, minor, BasicConsumeBody.getClazz(major, minor), BasicConsumeBody.getMethod(major, minor),null,null,false,false,false,false,null,0)),
- new FrameDescriptor(BasicCancelBody.class, new BasicCancelBody(major, minor, BasicCancelBody.getClazz(major, minor), BasicCancelBody.getMethod(major, minor),null,false))
- });
-
-
- public RecordingMethodHandlerFactory(MethodHandlerFactory factory, ReplayStore store)
- {
- super(factory, null, store);
- }
-
- protected boolean isWrappableState(AMQState state)
- {
- return AMQState.CONNECTION_OPEN.equals(state);
- }
-
- protected Iterable<FrameDescriptor> getWrappableFrameTypes(AMQState state)
- {
- return _frames;
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayManager.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayManager.java
deleted file mode 100644
index 898cb80cb3..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayManager.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.cluster.replay;
-
-import org.apache.qpid.server.cluster.Sendable;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.AMQMethodBody;
-
-import java.util.List;
-
-/**
- * Abstraction of a replay strategy for use in getting joining members up to
- * date with respect to cluster state.
- *
- */
-public interface ReplayManager
-{
- public List<AMQMethodBody> replay(boolean isLeader);
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.java
deleted file mode 100644
index d7bbb1c36b..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.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.server.cluster.replay;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.*;
-import org.apache.qpid.server.cluster.ClusteredProtocolSession;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.qpid.server.cluster.util.Bindings;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Stores method invocations for replay to new members.
- *
- */
-public class ReplayStore implements ReplayManager, StateAwareMethodListener
-{
- private static final Logger _logger = Logger.getLogger(ReplayStore.class);
-
- private final Map<Class<? extends AMQMethodBody>, MethodRecorder> _globalRecorders = new HashMap<Class<? extends AMQMethodBody>, MethodRecorder>();
- private final Map<Class<? extends AMQMethodBody>, MethodRecorder> _localRecorders = new HashMap<Class<? extends AMQMethodBody>, MethodRecorder>();
- private final Map<AMQShortString, QueueDeclareBody> _sharedQueues = new ConcurrentHashMap<AMQShortString, QueueDeclareBody>();
- private final Map<AMQShortString, QueueDeclareBody> _privateQueues = new ConcurrentHashMap<AMQShortString, QueueDeclareBody>();
- private final Bindings<AMQShortString, AMQShortString, QueueBindBody> _sharedBindings = new Bindings<AMQShortString, AMQShortString, QueueBindBody>();
- private final Bindings<AMQShortString, AMQShortString, QueueBindBody> _privateBindings = new Bindings<AMQShortString, AMQShortString, QueueBindBody>();
- private final Map<AMQShortString, ExchangeDeclareBody> _exchanges = new ConcurrentHashMap<AMQShortString, ExchangeDeclareBody>();
- private final ConsumerCounts _consumers = new ConsumerCounts();
-
- public ReplayStore()
- {
- _globalRecorders.put(QueueDeclareBody.class, new SharedQueueDeclareRecorder());
- _globalRecorders.put(QueueDeleteBody.class, new SharedQueueDeleteRecorder());
- _globalRecorders.put(QueueBindBody.class, new SharedQueueBindRecorder());
- _globalRecorders.put(ExchangeDeclareBody.class, new ExchangeDeclareRecorder());
- _globalRecorders.put(ExchangeDeleteBody.class, new ExchangeDeleteRecorder());
-
- _localRecorders.put(QueueDeclareBody.class, new PrivateQueueDeclareRecorder());
- _localRecorders.put(QueueDeleteBody.class, new PrivateQueueDeleteRecorder());
- _localRecorders.put(QueueBindBody.class, new PrivateQueueBindRecorder());
- _localRecorders.put(BasicConsumeBody.class, new BasicConsumeRecorder());
- _localRecorders.put(BasicCancelBody.class, new BasicCancelRecorder());
- _localRecorders.put(ExchangeDeclareBody.class, new ExchangeDeclareRecorder());
- _localRecorders.put(ExchangeDeleteBody.class, new ExchangeDeleteRecorder());
- }
-
- public void methodReceived(AMQStateManager stateManager, AMQMethodEvent evt) throws AMQException
- {
- AMQProtocolSession session = stateManager.getProtocolSession();
- VirtualHost virtualHost = session.getVirtualHost();
-
- _logger.debug(new LogMessage("Replay store received {0}", evt.getMethod()));
- AMQMethodBody request = evt.getMethod();
-
- //allow any (relevant) recorder registered for this type of request to record it:
- MethodRecorder recorder = getRecorders(session).get(request.getClass());
- if (recorder != null)
- {
- recorder.record(request);
- }
- }
-
- private Map<Class<? extends AMQMethodBody>, MethodRecorder> getRecorders(AMQProtocolSession session)
- {
- if (ClusteredProtocolSession.isPeerSession(session))
- {
- return _globalRecorders;
- }
- else
- {
- return _localRecorders;
- }
- }
-
- public List<AMQMethodBody> replay(boolean isLeader)
- {
- List<AMQMethodBody> methods = new ArrayList<AMQMethodBody>();
- methods.addAll(_exchanges.values());
- methods.addAll(_privateQueues.values());
- synchronized(_privateBindings)
- {
- methods.addAll(_privateBindings.values());
- }
- if (isLeader)
- {
- methods.addAll(_sharedQueues.values());
- synchronized(_sharedBindings)
- {
- methods.addAll(_sharedBindings.values());
- }
- }
- _consumers.replay(methods);
- // 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.
- methods.add(new ClusterSynchBody((byte)8, (byte)0, ClusterSynchBody.getClazz((byte)8, (byte)0), ClusterSynchBody.getMethod((byte)8, (byte)0)));
- return methods;
- }
-
- private class BasicConsumeRecorder implements MethodRecorder<BasicConsumeBody>
- {
- public void record(BasicConsumeBody method)
- {
- if(_sharedQueues.containsKey(method.queue))
- {
- _consumers.increment(method.queue);
- }
- }
- }
-
- private class BasicCancelRecorder implements MethodRecorder<BasicCancelBody>
- {
- public void record(BasicCancelBody method)
- {
- if(_sharedQueues.containsKey(method.consumerTag))
- {
- _consumers.decrement(method.consumerTag);
- }
- }
- }
-
- private class SharedQueueDeclareRecorder extends QueueDeclareRecorder
- {
- SharedQueueDeclareRecorder()
- {
- super(false, _sharedQueues);
- }
- }
-
- private class PrivateQueueDeclareRecorder extends QueueDeclareRecorder
- {
- PrivateQueueDeclareRecorder()
- {
- super(true, _privateQueues, new SharedQueueDeclareRecorder());
- }
- }
-
- private class SharedQueueDeleteRecorder extends QueueDeleteRecorder
- {
- SharedQueueDeleteRecorder()
- {
- super(_sharedQueues, _sharedBindings);
- }
- }
-
- private class PrivateQueueDeleteRecorder extends QueueDeleteRecorder
- {
- PrivateQueueDeleteRecorder()
- {
- super(_privateQueues, _privateBindings, new SharedQueueDeleteRecorder());
- }
- }
-
- private class SharedQueueBindRecorder extends QueueBindRecorder
- {
- SharedQueueBindRecorder()
- {
- super(_sharedQueues, _sharedBindings);
- }
- }
-
- private class PrivateQueueBindRecorder extends QueueBindRecorder
- {
- PrivateQueueBindRecorder()
- {
- super(_privateQueues, _privateBindings, new SharedQueueBindRecorder());
- }
- }
-
-
- private static class QueueDeclareRecorder extends ChainedMethodRecorder<QueueDeclareBody>
- {
- private final boolean _exclusive;
- private final Map<AMQShortString, QueueDeclareBody> _queues;
-
- QueueDeclareRecorder(boolean exclusive, Map<AMQShortString, QueueDeclareBody> queues)
- {
- _queues = queues;
- _exclusive = exclusive;
- }
-
- QueueDeclareRecorder(boolean exclusive, Map<AMQShortString, QueueDeclareBody> queues, QueueDeclareRecorder recorder)
- {
- super(recorder);
- _queues = queues;
- _exclusive = exclusive;
- }
-
-
- protected boolean doRecord(QueueDeclareBody method)
- {
- if (_exclusive == method.exclusive)
- {
- _queues.put(method.queue, method);
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-
- private class QueueDeleteRecorder extends ChainedMethodRecorder<QueueDeleteBody>
- {
- private final Map<AMQShortString, QueueDeclareBody> _queues;
- private final Bindings<AMQShortString, AMQShortString, QueueBindBody> _bindings;
-
- QueueDeleteRecorder(Map<AMQShortString, QueueDeclareBody> queues, Bindings<AMQShortString, AMQShortString, QueueBindBody> bindings)
- {
- this(queues, bindings, null);
- }
-
- QueueDeleteRecorder(Map<AMQShortString, QueueDeclareBody> queues, Bindings<AMQShortString, AMQShortString, QueueBindBody> bindings, QueueDeleteRecorder recorder)
- {
- super(recorder);
- _queues = queues;
- _bindings = bindings;
- }
-
- protected boolean doRecord(QueueDeleteBody method)
- {
- if (_queues.remove(method.queue) != null)
- {
- _bindings.unbind1(method.queue);
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-
- private class QueueBindRecorder extends ChainedMethodRecorder<QueueBindBody>
- {
- private final Map<AMQShortString, QueueDeclareBody> _queues;
- private final Bindings<AMQShortString, AMQShortString, QueueBindBody> _bindings;
-
- QueueBindRecorder(Map<AMQShortString, QueueDeclareBody> queues, Bindings<AMQShortString, AMQShortString, QueueBindBody> bindings)
- {
- _queues = queues;
- _bindings = bindings;
- }
-
- QueueBindRecorder(Map<AMQShortString, QueueDeclareBody> queues, Bindings<AMQShortString, AMQShortString, QueueBindBody> bindings, QueueBindRecorder recorder)
- {
- super(recorder);
- _queues = queues;
- _bindings = bindings;
- }
-
- protected boolean doRecord(QueueBindBody method)
- {
- if (_queues.containsKey(method.queue))
- {
- _bindings.bind(method.queue, method.exchange, method);
- return true;
- }
- else
- {
- return false;
- }
- }
- }
-
- private class ExchangeDeclareRecorder implements MethodRecorder<ExchangeDeclareBody>
- {
- public void record(ExchangeDeclareBody method)
- {
- _exchanges.put(method.exchange, method);
- }
- }
-
- private class ExchangeDeleteRecorder implements MethodRecorder<ExchangeDeleteBody>
- {
- public void record(ExchangeDeleteBody method)
- {
- _exchanges.remove(method.exchange);
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/Bindings.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/Bindings.java
deleted file mode 100644
index 49de0a7cbf..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/Bindings.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.server.cluster.util;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-
-/**
- * Maps two separate keys to a list of values.
- *
- */
-public class Bindings<K1, K2, V>
-{
- private final MultiValuedMap<K1, Binding<K2>> _a = new MultiValuedMap<K1, Binding<K2>>();
- private final MultiValuedMap<K2, Binding<K1>> _b = new MultiValuedMap<K2, Binding<K1>>();
- private final Collection<V> _values = new HashSet<V>();
-
- public void bind(K1 key1, K2 key2, V value)
- {
- _a.add(key1, new Binding<K2>(key2, value));
- _b.add(key2, new Binding<K1>(key1, value));
- _values.add(value);
- }
-
- public void unbind1(K1 key1)
- {
- Collection<Binding<K2>> values = _a.remove(key1);
- for (Binding<K2> v : values)
- {
- _b.remove(v.key);
- _values.remove(v.value);
- }
- }
-
- public void unbind2(K2 key2)
- {
- Collection<Binding<K1>> values = _b.remove(key2);
- for (Binding<K1> v : values)
- {
- _a.remove(v.key);
- _values.remove(v.value);
- }
- }
-
- public Collection<V> values()
- {
- return Collections.unmodifiableCollection(_values);
- }
-
- /**
- * Value needs to hold key to the other map
- */
- private class Binding<T>
- {
- private final T key;
- private final V value;
-
- Binding(T key, V value)
- {
- this.key = key;
- this.value = value;
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/InvokeMultiple.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/InvokeMultiple.java
deleted file mode 100644
index 406fe45701..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/InvokeMultiple.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.cluster.util;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Set;
-import java.util.HashSet;
-
-/**
- * Allows a method to be invoked on a list of listeners with one call
- *
- */
-public class InvokeMultiple <T> implements InvocationHandler
-{
- private final Set<T> _targets = new HashSet<T>();
- private final T _proxy;
-
- public InvokeMultiple(Class<? extends T> type)
- {
- _proxy = (T) Proxy.newProxyInstance(type.getClassLoader(), new Class[]{type}, this);
- }
-
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
- {
- Set<T> targets;
- synchronized(this)
- {
- targets = new HashSet<T>(_targets);
- }
-
- for(T target : targets)
- {
- method.invoke(target, args);
- }
- return null;
- }
-
- public synchronized void addListener(T t)
- {
- _targets.add(t);
- }
-
- public synchronized void removeListener(T t)
- {
- _targets.remove(t);
- }
-
- public T getProxy()
- {
- return _proxy;
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/LogMessage.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/LogMessage.java
deleted file mode 100644
index 9be90298ea..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/LogMessage.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.cluster.util;
-
-import java.text.MessageFormat;
-
-/**
- * Convenience class to allow log messages to be specified in terms
- * of MessageFormat patterns with a variable set of parameters. The
- * production of the string is only done if toSTring is called so it
- * works well with debug level messages, allowing complex messages
- * to be specified that are only evaluated if actually printed.
- *
- */
-public class LogMessage
-{
- private final String _message;
- private final Object[] _args;
-
- public LogMessage(String message)
- {
- this(message, new Object[0]);
- }
-
- public LogMessage(String message, Object... args)
- {
- _message = message;
- _args = args;
- }
-
- public String toString()
- {
- return MessageFormat.format(_message, _args);
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/MultiValuedMap.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/MultiValuedMap.java
deleted file mode 100644
index ebe1fe47dd..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/cluster/util/MultiValuedMap.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.cluster.util;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * Maps a key to a collection of values
- *
- */
-public class MultiValuedMap<K, V>
-{
- private Map<K, Collection<V>> _map = new HashMap<K, Collection<V>>();
-
- public boolean add(K key, V value)
- {
- Collection<V> values = get(key);
- if (values == null)
- {
- values = createList();
- _map.put(key, values);
- }
- return values.add(value);
- }
-
- public Collection<V> get(K key)
- {
- return _map.get(key);
- }
-
- public Collection<V> remove(K key)
- {
- return _map.remove(key);
- }
-
- protected Collection<V> createList()
- {
- return new ArrayList<V>();
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredQueue.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredQueue.java
deleted file mode 100644
index 9fa96ece1e..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredQueue.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.server.queue;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicCancelBody;
-import org.apache.qpid.framing.QueueDeleteBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.cluster.*;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.util.concurrent.ConcurrentHashMap;
-
-/**
- * Represents a shared queue in a cluster. The key difference is that as well as any
- * local consumers, there may be consumers for this queue on other members of the
- * cluster.
- *
- */
-public class ClusteredQueue extends AMQQueue
-{
- private static final Logger _logger = Logger.getLogger(ClusteredQueue.class);
- private final ConcurrentHashMap<SimpleMemberHandle, RemoteSubscriptionImpl> _peers = new ConcurrentHashMap<SimpleMemberHandle, RemoteSubscriptionImpl>();
- private final GroupManager _groupMgr;
- private final NestedSubscriptionManager _subscriptions;
-
- public ClusteredQueue(GroupManager groupMgr, AMQShortString name, boolean durable, AMQShortString owner, boolean autoDelete, VirtualHost virtualHost)
- throws AMQException
- {
- super(name, durable, owner, autoDelete, virtualHost, new ClusteredSubscriptionManager());
- _groupMgr = groupMgr;
- _subscriptions = ((ClusteredSubscriptionManager) getSubscribers()).getAllSubscribers();
- }
-
-
- public void process(StoreContext storeContext, AMQMessage msg, boolean deliverFirst) throws AMQException
- {
- _logger.info(new LogMessage("{0} delivered to clustered queue {1}", msg, this));
- super.process(storeContext, msg, deliverFirst);
- }
-
- protected void autodelete() throws AMQException
- {
- if(!_subscriptions.hasActiveSubscribers())
- {
- //delete locally:
- delete();
-
- //send deletion request to all other members:
- // 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.
- QueueDeleteBody request = new QueueDeleteBody((byte)8,
- (byte)0,
- QueueDeleteBody.getClazz((byte)8,(byte)0),
- QueueDeleteBody.getMethod((byte)8,(byte)0),
- false,
- false,
- false,
- getName(),
- 0);
-
- _groupMgr.broadcast(new SimpleBodySendable(request));
- }
- }
-
- public void unregisterProtocolSession(AMQProtocolSession ps, int channel, AMQShortString consumerTag) throws AMQException
- {
- //handle locally:
- super.unregisterProtocolSession(ps, channel, consumerTag);
-
- //signal other members:
- // 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.
- BasicCancelBody request = new BasicCancelBody((byte)8,
- (byte)0,
- BasicCancelBody.getClazz((byte)8, (byte)0),
- BasicCancelBody.getMethod((byte)8, (byte)0),
- getName(),
- false);
-
- _groupMgr.broadcast(new SimpleBodySendable(request));
- }
-
- public void addRemoteSubcriber(MemberHandle peer)
- {
- _logger.info(new LogMessage("Added remote subscriber for {0} to clustered queue {1}", peer, this));
- //find (or create) a matching subscriber for the peer then increment the count
- getSubscriber(key(peer), true).increment();
- }
-
- public void removeRemoteSubscriber(MemberHandle peer)
- {
- //find a matching subscriber for the peer then decrement the count
- //if count is now zero, remove the subscriber
- SimpleMemberHandle key = key(peer);
- RemoteSubscriptionImpl s = getSubscriber(key, true);
- if (s == null)
- {
- throw new RuntimeException("No subscriber for " + peer);
- }
- if (s.decrement())
- {
- _peers.remove(key);
- _subscriptions.removeSubscription(s);
- }
- }
-
- public void removeAllRemoteSubscriber(MemberHandle peer)
- {
- SimpleMemberHandle key = key(peer);
- RemoteSubscriptionImpl s = getSubscriber(key, true);
- _peers.remove(key);
- _subscriptions.removeSubscription(s);
- }
-
- private RemoteSubscriptionImpl getSubscriber(SimpleMemberHandle key, boolean create)
- {
- RemoteSubscriptionImpl s = _peers.get(key);
- if (s == null && create)
- {
- return addSubscriber(key, new RemoteSubscriptionImpl(_groupMgr, key));
- }
- else
- {
- return s;
- }
- }
-
- private RemoteSubscriptionImpl addSubscriber(SimpleMemberHandle key, RemoteSubscriptionImpl s)
- {
- RemoteSubscriptionImpl other = _peers.putIfAbsent(key, s);
- if (other == null)
- {
- _subscriptions.addSubscription(s);
- new SubscriberCleanup(key, this, _groupMgr);
- return s;
- }
- else
- {
- return other;
- }
- }
-
- private SimpleMemberHandle key(MemberHandle peer)
- {
- return peer instanceof SimpleMemberHandle ? (SimpleMemberHandle) peer : (SimpleMemberHandle) SimpleMemberHandle.resolve(peer);
- }
-
- static boolean isFromBroker(AMQMessage msg)
- {
- return ClusteredProtocolSession.isPayloadFromPeer(msg);
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredSubscriptionManager.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredSubscriptionManager.java
deleted file mode 100644
index 39ae7e3c3e..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/ClusteredSubscriptionManager.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.server.queue;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.server.cluster.util.LogMessage;
-
-import java.util.List;
-
-class ClusteredSubscriptionManager extends SubscriptionSet
-{
- private static final Logger _logger = Logger.getLogger(ClusteredSubscriptionManager.class);
- private final NestedSubscriptionManager _all;
-
- ClusteredSubscriptionManager()
- {
- this(new NestedSubscriptionManager());
- }
-
- private ClusteredSubscriptionManager(NestedSubscriptionManager all)
- {
- _all = all;
- _all.addSubscription(new Parent());
- }
-
- NestedSubscriptionManager getAllSubscribers()
- {
- return _all;
- }
-
- public boolean hasActiveSubscribers()
- {
- return _all.hasActiveSubscribers();
- }
-
- public Subscription nextSubscriber(AMQMessage msg)
- {
- if(ClusteredQueue.isFromBroker(msg))
- {
- //if message is from another broker, it should only be delivered
- //to another client to meet ordering constraints
- Subscription s = super.nextSubscriber(msg);
- _logger.info(new LogMessage("Returning next *client* subscriber {0}", s));
- if(s == null)
- {
- //TODO: deliver to another broker, but set the redelivered flag on the msg
- //(this should be policy based)
-
- //for now just don't deliver it
- return null;
- }
- else
- {
- return s;
- }
- }
- Subscription s = _all.nextSubscriber(msg);
- _logger.info(new LogMessage("Returning next subscriber {0}", s));
- return s;
- }
-
- private class Parent implements WeightedSubscriptionManager
- {
- public int getWeight()
- {
- return ClusteredSubscriptionManager.this.getWeight();
- }
-
- public List<Subscription> getSubscriptions()
- {
- return ClusteredSubscriptionManager.super.getSubscriptions();
- }
-
- public boolean hasActiveSubscribers()
- {
- return ClusteredSubscriptionManager.super.hasActiveSubscribers();
- }
-
- public Subscription nextSubscriber(AMQMessage msg)
- {
- return ClusteredSubscriptionManager.super.nextSubscriber(msg);
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/NestedSubscriptionManager.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/NestedSubscriptionManager.java
deleted file mode 100644
index 0566c5203b..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/NestedSubscriptionManager.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.queue;
-
-import java.util.List;
-import java.util.LinkedList;
-import java.util.concurrent.CopyOnWriteArrayList;
-
-/**
- * Distributes messages among a list of subsscription managers, using their
- * weighting.
- */
-class NestedSubscriptionManager implements SubscriptionManager
-{
- private final List<WeightedSubscriptionManager> _subscribers = new CopyOnWriteArrayList<WeightedSubscriptionManager>();
- private int _iterations;
- private int _index;
-
- void addSubscription(WeightedSubscriptionManager s)
- {
- _subscribers.add(s);
- }
-
- void removeSubscription(WeightedSubscriptionManager s)
- {
- _subscribers.remove(s);
- }
-
-
- public List<Subscription> getSubscriptions()
- {
- List<Subscription> allSubs = new LinkedList<Subscription>();
-
- for (WeightedSubscriptionManager subMans : _subscribers)
- {
- allSubs.addAll(subMans.getSubscriptions());
- }
-
- return allSubs;
- }
-
- public boolean hasActiveSubscribers()
- {
- for (WeightedSubscriptionManager s : _subscribers)
- {
- if (s.hasActiveSubscribers())
- {
- return true;
- }
- }
- return false;
- }
-
- public Subscription nextSubscriber(AMQMessage msg)
- {
- WeightedSubscriptionManager start = current();
- for (WeightedSubscriptionManager s = start; s != null; s = next(start))
- {
- if (hasMore(s))
- {
- return nextSubscriber(s);
- }
- }
- return null;
- }
-
- private Subscription nextSubscriber(WeightedSubscriptionManager s)
- {
- _iterations++;
- return s.nextSubscriber(null);
- }
-
- private WeightedSubscriptionManager current()
- {
- return _subscribers.isEmpty() ? null : _subscribers.get(_index);
- }
-
- private boolean hasMore(WeightedSubscriptionManager s)
- {
- return _iterations < s.getWeight();
- }
-
- private WeightedSubscriptionManager next(WeightedSubscriptionManager start)
- {
- WeightedSubscriptionManager s = next();
- return s == start && !hasMore(s) ? null : s;
- }
-
- private WeightedSubscriptionManager next()
- {
- _iterations = 0;
- if (++_index >= _subscribers.size())
- {
- _index = 0;
- }
- return _subscribers.get(_index);
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/PrivateQueue.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/PrivateQueue.java
deleted file mode 100644
index f8e4311a77..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/PrivateQueue.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.server.queue;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.server.cluster.SimpleSendable;
-import org.apache.qpid.server.cluster.GroupManager;
-import org.apache.qpid.server.cluster.SimpleBodySendable;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-import org.apache.qpid.framing.QueueDeleteBody;
-import org.apache.qpid.framing.AMQShortString;
-
-import java.util.concurrent.Executor;
-
-/**
- * Used to represent a private queue held locally.
- *
- */
-public class PrivateQueue extends AMQQueue
-{
- private final GroupManager _groupMgr;
-
- public PrivateQueue(GroupManager groupMgr, AMQShortString name, boolean durable, AMQShortString owner, boolean autoDelete, VirtualHost virtualHost)
- throws AMQException
- {
- super(name, durable, owner, autoDelete, virtualHost);
- _groupMgr = groupMgr;
-
- }
-
- protected void autodelete() throws AMQException
- {
- //delete locally:
- super.autodelete();
-
- //send delete request to peers:
- // 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.
- QueueDeleteBody request = new QueueDeleteBody((byte)8, (byte)0,
- QueueDeleteBody.getClazz((byte)8, (byte)0),
- QueueDeleteBody.getMethod((byte)8, (byte)0),
- false,false,false,null,0);
- request.queue = getName();
- _groupMgr.broadcast(new SimpleBodySendable(request));
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/ProxiedQueueCleanup.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/ProxiedQueueCleanup.java
deleted file mode 100644
index efc0540c18..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/ProxiedQueueCleanup.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.queue;
-
-import org.apache.qpid.server.cluster.MembershipChangeListener;
-import org.apache.qpid.server.cluster.MemberHandle;
-import org.apache.qpid.server.cluster.GroupManager;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.qpid.AMQException;
-import org.apache.log4j.Logger;
-
-import java.util.List;
-
-class ProxiedQueueCleanup implements MembershipChangeListener
-{
- private static final Logger _logger = Logger.getLogger(ProxiedQueueCleanup.class);
-
- private final MemberHandle _subject;
- private final RemoteQueueProxy _queue;
-
- ProxiedQueueCleanup(MemberHandle subject, RemoteQueueProxy queue)
- {
- _subject = subject;
- _queue = queue;
- }
-
- public void changed(List<MemberHandle> members)
- {
- if(!members.contains(_subject))
- {
- try
- {
- _queue.delete();
- _logger.info(new LogMessage("Deleted {0} in response to exclusion of {1}", _queue, _subject));
- }
- catch (AMQException e)
- {
- _logger.info(new LogMessage("Failed to delete {0} in response to exclusion of {1}: {2}", _queue, _subject, e), e);
- }
- }
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/RemoteQueueProxy.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/RemoteQueueProxy.java
deleted file mode 100644
index 2a83d65ae5..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/RemoteQueueProxy.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.server.queue;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.cluster.ClusteredProtocolSession;
-import org.apache.qpid.server.cluster.GroupManager;
-import org.apache.qpid.server.cluster.MemberHandle;
-import org.apache.qpid.server.cluster.SimpleSendable;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-/**
- * TODO: separate out an abstract base class from AMQQueue from which this inherits. It does
- * not require all the functionality currently in AMQQueue.
- *
- */
-public class RemoteQueueProxy extends AMQQueue
-{
- private static final Logger _logger = Logger.getLogger(RemoteQueueProxy.class);
- private final MemberHandle _target;
- private final GroupManager _groupMgr;
-
- public RemoteQueueProxy(MemberHandle target, GroupManager groupMgr, AMQShortString name, boolean durable, AMQShortString owner, boolean autoDelete, VirtualHost virtualHost)
- throws AMQException
- {
- super(name, durable, owner, autoDelete, virtualHost);
- _target = target;
- _groupMgr = groupMgr;
- _groupMgr.addMemberhipChangeListener(new ProxiedQueueCleanup(target, this));
- }
-
-
- public void deliver(AMQMessage msg) throws NoConsumersException
- {
- if (ClusteredProtocolSession.canRelay(msg, _target))
- {
- try
- {
- _logger.debug(new LogMessage("Relaying {0} to {1}", msg, _target));
- relay(msg);
- }
- catch (NoConsumersException e)
- {
- throw e;
- }
- catch (AMQException e)
- {
- //TODO: sort out exception handling...
- e.printStackTrace();
- }
- }
- else
- {
- _logger.debug(new LogMessage("Cannot relay {0} to {1}", msg, _target));
- }
- }
-
- void relay(AMQMessage msg) throws AMQException
- {
- // TODO FIXME - can no longer update the publish body as it is an opaque wrapper object
- // if cluster can handle immediate then it should wrap the wrapper...
-
-// BasicPublishBody publish = msg.getMessagePublishInfo();
-// publish.immediate = false; //can't as yet handle the immediate flag in a cluster
-
- // send this on to the broker for which it is acting as proxy:
- _groupMgr.send(_target, new SimpleSendable(msg));
- }
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/RemoteSubscriptionImpl.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/RemoteSubscriptionImpl.java
deleted file mode 100644
index e396432cea..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/RemoteSubscriptionImpl.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.server.queue;
-
-import org.apache.qpid.server.cluster.MemberHandle;
-import org.apache.qpid.server.cluster.GroupManager;
-import org.apache.qpid.server.cluster.SimpleSendable;
-import org.apache.qpid.server.AMQChannel;
-import org.apache.qpid.AMQException;
-
-import java.util.Queue;
-import java.util.List;
-
-class RemoteSubscriptionImpl implements Subscription, WeightedSubscriptionManager
-{
- private final GroupManager _groupMgr;
- private final MemberHandle _peer;
- private boolean _suspended;
- private int _count;
-
- RemoteSubscriptionImpl(GroupManager groupMgr, MemberHandle peer)
- {
- _groupMgr = groupMgr;
- _peer = peer;
- }
-
- synchronized void increment()
- {
- _count++;
- }
-
- synchronized boolean decrement()
- {
- return --_count <= 0;
- }
-
- public void send(AMQMessage msg, AMQQueue queue)
- {
- try
- {
- _groupMgr.send(_peer, new SimpleSendable(msg));
- }
- catch (AMQException e)
- {
- //TODO: handle exceptions properly...
- e.printStackTrace();
- }
- }
-
- public synchronized void setSuspended(boolean suspended)
- {
- _suspended = suspended;
- }
-
- public synchronized boolean isSuspended()
- {
- return _suspended;
- }
-
- public synchronized int getWeight()
- {
- return _count;
- }
-
- public List<Subscription> getSubscriptions()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public boolean hasActiveSubscribers()
- {
- return getWeight() == 0;
- }
-
- public Subscription nextSubscriber(AMQMessage msg)
- {
- return this;
- }
-
- public void queueDeleted(AMQQueue queue)
- {
- if (queue instanceof ClusteredQueue)
- {
- ((ClusteredQueue) queue).removeAllRemoteSubscriber(_peer);
- }
- }
-
- public boolean filtersMessages()
- {
- return false;
- }
-
- public boolean hasInterest(AMQMessage msg)
- {
- return true;
- }
-
- public Queue<AMQMessage> getPreDeliveryQueue()
- {
- return null;
- }
-
- public Queue<AMQMessage> getResendQueue()
- {
- return null;
- }
-
- public Queue<AMQMessage> getNextQueue(Queue<AMQMessage> messages)
- {
- return messages;
- }
-
- public void enqueueForPreDelivery(AMQMessage msg, boolean deliverFirst)
- {
- //no-op -- if selectors are implemented on RemoteSubscriptions then look at SubscriptionImpl
- }
-
- public boolean isAutoClose()
- {
- return false;
- }
-
- public void close()
- {
- //no-op
- }
-
- public boolean isClosed()
- {
- return false;
- }
-
- public boolean isBrowser()
- {
- return false;
- }
-
- public boolean wouldSuspend(AMQMessage msg)
- {
- return _suspended;
- }
-
- public void addToResendQueue(AMQMessage msg)
- {
- //no-op
- }
-
- public Object getSendLock()
- {
- return new Object();
- }
-
- public AMQChannel getChannel()
- {
- return null;
- }
-
-}
diff --git a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/SubscriberCleanup.java b/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/SubscriberCleanup.java
deleted file mode 100644
index cc951a4709..0000000000
--- a/Final/java/cluster/src/main/java/org/apache/qpid/server/queue/SubscriberCleanup.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 org.apache.qpid.server.cluster.MembershipChangeListener;
-import org.apache.qpid.server.cluster.MemberHandle;
-import org.apache.qpid.server.cluster.GroupManager;
-import org.apache.qpid.server.cluster.util.LogMessage;
-import org.apache.log4j.Logger;
-
-import java.util.List;
-
-class SubscriberCleanup implements MembershipChangeListener
-{
- private static final Logger _logger = Logger.getLogger(SubscriberCleanup.class);
-
- private final MemberHandle _subject;
- private final ClusteredQueue _queue;
- private final GroupManager _manager;
-
- SubscriberCleanup(MemberHandle subject, ClusteredQueue queue, GroupManager manager)
- {
- _subject = subject;
- _queue = queue;
- _manager = manager;
- _manager.addMemberhipChangeListener(this);
- }
-
- public void changed(List<MemberHandle> members)
- {
- if(!members.contains(_subject))
- {
- _queue.removeAllRemoteSubscriber(_subject);
- _manager.removeMemberhipChangeListener(this);
- _logger.info(new LogMessage("Removed {0} from {1}", _subject, _queue));
- }
- }
-}
diff --git a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerGroupTest.java b/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerGroupTest.java
deleted file mode 100644
index b91d7140e0..0000000000
--- a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerGroupTest.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.server.cluster;
-
-import junit.framework.TestCase;
-
-import java.io.IOException;
-import java.util.Arrays;
-
-public class BrokerGroupTest extends TestCase
-{
- private final MemberHandle a = new SimpleMemberHandle("A", 1);
- private final MemberHandle b = new SimpleMemberHandle("B", 1);
- private final MemberHandle c = new SimpleMemberHandle("C", 1);
- private final MemberHandle d = new SimpleMemberHandle("D", 1);
-
- //join (new members perspective)
- // (i) connectToLeader()
- // ==> check state
- // (ii) setMembers()
- // ==> check state
- // ==> check members
- // (iii) synched(leader)
- // ==> check state
- // ==> check peers
- // (iv) synched(other)
- // ==> check state
- // ==> check peers
- // repeat for all others
- public void testJoin_newMember() throws Exception
- {
- MemberHandle[] pre = new MemberHandle[]{a, b, c};
- MemberHandle[] post = new MemberHandle[]{a, b, c};
-
- BrokerGroup group = new BrokerGroup(d, new TestReplayManager(), new TestBrokerFactory());
- assertEquals(JoinState.UNINITIALISED, group.getState());
- //(i)
- group.connectToLeader(a);
- assertEquals(JoinState.JOINING, group.getState());
- assertEquals("Wrong number of peers", 1, group.getPeers().size());
- //(ii)
- group.setMembers(Arrays.asList(post));
- assertEquals(JoinState.INITIATION, group.getState());
- assertEquals(Arrays.asList(post), group.getMembers());
- //(iii) & (iv)
- for (MemberHandle member : pre)
- {
- group.synched(member);
- if (member == c)
- {
- assertEquals(JoinState.JOINED, group.getState());
- assertEquals("Wrong number of peers", pre.length, group.getPeers().size());
- }
- else
- {
- assertEquals(JoinState.INDUCTION, group.getState());
- assertEquals("Wrong number of peers", 1, group.getPeers().size());
- }
- }
- }
-
- //join (leaders perspective)
- // (i) extablish()
- // ==> check state
- // ==> check members
- // ==> check peers
- // (ii) connectToProspect()
- // ==> check members
- // ==> check peers
- // repeat (ii)
- public void testJoin_Leader() throws IOException, InterruptedException
- {
- MemberHandle[] prospects = new MemberHandle[]{b, c, d};
-
- BrokerGroup group = new BrokerGroup(a, new TestReplayManager(), new TestBrokerFactory());
- assertEquals(JoinState.UNINITIALISED, group.getState());
- //(i)
- group.establish();
- assertEquals(JoinState.JOINED, group.getState());
- assertEquals("Wrong number of peers", 0, group.getPeers().size());
- assertEquals("Wrong number of members", 1, group.getMembers().size());
- assertEquals(a, group.getMembers().get(0));
- //(ii)
- for (int i = 0; i < prospects.length; i++)
- {
- group.connectToProspect(prospects[i]);
- assertEquals("Wrong number of peers", i + 1, group.getPeers().size());
- for (int j = 0; j <= i; j++)
- {
- assertTrue(prospects[i].matches(group.getPeers().get(i)));
- }
- assertEquals("Wrong number of members", i + 2, group.getMembers().size());
- assertEquals(a, group.getMembers().get(0));
- for (int j = 0; j <= i; j++)
- {
- assertEquals(prospects[i], group.getMembers().get(i + 1));
- }
- }
- }
-
- //join (general perspective)
- // (i) set up group
- // (ii) setMembers()
- // ==> check members
- // ==> check peers
- public void testJoin_general() throws Exception
- {
- MemberHandle[] view1 = new MemberHandle[]{a, b, c};
- MemberHandle[] view2 = new MemberHandle[]{a, b, c, d};
- MemberHandle[] peers = new MemberHandle[]{a, b, d};
-
- BrokerGroup group = new BrokerGroup(c, new TestReplayManager(), new TestBrokerFactory());
- //(i)
- group.connectToLeader(a);
- group.setMembers(Arrays.asList(view1));
- for (MemberHandle h : view1)
- {
- group.synched(h);
- }
- //(ii)
- group.setMembers(Arrays.asList(view2));
- assertEquals(Arrays.asList(view2), group.getMembers());
- assertEquals(peers.length, group.getPeers().size());
- for (int i = 0; i < peers.length; i++)
- {
- assertTrue(peers[i].matches(group.getPeers().get(i)));
- }
- }
-
- //leadership transfer (valid)
- // (i) set up group
- // (ii) assumeLeadership()
- // ==> check return value
- // ==> check members
- // ==> check peers
- // ==> check isLeader()
- // ==> check isLeader(old_leader)
- // ==> check isMember(old_leader)
- public void testTransferLeadership_valid() throws Exception
- {
- MemberHandle[] view1 = new MemberHandle[]{a, b};
- MemberHandle[] view2 = new MemberHandle[]{a, b, c, d};
- MemberHandle[] view3 = new MemberHandle[]{b, c, d};
-
- BrokerGroup group = new BrokerGroup(b, new TestReplayManager(), new TestBrokerFactory());
- //(i)
- group.connectToLeader(a);
- group.setMembers(Arrays.asList(view1));
- for (MemberHandle h : view1)
- {
- group.synched(h);
- }
- group.setMembers(Arrays.asList(view2));
- //(ii)
- boolean result = group.assumeLeadership();
- assertTrue(result);
- assertTrue(group.isLeader());
- assertFalse(group.isLeader(a));
- assertEquals(Arrays.asList(view3), group.getMembers());
- assertEquals(2, group.getPeers().size());
- assertTrue(c.matches(group.getPeers().get(0)));
- assertTrue(d.matches(group.getPeers().get(1)));
- }
-
- //leadership transfer (invalid)
- // (i) set up group
- // (ii) assumeLeadership()
- // ==> check return value
- // ==> check members
- // ==> check peers
- // ==> check isLeader()
- // ==> check isLeader(old_leader)
- // ==> check isMember(old_leader)
- public void testTransferLeadership_invalid() throws Exception
- {
- MemberHandle[] view1 = new MemberHandle[]{a, b, c};
- MemberHandle[] view2 = new MemberHandle[]{a, b, c, d};
-
- BrokerGroup group = new BrokerGroup(c, new TestReplayManager(), new TestBrokerFactory());
- //(i)
- group.connectToLeader(a);
- group.setMembers(Arrays.asList(view1));
- for (MemberHandle h : view1)
- {
- group.synched(h);
- }
- group.setMembers(Arrays.asList(view2));
- //(ii)
- boolean result = group.assumeLeadership();
- assertFalse(result);
- assertFalse(group.isLeader());
- assertTrue(group.isLeader(a));
- assertEquals(Arrays.asList(view2), group.getMembers());
- assertEquals(3, group.getPeers().size());
- assertTrue(a.matches(group.getPeers().get(0)));
- assertTrue(b.matches(group.getPeers().get(1)));
- assertTrue(d.matches(group.getPeers().get(2)));
-
- }
-
- //leave (leaders perspective)
- // (i) set up group
- // (ii) remove a member
- // ==> check members
- // ==> check peers
- // ==> check isMember(removed_member)
- // repeat (ii)
- public void testLeave_leader()
- {
- MemberHandle[] view1 = new MemberHandle[]{a, b, c, d};
- MemberHandle[] view2 = new MemberHandle[]{a, b, d};
- MemberHandle[] view3 = new MemberHandle[]{a, d};
- MemberHandle[] view4 = new MemberHandle[]{a};
- //(i)
- BrokerGroup group = new BrokerGroup(a, new TestReplayManager(), new TestBrokerFactory());
- group.establish();
- group.setMembers(Arrays.asList(view1));
- //(ii)
- group.remove(group.findBroker(c, false));
- assertEquals(Arrays.asList(view2), group.getMembers());
-
- group.remove(group.findBroker(b, false));
- assertEquals(Arrays.asList(view3), group.getMembers());
-
- group.remove(group.findBroker(d, false));
- assertEquals(Arrays.asList(view4), group.getMembers());
- }
-
-
- //leave (general perspective)
- // (i) set up group
- // (ii) setMember
- // ==> check members
- // ==> check peers
- // ==> check isMember(removed_member)
- // repeat (ii)
- public void testLeave_general()
- {
- MemberHandle[] view1 = new MemberHandle[]{a, b, c, d};
- MemberHandle[] view2 = new MemberHandle[]{a, c, d};
- //(i)
- BrokerGroup group = new BrokerGroup(c, new TestReplayManager(), new TestBrokerFactory());
- group.establish(); //not strictly the correct way to build up the group, but ok for here
- group.setMembers(Arrays.asList(view1));
- //(ii)
- group.setMembers(Arrays.asList(view2));
- assertEquals(Arrays.asList(view2), group.getMembers());
- assertEquals(2, group.getPeers().size());
- assertTrue(a.matches(group.getPeers().get(0)));
- assertTrue(d.matches(group.getPeers().get(1)));
- }
-}
diff --git a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerTest.java b/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerTest.java
deleted file mode 100644
index f1da312eea..0000000000
--- a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerTest.java
+++ /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.
- *
- */
-package org.apache.qpid.server.cluster;
-
-import junit.framework.TestCase;
-import org.apache.mina.common.ByteBuffer;
-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.AMQFrameDecodingException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.cluster.policy.StandardPolicies;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-public class BrokerTest extends TestCase
-{
- //group request (no failure)
- public void testGroupRequest_noFailure() throws AMQException
- {
- RecordingBroker[] brokers = new RecordingBroker[]{
- new RecordingBroker("A", 1),
- new RecordingBroker("B", 2),
- new RecordingBroker("C", 3)
- };
- GroupResponseValidator handler = new GroupResponseValidator(new TestMethod("response"), new ArrayList<Member>(Arrays.asList(brokers)));
- GroupRequest grpRequest = new GroupRequest(new SimpleBodySendable(new TestMethod("request")), StandardPolicies.SYNCH_POLICY, handler);
- for (Broker b : brokers)
- {
- b.invoke(grpRequest);
- }
- grpRequest.finishedSend();
-
- for (RecordingBroker b : brokers)
- {
- b.handleResponse(((AMQFrame) b.getMessages().get(0)).getChannel(), new TestMethod("response"));
- }
-
- assertTrue("Handler did not receive response", handler.isCompleted());
- }
-
- //group request (failure)
- public void testGroupRequest_failure() throws AMQException
- {
- RecordingBroker a = new RecordingBroker("A", 1);
- RecordingBroker b = new RecordingBroker("B", 2);
- RecordingBroker c = new RecordingBroker("C", 3);
- RecordingBroker[] all = new RecordingBroker[]{a, b, c};
- RecordingBroker[] succeeded = new RecordingBroker[]{a, c};
-
- GroupResponseValidator handler = new GroupResponseValidator(new TestMethod("response"), new ArrayList<Member>(Arrays.asList(succeeded)));
- GroupRequest grpRequest = new GroupRequest(new SimpleBodySendable(new TestMethod("request")), StandardPolicies.SYNCH_POLICY, handler);
-
- for (Broker broker : all)
- {
- broker.invoke(grpRequest);
- }
- grpRequest.finishedSend();
-
- for (RecordingBroker broker : succeeded)
- {
- broker.handleResponse(((AMQFrame) broker.getMessages().get(0)).getChannel(), new TestMethod("response"));
- }
- b.remove();
-
- assertTrue("Handler did not receive response", handler.isCompleted());
- }
-
-
- //simple send (no response)
- public void testSend_noResponse() throws AMQException
- {
- AMQBody[] msgs = new AMQBody[]{
- new TestMethod("A"),
- new TestMethod("B"),
- new TestMethod("C")
- };
- RecordingBroker broker = new RecordingBroker("myhost", 1);
- for (AMQBody msg : msgs)
- {
- broker.send(new SimpleBodySendable(msg), null);
- }
- List<AMQDataBlock> sent = broker.getMessages();
- assertEquals(msgs.length, sent.size());
- for (int i = 0; i < msgs.length; i++)
- {
- assertTrue(sent.get(i) instanceof AMQFrame);
- assertEquals(msgs[i], ((AMQFrame) sent.get(i)).getBodyFrame());
- }
- }
-
- //simple send (no failure)
- public void testSend_noFailure() throws AMQException
- {
- RecordingBroker broker = new RecordingBroker("myhost", 1);
- BlockingHandler handler = new BlockingHandler();
- broker.send(new SimpleBodySendable(new TestMethod("A")), handler);
- List<AMQDataBlock> sent = broker.getMessages();
- assertEquals(1, sent.size());
- assertTrue(sent.get(0) instanceof AMQFrame);
- assertEquals(new TestMethod("A"), ((AMQFrame) sent.get(0)).getBodyFrame());
-
- broker.handleResponse(((AMQFrame) sent.get(0)).getChannel(), new TestMethod("B"));
-
- assertEquals(new TestMethod("B"), handler.getResponse());
- }
-
- //simple send (failure)
- public void testSend_failure() throws AMQException
- {
- RecordingBroker broker = new RecordingBroker("myhost", 1);
- BlockingHandler handler = new BlockingHandler();
- broker.send(new SimpleBodySendable(new TestMethod("A")), handler);
- List<AMQDataBlock> sent = broker.getMessages();
- assertEquals(1, sent.size());
- assertTrue(sent.get(0) instanceof AMQFrame);
- assertEquals(new TestMethod("A"), ((AMQFrame) sent.get(0)).getBodyFrame());
- broker.remove();
- assertEquals(null, handler.getResponse());
- assertTrue(handler.isCompleted());
- assertTrue(handler.failed());
- }
-
- private static class TestMethod extends AMQMethodBody
- {
- private final Object id;
-
- TestMethod(Object id)
- {
- // 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.
- super((byte)8, (byte)0);
- this.id = id;
- }
-
- protected int getBodySize()
- {
- return 0;
- }
-
- protected int getClazz()
- {
- return 1002;
- }
-
- protected int getMethod()
- {
- return 1003;
- }
-
- protected void writeMethodPayload(ByteBuffer buffer)
- {
- }
-
- protected byte getType()
- {
- return 0;
- }
-
- protected int getSize()
- {
- return 0;
- }
-
- protected void writePayload(ByteBuffer buffer)
- {
- }
-
- protected void populateMethodBodyFromBuffer(ByteBuffer buffer) throws AMQFrameDecodingException
- {
- }
-
- protected void populateFromBuffer(ByteBuffer buffer, long size) throws AMQFrameDecodingException
- {
- }
-
- public boolean equals(Object o)
- {
- return o instanceof TestMethod && id.equals(((TestMethod) o).id);
- }
-
- public int hashCode()
- {
- return id.hashCode();
- }
-
- }
-
- private static class GroupResponseValidator implements GroupResponseHandler
- {
- private final AMQMethodBody _response;
- private final List<Member> _members;
- private boolean _completed = false;
-
- GroupResponseValidator(AMQMethodBody response, List<Member> members)
- {
- _response = response;
- _members = members;
- }
-
- public void response(List<AMQMethodBody> responses, List<Member> members)
- {
- for (AMQMethodBody r : responses)
- {
- assertEquals(_response, r);
- }
- assertEquals(_members, members);
- _completed = true;
- }
-
- boolean isCompleted()
- {
- return _completed;
- }
- }
-}
diff --git a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/ClusterCapabilityTest.java b/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/ClusterCapabilityTest.java
deleted file mode 100644
index 830a00f4c2..0000000000
--- a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/ClusterCapabilityTest.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.cluster;
-
-import junit.framework.TestCase;
-import org.apache.qpid.framing.AMQShortString;
-
-public class ClusterCapabilityTest extends TestCase
-{
- public void testStartWithNull()
- {
- MemberHandle peer = new SimpleMemberHandle("myhost:9999");
- AMQShortString c = ClusterCapability.add(null, peer);
- assertTrue(ClusterCapability.contains(c));
- assertTrue(peer.matches(ClusterCapability.getPeer(c)));
- }
-
- public void testStartWithText()
- {
- MemberHandle peer = new SimpleMemberHandle("myhost:9999");
- AMQShortString c = ClusterCapability.add(new AMQShortString("existing text"), peer);
- assertTrue(ClusterCapability.contains(c));
- assertTrue(peer.matches(ClusterCapability.getPeer(c)));
- }
-}
diff --git a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/InductionBufferTest.java b/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/InductionBufferTest.java
deleted file mode 100644
index 7e58add91e..0000000000
--- a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/InductionBufferTest.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.cluster;
-
-import org.apache.mina.common.IoSession;
-
-import java.util.List;
-import java.util.ArrayList;
-
-import junit.framework.TestCase;
-
-public class InductionBufferTest extends TestCase
-{
- public void test() throws Exception
- {
- IoSession session1 = new TestSession();
- IoSession session2 = new TestSession();
- IoSession session3 = new TestSession();
-
- TestMessageHandler handler = new TestMessageHandler();
- InductionBuffer buffer = new InductionBuffer(handler);
-
- buffer.receive(session1, "one");
- buffer.receive(session2, "two");
- buffer.receive(session3, "three");
-
- buffer.receive(session1, "four");
- buffer.receive(session1, "five");
- buffer.receive(session1, "six");
-
- buffer.receive(session3, "seven");
- buffer.receive(session3, "eight");
-
- handler.checkEmpty();
- buffer.deliver();
-
- handler.check(session1, "one");
- handler.check(session2, "two");
- handler.check(session3, "three");
-
- handler.check(session1, "four");
- handler.check(session1, "five");
- handler.check(session1, "six");
-
- handler.check(session3, "seven");
- handler.check(session3, "eight");
- handler.checkEmpty();
-
- buffer.receive(session1, "nine");
- buffer.receive(session2, "ten");
- buffer.receive(session3, "eleven");
-
- handler.check(session1, "nine");
- handler.check(session2, "ten");
- handler.check(session3, "eleven");
-
- handler.checkEmpty();
- }
-
- private static class TestMessageHandler implements InductionBuffer.MessageHandler
- {
- private final List<IoSession> _sessions = new ArrayList<IoSession>();
- private final List<Object> _msgs = new ArrayList<Object>();
-
- public synchronized void deliver(IoSession session, Object msg) throws Exception
- {
- _sessions.add(session);
- _msgs.add(msg);
- }
-
- void check(IoSession actualSession, Object actualMsg)
- {
- assertFalse(_sessions.isEmpty());
- assertFalse(_msgs.isEmpty());
- IoSession expectedSession = _sessions.remove(0);
- Object expectedMsg = _msgs.remove(0);
- assertEquals(expectedSession, actualSession);
- assertEquals(expectedMsg, actualMsg);
- }
-
- void checkEmpty()
- {
- assertTrue(_sessions.isEmpty());
- assertTrue(_msgs.isEmpty());
- }
- }
-}
-
diff --git a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/RecordingBroker.java b/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/RecordingBroker.java
deleted file mode 100644
index 1ec5154a98..0000000000
--- a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/RecordingBroker.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.cluster;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQDataBlock;
-
-import java.util.ArrayList;
-import java.util.List;
-
-class RecordingBroker extends TestBroker
-{
- private final List<AMQDataBlock> _messages = new ArrayList<AMQDataBlock>();
-
- RecordingBroker(String host, int port)
- {
- super(host, port);
- }
-
- public void send(AMQDataBlock data) throws AMQException
- {
- _messages.add(data);
- }
-
- List<AMQDataBlock> getMessages()
- {
- return _messages;
- }
-
- void clear()
- {
- _messages.clear();
- }
-
-}
diff --git a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/RecordingBrokerFactory.java b/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/RecordingBrokerFactory.java
deleted file mode 100644
index d3e972e273..0000000000
--- a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/RecordingBrokerFactory.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.cluster;
-
-class RecordingBrokerFactory implements BrokerFactory
-{
- public Broker create(MemberHandle handle)
- {
- return new RecordingBroker(handle.getHost(), handle.getPort());
- }
-}
diff --git a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/SimpleClusterTest.java b/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/SimpleClusterTest.java
deleted file mode 100644
index 86cde3cee7..0000000000
--- a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/SimpleClusterTest.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.cluster;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.url.URLSyntaxException;
-import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.AMQSession;
-
-import javax.jms.JMSException;
-
-import junit.framework.TestCase;
-
-public class SimpleClusterTest extends TestCase
-{
- public void testDeclareExchange() throws AMQException, JMSException, URLSyntaxException
- {
- AMQConnection con = new AMQConnection("localhost:9000", "guest", "guest", "test", "/test");
- AMQSession session = (AMQSession) con.createSession(false, AMQSession.NO_ACKNOWLEDGE);
- System.out.println("Session created");
- session.declareExchange(new AMQShortString("my_exchange"), new AMQShortString("direct"), true);
- System.out.println("Exchange declared");
- con.close();
- System.out.println("Connection closed");
- }
-}
diff --git a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/SimpleMemberHandleTest.java b/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/SimpleMemberHandleTest.java
deleted file mode 100644
index 8ff8357377..0000000000
--- a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/SimpleMemberHandleTest.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.cluster;
-
-import junit.framework.TestCase;
-
-public class SimpleMemberHandleTest extends TestCase
-{
- public void testMatches()
- {
- assertMatch(new SimpleMemberHandle("localhost", 8888), new SimpleMemberHandle("localhost", 8888));
- assertNoMatch(new SimpleMemberHandle("localhost", 8889), new SimpleMemberHandle("localhost", 8888));
- assertNoMatch(new SimpleMemberHandle("localhost", 8888), new SimpleMemberHandle("localhost2", 8888));
- }
-
- public void testResolve()
- {
- assertEquivalent(new SimpleMemberHandle("WGLAIBD8XGR0J:9000"), new SimpleMemberHandle("localhost:9000"));
- }
-
- private void assertEquivalent(MemberHandle a, MemberHandle b)
- {
- String msg = a + " is not equivalent to " + b;
- a = SimpleMemberHandle.resolve(a);
- b = SimpleMemberHandle.resolve(b);
- msg += "(" + a + " does not match " + b + ")";
- assertTrue(msg, a.matches(b));
- }
-
- private void assertMatch(MemberHandle a, MemberHandle b)
- {
- assertTrue(a + " does not match " + b, a.matches(b));
- }
-
- private void assertNoMatch(MemberHandle a, MemberHandle b)
- {
- assertFalse(a + " matches " + b, a.matches(b));
- }
-}
diff --git a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestBroker.java b/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestBroker.java
deleted file mode 100644
index d3ccbf0ac6..0000000000
--- a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestBroker.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.cluster;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQMethodBody;
-
-import java.io.IOException;
-
-class TestBroker extends Broker
-{
- TestBroker(String host, int port)
- {
- super(host, port);
- }
-
- boolean connect() throws IOException, InterruptedException
- {
- return true;
- }
-
- void connectAsynch(Iterable<AMQMethodBody> msgs)
- {
- replay(msgs);
- }
-
- void replay(Iterable<AMQMethodBody> msgs)
- {
- try
- {
- for (AMQMethodBody b : msgs)
- {
- send(new AMQFrame(0, b));
- }
- }
- catch (AMQException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- Broker connectToCluster() throws IOException, InterruptedException
- {
- return this;
- }
-
- public void send(AMQDataBlock data) throws AMQException
- {
- }
-}
diff --git a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestBrokerFactory.java b/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestBrokerFactory.java
deleted file mode 100644
index 92eaec876a..0000000000
--- a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestBrokerFactory.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.cluster;
-
-class TestBrokerFactory implements BrokerFactory
-{
- public Broker create(MemberHandle handle)
- {
- return new TestBroker(handle.getHost(), handle.getPort());
- }
-}
diff --git a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestReplayManager.java b/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestReplayManager.java
deleted file mode 100644
index c529c83cc0..0000000000
--- a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestReplayManager.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.cluster;
-
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.cluster.replay.ReplayManager;
-
-import java.util.ArrayList;
-import java.util.List;
-
-class TestReplayManager implements ReplayManager
-{
- private final List<AMQMethodBody> _msgs;
-
- TestReplayManager()
- {
- this(new ArrayList<AMQMethodBody>());
- }
-
- TestReplayManager(List<AMQMethodBody> msgs)
- {
- _msgs = msgs;
- }
-
- public List<AMQMethodBody> replay(boolean isLeader)
- {
- return _msgs;
- }
-}
diff --git a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestSession.java b/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestSession.java
deleted file mode 100644
index 86ec808924..0000000000
--- a/Final/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestSession.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.server.cluster;
-
-import org.apache.mina.common.*;
-
-import java.net.SocketAddress;
-import java.util.Set;
-
-class TestSession implements IoSession
-{
- 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 null; //TODO
- }
-
- public Object setAttachment(Object attachment)
- {
- return null; //TODO
- }
-
- public Object getAttribute(String key)
- {
- return null; //TODO
- }
-
- public Object setAttribute(String key, Object value)
- {
- return null; //TODO
- }
-
- public Object setAttribute(String key)
- {
- return null; //TODO
- }
-
- public Object removeAttribute(String key)
- {
- return null; //TODO
- }
-
- public boolean containsAttribute(String key)
- {
- return false; //TODO
- }
-
- public Set getAttributeKeys()
- {
- return null; //TODO
- }
-
- 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/Final/java/common/bin/qpid-run b/Final/java/common/bin/qpid-run
deleted file mode 100644
index c9e37b21a1..0000000000
--- a/Final/java/common/bin/qpid-run
+++ /dev/null
@@ -1,238 +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
-}
-
-if [ -z $AMQJ_LOGGING_LEVEL ]; then
- export AMQJ_LOGGING_LEVEL=info
-fi
-
-if [ -z "$QPID_HOME" ]; then
- die "QPID_HOME must be set"
-fi
-
-if [ -z "$QPID_WORK" ]; then
- echo Setting QPID_WORK to $HOME as default
- QPID_WORK=$HOME
-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
- echo Using pid in qpid log name prefix
- LOG_PREFIX=" -Dlogprefix=$$"
- else
- echo 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
- echo Using pid in qpid log name suffix
- LOG_SUFFIX=" -Dlogsuffix=$$"
- else
- echo Using qpig logsuffix property
- LOG_SUFFIX=" -Dlogsuffix=$QPID_LOG_SUFFIX"
- fi
- SYSTEM_PROPS="${SYSTEM_PROPS} ${LOG_SUFFIX}"
-fi
-
-echo 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
- echo "Using QPID_CLASSPATH" $QPID_CLASSPATH
-else
- echo "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
- echo "Using QPID_JAVA_GC setting" $QPID_JAVA_GC
-else
- echo "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
- echo "Using QPID_JAVA_MEM setting" $QPID_JAVA_MEM
-else
- echo "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: JDPA_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 $JAVA_GC $JAVA_MEM $SYSTEM_PROPS $JAVA_OPTS $QPID_OPTS "${JAVA_ARGS[@]}")
-
-DISPATCH
diff --git a/Final/java/common/etc/qpid-run.conf b/Final/java/common/etc/qpid-run.conf
deleted file mode 100644
index b9765fe3ce..0000000000
--- a/Final/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/Final/java/common/etc/qpid-run.conf.dev b/Final/java/common/etc/qpid-run.conf.dev
deleted file mode 100644
index a5419eb4e8..0000000000
--- a/Final/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/Final/java/common/pom.xml b/Final/java/common/pom.xml
deleted file mode 100644
index b08982fde3..0000000000
--- a/Final/java/common/pom.xml
+++ /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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-common</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid Common Utilities</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- <gentools.home>${topDirectoryLocation}/../gentools</gentools.home>
- <generated.path>${project.build.directory}/generated-sources/gentools</generated.path>
- <generated.package>org/apache/qpid/framing</generated.package>
- <generated.dir>${generated.path}/${generated.package}</generated.dir>
- <generated.timestamp>${generated.dir}/timestamp</generated.timestamp>
- <specs.dir>${topDirectoryLocation}/../specs</specs.dir>
- </properties>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>protocol-version</id>
- <phase>generate-sources</phase>
- <configuration>
- <tasks>
- <ant antfile="protocol-version.xml" />
- </tasks>
- <sourceRoot>${generated.path}</sourceRoot>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <!-- Backports the module to Java 1.4. This is done during the packaging phase as a transformation of the Jar. -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>retrotranslator-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>retro-common</id>
- <goals>
- <goal>translate-project</goal>
- </goals>
- <configuration>
- <destjar>${project.build.directory}/${project.build.finalName}-java14.jar</destjar>
- <verify>${retrotranslator.verify}</verify>
- <verifyClasspath>
- <element>${retrotranslator.1.4-rt-path}</element>
- <element>${retrotranslator.1.4-jce-path}</element>
- <element>${retrotranslator.1.4-jsse-path}</element>
- <element>${retrotranslator.1.4-sasl-path}</element>
- </verifyClasspath>
- <failonwarning>false</failonwarning>
- <classifier>java14</classifier>
- <attach>true</attach>
- </configuration>
- </execution>
-
- </executions>
- </plugin>
-
- </plugins>
- </build>
-
- <dependencies>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- <version>1.4.0</version>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.4.0</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.mina</groupId>
- <artifactId>mina-java5</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.mina</groupId>
- <artifactId>mina-filter-ssl</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.mina</groupId>
- <artifactId>mina-core</artifactId>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- <!-- This needs to be included at compile time, for the retrotranslator verification to find it. -->
- <dependency>
- <groupId>net.sf.retrotranslator</groupId>
- <artifactId>retrotranslator-runtime</artifactId>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-</project>
diff --git a/Final/java/common/protocol-version.xml b/Final/java/common/protocol-version.xml
deleted file mode 100644
index 40331a8a84..0000000000
--- a/Final/java/common/protocol-version.xml
+++ /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.
- -
- -->
-<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 cluster.0-8.xml" />
- <property name="xml.spec.list" value="${xml.spec.dir}/amqp.0-8.xml ${xml.spec.dir}/cluster.0-8.xml" />
-
- <target name="generate" depends="compile_generator,check_generate_deps" 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 ${gentools.home}/templ.java ${xml.spec.list}" />
- <classpath>
- <pathelement path="${gentools.home}/src" />
- </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}" />
- </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/Final/java/common/readme.txt b/Final/java/common/readme.txt
deleted file mode 100644
index 12841fa08d..0000000000
--- a/Final/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/Final/java/common/src/main/java/log4j.properties b/Final/java/common/src/main/java/log4j.properties
deleted file mode 100644
index 6d596d1d19..0000000000
--- a/Final/java/common/src/main/java/log4j.properties
+++ /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/Final/java/common/src/main/java/org/apache/qpid/AMQChannelClosedException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQChannelClosedException.java
deleted file mode 100644
index 251e91c1b9..0000000000
--- a/Final/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)
- {
- super(errorCode, msg);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/AMQChannelException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQChannelException.java
deleted file mode 100644
index 9efd271e4d..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/AMQChannelException.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;
-
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ChannelCloseBody;
-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 t)
- {
- super(errorCode, msg, t);
- _classId = classId;
- _methodId = methodId;
- this.major = major;
- this.minor = minor;
- }
-
- public AMQChannelException(AMQConstant errorCode, String msg, int classId, int methodId, byte major, byte minor)
- {
- super(errorCode, msg);
- _classId = classId;
- _methodId = methodId;
- this.major = major;
- this.minor = minor;
- }
-
- public AMQFrame getCloseFrame(int channel)
- {
- return ChannelCloseBody.createAMQFrame(channel, major, minor, _classId, _methodId, getErrorCode().getCode(), new AMQShortString(getMessage()));
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/AMQConnectionClosedException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQConnectionClosedException.java
deleted file mode 100644
index eb736d437f..0000000000
--- a/Final/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)
- {
- super(errorCode, msg);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java
deleted file mode 100644
index 7edfa648ed..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/AMQConnectionException.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;
-
-import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ConnectionCloseBody;
-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 */
- private final byte major;
- private final byte minor;
- boolean _closeConnetion;
-
- public AMQConnectionException(AMQConstant errorCode, String msg, int classId, int methodId, byte major, byte minor,
- Throwable t)
- {
- super(errorCode, msg, t);
- _classId = classId;
- _methodId = methodId;
- this.major = major;
- this.minor = minor;
- }
-
- public AMQConnectionException(AMQConstant errorCode, String msg, int classId, int methodId, byte major, byte minor)
- {
- super(errorCode, msg);
- _classId = classId;
- _methodId = methodId;
- this.major = major;
- this.minor = minor;
- }
-
- public AMQFrame getCloseFrame(int channel)
- {
- return ConnectionCloseBody.createAMQFrame(channel, major, minor, _classId, _methodId, getErrorCode().getCode(),
- new AMQShortString(getMessage()));
- }
-
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.java
deleted file mode 100644
index f78307d16f..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/AMQConnectionFailureException.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;
-
-/**
- * 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
-{
- public AMQConnectionFailureException(String message)
- {
- super(message);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/AMQDisconnectedException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQDisconnectedException.java
deleted file mode 100644
index e62b2c10a2..0000000000
--- a/Final/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)
- {
- super(msg);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/AMQException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQException.java
deleted file mode 100644
index 41599ed880..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/AMQException.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;
-
-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 t The underlying cause of the exception. May be null if not to be set.
- */
- public AMQException(AMQConstant errorCode, String msg, Throwable t)
- {
- super(((msg == null) ? "" : msg) + ((errorCode == null) ? "" : (" [error code " + errorCode + "]")), t);
- _errorCode = errorCode;
- }
-
- /**
- * @param message
- *
- * @deprecated Use {@link #AMQException(org.apache.qpid.protocol.AMQConstant, String, Throwable)} instead.
- */
- public AMQException(String message)
- {
- super(message);
- // fixme This method needs removed and all AMQExceptions need a valid error code
- _errorCode = AMQConstant.getConstant(-1);
- }
-
- /**
- * @param msg
- * @param t
- *
- * @deprecated Use {@link #AMQException(org.apache.qpid.protocol.AMQConstant, String, Throwable)} instead.
- */
- public AMQException(String msg, Throwable t)
- {
- super(msg, t);
- // fixme This method needs removed and all AMQExceptions need a valid error code
- _errorCode = AMQConstant.getConstant(-1);
- }
-
- /**
- * @param errorCode
- * @param msg
- *
- * @deprecated Use {@link #AMQException(org.apache.qpid.protocol.AMQConstant, String, Throwable)} instead.
- */
- public AMQException(AMQConstant errorCode, String msg)
- {
- super(msg + " [error code " + errorCode + ']');
- _errorCode = errorCode;
- }
-
- /**
- * 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;
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.java
deleted file mode 100644
index 278128f924..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/AMQInvalidArgumentException.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;
-
-/**
- * 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)
- {
- super(AMQConstant.INVALID_ARGUMENT, message);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/AMQInvalidRoutingKeyException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQInvalidRoutingKeyException.java
deleted file mode 100644
index b5ec9845d6..0000000000
--- a/Final/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)
- {
- super(AMQConstant.INVALID_ROUTING_KEY, message);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/AMQPInvalidClassException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQPInvalidClassException.java
deleted file mode 100644
index a0574efa72..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQTimeoutException.java
deleted file mode 100644
index 0f8d9c47db..0000000000
--- a/Final/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)
- {
- super(AMQConstant.REQUEST_TIMEOUT, message);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.java
deleted file mode 100644
index 03220cc95e..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/AMQUndeliveredException.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;
-
-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)
- {
- super(errorCode, msg);
-
- _bounced = bounced;
- }
-
- public Object getUndeliveredMessage()
- {
- return _bounced;
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/AMQUnknownExchangeType.java b/Final/java/common/src/main/java/org/apache/qpid/AMQUnknownExchangeType.java
deleted file mode 100644
index a1e7088817..0000000000
--- a/Final/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)
- {
- super(message);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/AMQUnresolvedAddressException.java b/Final/java/common/src/main/java/org/apache/qpid/AMQUnresolvedAddressException.java
deleted file mode 100644
index 6cc9c3fe00..0000000000
--- a/Final/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)
- {
- super(message);
- _broker = broker;
- }
-
- public String toString()
- {
- return super.toString() + " Broker, \"" + _broker + "\"";
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/codec/AMQCodecFactory.java b/Final/java/common/src/main/java/org/apache/qpid/codec/AMQCodecFactory.java
deleted file mode 100644
index fa890d0ebb..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java b/Final/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java
deleted file mode 100644
index 02ae3cb089..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.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.codec;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.mina.common.IoSession;
-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
-{
- /** 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;
-
- /**
- * 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
- {
- if (_expectProtocolInitiation)
- {
- return doDecodePI(session, in, out);
- }
- else
- {
- return doDecodeDataBlock(session, in, out);
- }
- }
-
- /**
- * 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;
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/codec/AMQEncoder.java b/Final/java/common/src/main/java/org/apache/qpid/codec/AMQEncoder.java
deleted file mode 100644
index 53f48ae1c8..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/common/AMQPFilterTypes.java b/Final/java/common/src/main/java/org/apache/qpid/common/AMQPFilterTypes.java
deleted file mode 100644
index 9ed915cc35..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/common/ClientProperties.java b/Final/java/common/src/main/java/org/apache/qpid/common/ClientProperties.java
deleted file mode 100644
index 67f16e6a87..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/common/ClientProperties.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.common;
-
-/**
- * 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,
- product,
- version,
- platform
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java b/Final/java/common/src/main/java/org/apache/qpid/common/QpidProperties.java
deleted file mode 100644
index 2c783aeaa4..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/configuration/Configured.java b/Final/java/common/src/main/java/org/apache/qpid/configuration/Configured.java
deleted file mode 100644
index 22903888fe..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java b/Final/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.java
deleted file mode 100644
index 1e5cc57fff..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/configuration/PropertyException.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.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)
- {
- super(message);
- }
-
- /*
- public PropertyException(String msg, Throwable t)
- {
- super(msg, t);
- }
-
- public PropertyException(AMQConstant errorCode, String msg, Throwable t)
- {
- super(errorCode, msg, t);
- }
-
- public PropertyException(AMQConstant errorCode, String msg)
- {
- super(errorCode, msg);
- }
- */
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/configuration/PropertyUtils.java b/Final/java/common/src/main/java/org/apache/qpid/configuration/PropertyUtils.java
deleted file mode 100644
index b3c310d23c..0000000000
--- a/Final/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");
- }
-
- 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);
- }
-
- 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/Final/java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java b/Final/java/common/src/main/java/org/apache/qpid/exchange/ExchangeDefaults.java
deleted file mode 100644
index 123901b577..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java
deleted file mode 100644
index ebeea8d2b4..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQBody.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;
-
-import org.apache.mina.common.ByteBuffer;
-
-public abstract class AMQBody
-{
- public abstract byte getFrameType();
-
- /**
- * Get the size of the body
- * @return unsigned short
- */
- protected abstract int getSize();
-
- protected abstract void writePayload(ByteBuffer buffer);
-
- protected abstract void populateFromBuffer(ByteBuffer buffer, long size)
- throws AMQFrameDecodingException, AMQProtocolVersionException;
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlock.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlock.java
deleted file mode 100644
index 903b5bfa7a..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlock.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.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;
- }
-
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java
deleted file mode 100644
index 82ffc60802..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockEncoder.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockEncoder.java
deleted file mode 100644
index 05fd2bb480..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.java
deleted file mode 100644
index 11f505fd4b..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQFrame.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.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class AMQFrame extends AMQDataBlock implements EncodableAMQDataBlock
-{
- private final int _channel;
-
- private final AMQBody _bodyFrame;
-
-
-
- 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 void writePayload(ByteBuffer buffer)
- {
- buffer.put(_bodyFrame.getFrameType());
- EncodingUtils.writeUnsignedShort(buffer, _channel);
- EncodingUtils.writeUnsignedInteger(buffer, _bodyFrame.getSize());
- _bodyFrame.writePayload(buffer);
- buffer.put((byte) 0xCE);
- }
-
- public final int getChannel()
- {
- return _channel;
- }
-
- public final AMQBody getBodyFrame()
- {
- return _bodyFrame;
- }
-
-
-
- public String toString()
- {
- return "Frame channelId: " + _channel + ", bodyFrame: " + String.valueOf(_bodyFrame);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.java
deleted file mode 100644
index cd5ccf8e04..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQFrameDecodingException.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;
-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 t)
- {
- super(errorCode, message, t);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java
deleted file mode 100644
index f2e91083ca..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.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.framing;
-
-import org.apache.mina.common.ByteBuffer;
-import org.apache.qpid.AMQChannelException;
-import org.apache.qpid.AMQConnectionException;
-import org.apache.qpid.protocol.AMQConstant;
-
-public abstract class AMQMethodBody extends AMQBody
-{
- public static final byte TYPE = 1;
-
- /** AMQP version */
- protected byte major;
- protected byte minor;
-
- public byte getMajor()
- {
- return major;
- }
-
- public byte getMinor()
- {
- return minor;
- }
-
- public AMQMethodBody(byte major, byte minor)
- {
- this.major = major;
- this.minor = minor;
- }
-
- /** unsigned short */
- protected abstract int getBodySize();
-
- /** @return unsigned short */
- protected abstract int getClazz();
-
- /** @return unsigned short */
- protected abstract int getMethod();
-
- protected abstract void writeMethodPayload(ByteBuffer buffer);
-
- public byte getFrameType()
- {
- return TYPE;
- }
-
- protected int getSize()
- {
- return 2 + 2 + getBodySize();
- }
-
- protected void writePayload(ByteBuffer buffer)
- {
- EncodingUtils.writeUnsignedShort(buffer, getClazz());
- EncodingUtils.writeUnsignedShort(buffer, getMethod());
- writeMethodPayload(buffer);
- }
-
- protected abstract void populateMethodBodyFromBuffer(ByteBuffer buffer) throws AMQFrameDecodingException;
-
- protected void populateFromBuffer(ByteBuffer buffer, long size) throws AMQFrameDecodingException
- {
- populateMethodBodyFromBuffer(buffer);
- }
-
- public String toString()
- {
- StringBuffer buf = new StringBuffer(getClass().getName());
- buf.append("[ Class: ").append(getClazz());
- buf.append(" Method: ").append(getMethod()).append(']');
- return buf.toString();
- }
-
- /**
- * 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(), major, minor);
- }
-
- public AMQChannelException getChannelException(AMQConstant code, String message, Throwable cause)
- {
- return new AMQChannelException(code, message, getClazz(), getMethod(), major, minor, cause);
- }
-
- public AMQConnectionException getConnectionException(AMQConstant code, String message)
- {
- return new AMQConnectionException(code, message, getClazz(), getMethod(), major, minor);
- }
-
- public AMQConnectionException getConnectionException(AMQConstant code, String message, Throwable cause)
- {
- return new AMQConnectionException(code, message, getClazz(), getMethod(), major, minor, cause);
- }
-
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java
deleted file mode 100644
index cf85bdab31..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.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.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.getRegistry().get((short) in.getUnsignedShort(), (short) in.getUnsignedShort(), in,
- bodySize);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java
deleted file mode 100644
index 359efe7eb7..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.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 abstract interface AMQMethodBodyInstanceFactory
-{
- public AMQMethodBody newInstance(byte major, byte minor, ByteBuffer buffer, long size) throws AMQFrameDecodingException;
- public AMQMethodBody newInstance(byte major, byte minor, int clazzID, int methodID, ByteBuffer buffer, long size) throws AMQFrameDecodingException;
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolClassException.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolClassException.java
deleted file mode 100644
index e48fd2e7f9..0000000000
--- a/Final/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)
- {
- super(message);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolHeaderException.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolHeaderException.java
deleted file mode 100644
index 1ce49aba83..0000000000
--- a/Final/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)
- {
- super(message);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolInstanceException.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolInstanceException.java
deleted file mode 100644
index 9049eace2a..0000000000
--- a/Final/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)
- {
- super(message);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolVersionException.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQProtocolVersionException.java
deleted file mode 100644
index 9074931617..0000000000
--- a/Final/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)
- {
- super(message);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java
deleted file mode 100644
index ec501951af..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQShortString.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.Map;
-import java.util.WeakHashMap;
-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 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 ByteBuffer _data;
- private int _hashCode;
- private final int _length;
- private static final char[] EMPTY_CHAR_ARRAY = new char[0];
-
- public AMQShortString(byte[] data)
- {
-
- _data = ByteBuffer.wrap(data);
- _length = data.length;
- }
-
- public AMQShortString(String data)
- {
- this((data == null) ? EMPTY_CHAR_ARRAY : data.toCharArray());
- if (data != null)
- {
- _hashCode = data.hashCode();
- }
- }
-
- 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];
- for (int i = 0; i < length; i++)
- {
- stringBytes[i] = (byte) (0xFF & data[i]);
- }
-
- _data = ByteBuffer.wrap(stringBytes);
- _data.rewind();
- _length = length;
-
- }
-
- 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 = ByteBuffer.wrap(stringBytes);
- _data.rewind();
- _hashCode = hash;
- _length = length;
-
- }
-
- private AMQShortString(ByteBuffer data)
- {
- _data = data;
- _length = data.limit();
-
- }
-
- /**
- * 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.get(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) length();
- for (int i = 0; i < size; i++)
- {
- encoding[pos++] = _data.get(i);
- }
-
- return pos;
- }
-
- public static AMQShortString readFromByteArray(byte[] byteEncodedDestination, int pos)
- {
-
- final byte len = byteEncodedDestination[pos];
- if (len == 0)
- {
- return null;
- }
-
- ByteBuffer data = ByteBuffer.wrap(byteEncodedDestination, pos + 1, len).slice();
-
- return new AMQShortString(data);
- }
-
- public static AMQShortString readFromBuffer(ByteBuffer buffer)
- {
- final short length = buffer.getUnsigned();
- if (length == 0)
- {
- return null;
- }
- else
- {
- ByteBuffer data = buffer.slice();
- data.limit(length);
- data.rewind();
- buffer.skip(length);
-
- return new AMQShortString(data);
- }
- }
-
- public byte[] getBytes()
- {
-
- if (_data.buf().hasArray() && (_data.arrayOffset() == 0))
- {
- return _data.array();
- }
- else
- {
- final int size = length();
- byte[] b = new byte[size];
- ByteBuffer buf = _data.duplicate();
- buf.rewind();
- buf.get(b);
-
- return b;
- }
-
- }
-
- public void writeToBuffer(ByteBuffer buffer)
- {
-
- final int size = length();
- if (size != 0)
- {
-
- buffer.setAutoExpand(true);
- buffer.put((byte) size);
- if (_data.buf().hasArray())
- {
- buffer.put(_data.array(), _data.arrayOffset(), length());
- }
- else
- {
-
- for (int i = 0; i < size; i++)
- {
-
- buffer.put(_data.get(i));
- }
- }
- }
- else
- {
- // really writing out unsigned byte
- buffer.put((byte) 0);
- }
-
- }
-
- private final class CharSubSequence implements CharSequence
- {
- private final int _offset;
- private final int _end;
-
- public CharSubSequence(final int offset, final int end)
- {
- _offset = offset;
- _end = end;
- }
-
- public int length()
- {
- return _end - _offset;
- }
-
- public char charAt(int index)
- {
- return AMQShortString.this.charAt(index + _offset);
- }
-
- public CharSequence subSequence(int start, int end)
- {
- return new CharSubSequence(start + _offset, end + _offset);
- }
- }
-
- public char[] asChars()
- {
- final int size = length();
- final char[] chars = new char[size];
-
- for (int i = 0; i < size; i++)
- {
- chars[i] = (char) _data.get(i);
- }
-
- return chars;
- }
-
- public String asString()
- {
- return new String(asChars());
- }
-
- public boolean equals(Object o)
- {
- if (o == null)
- {
- return false;
- }
-
- if (o == this)
- {
- return true;
- }
-
- if (o instanceof AMQShortString)
- {
-
- final AMQShortString otherString = (AMQShortString) o;
-
- if ((_hashCode != 0) && (otherString._hashCode != 0) && (_hashCode != otherString._hashCode))
- {
- return false;
- }
-
- return _data.equals(otherString._data);
-
- }
-
- return (o instanceof CharSequence) && equals((CharSequence) o);
-
- }
-
- public boolean equals(CharSequence 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.get(i);
- }
-
- _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.get(i);
- final byte n = name._data.get(i);
- if (d < n)
- {
- return -1;
- }
-
- if (d > n)
- {
- return 1;
- }
- }
-
- return (length() == name.length()) ? 0 : -1;
- }
- }
-
-
- 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 = new AMQShortString(getBytes());
- ref = new WeakReference(internString);
- _globalInternMap.put(internString, ref);
- }
-
- }
- localMap.put(internString, ref);
- return internString;
-
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQType.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQType.java
deleted file mode 100644
index 6dda91a488..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQType.java
+++ /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.
- *
- */
-package org.apache.qpid.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-import java.math.BigDecimal;
-import java.math.BigInteger;
-
-public enum AMQType
-{
- //AMQP FieldTable Wire Types
-
- 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);
- }
- },
-
- FIELD_TABLE('F')
- {
- public int getEncodingSize(Object value)
- {
- // TODO : fixme
- throw new UnsupportedOperationException();
- }
-
- public Object toNativeValue(Object value)
- {
- // TODO : fixme
- throw new UnsupportedOperationException();
- }
-
- public void writeValueImpl(Object value, ByteBuffer buffer)
- {
- // TODO : fixme
- throw new UnsupportedOperationException();
- }
-
- public Object readValueFromBuffer(ByteBuffer buffer)
- {
- // TODO : fixme
- throw new UnsupportedOperationException();
- }
- },
-
- 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;
- }
- },
-
- // Extended types
-
- 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);
- }
- };
-
- private final byte _identifier;
-
- AMQType(char identifier)
- {
- _identifier = (byte) identifier;
- }
-
- public final byte identifier()
- {
- return _identifier;
- }
-
-
- public abstract int getEncodingSize(Object value);
-
- public abstract Object toNativeValue(Object value);
-
- public AMQTypedValue asTypedValue(Object value)
- {
- return new AMQTypedValue(this, toNativeValue(value));
- }
-
- public void writeToBuffer(Object value, ByteBuffer buffer)
- {
- buffer.put((byte)identifier());
- writeValueImpl(value, buffer);
- }
-
- abstract void writeValueImpl(Object value, ByteBuffer buffer);
-
- abstract Object readValueFromBuffer(ByteBuffer buffer);
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQTypeMap.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQTypeMap.java
deleted file mode 100644
index 1419dd75b1..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/AMQTypedValue.java b/Final/java/common/src/main/java/org/apache/qpid/framing/AMQTypedValue.java
deleted file mode 100644
index 7193580884..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/AMQTypedValue.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.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class AMQTypedValue
-{
- private final AMQType _type;
- 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()+"]";
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java b/Final/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.java
deleted file mode 100644
index 61f2f891e5..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/BasicContentHeaderProperties.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.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;
-
- 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)
- {
- 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)
- {
- clearEncodedForm();
- _propertyFlags |= (CONTENT_TYPE_MASK);
- _contentType = contentType;
- }
-
- public void setContentType(String contentType)
- {
- 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)
- {
- clearEncodedForm();
- _propertyFlags |= ENCONDING_MASK;
- _encoding = (encoding == null) ? null : new AMQShortString(encoding);
- }
-
- public void setEncoding(AMQShortString encoding)
- {
- clearEncodedForm();
- _propertyFlags |= ENCONDING_MASK;
- _encoding = encoding;
- }
-
- public FieldTable getHeaders()
- {
- decodeHeadersIfNecessary();
-
- if (_headers == null)
- {
- setHeaders(FieldTableFactory.newFieldTable());
- }
-
- return _headers;
- }
-
- public void setHeaders(FieldTable headers)
- {
- 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)
- {
- setCorrelationId((correlationId == null) ? null : new AMQShortString(correlationId));
- }
-
- public void setCorrelationId(AMQShortString correlationId)
- {
- 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)
- {
- setReplyTo((replyTo == null) ? null : new AMQShortString(replyTo));
- }
-
- public void setReplyTo(AMQShortString replyTo)
- {
-
- 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)
- {
- clearEncodedForm();
- _propertyFlags |= MESSAGE_ID_MASK;
- _messageId = (messageId == null) ? null : new AMQShortString(messageId);
- }
-
- public void setMessageId(AMQShortString messageId)
- {
- 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)
- {
- setType((type == null) ? null : new AMQShortString(type));
- }
-
- public void setType(AMQShortString type)
- {
- 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)
- {
- 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)
- {
- setAppId((appId == null) ? null : new AMQShortString(appId));
- }
-
- public void setAppId(AMQShortString appId)
- {
- clearEncodedForm();
- _propertyFlags |= APPLICATION_ID_MASK;
- _appId = appId;
- }
-
- public String getClusterIdAsString()
- {
- decodeIfNecessary();
-
- return (_clusterId == null) ? null : _clusterId.toString();
- }
-
- public AMQShortString getClusterId()
- {
- decodeIfNecessary();
-
- return _clusterId;
- }
-
- public void setClusterId(String clusterId)
- {
- setClusterId((clusterId == null) ? null : new AMQShortString(clusterId));
- }
-
- public void setClusterId(AMQShortString clusterId)
- {
- 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/Final/java/common/src/main/java/org/apache/qpid/framing/BodyFactory.java b/Final/java/common/src/main/java/org/apache/qpid/framing/BodyFactory.java
deleted file mode 100644
index 59646577e1..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/CommonContentHeaderProperties.java b/Final/java/common/src/main/java/org/apache/qpid/framing/CommonContentHeaderProperties.java
deleted file mode 100644
index 6a608a8bff..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/CompositeAMQDataBlock.java b/Final/java/common/src/main/java/org/apache/qpid/framing/CompositeAMQDataBlock.java
deleted file mode 100644
index 5ec62ede93..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/CompositeAMQDataBlock.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.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class CompositeAMQDataBlock extends AMQDataBlock implements EncodableAMQDataBlock
-{
- private ByteBuffer _encodedBlock;
-
- private AMQDataBlock[] _blocks;
-
- public CompositeAMQDataBlock(AMQDataBlock[] blocks)
- {
- _blocks = blocks;
- }
-
- /**
- * The encoded block will be logically first before the AMQDataBlocks which are encoded
- * into the buffer afterwards.
- * @param encodedBlock already-encoded data
- * @param blocks some blocks to be encoded.
- */
- public CompositeAMQDataBlock(ByteBuffer encodedBlock, AMQDataBlock[] blocks)
- {
- this(blocks);
- _encodedBlock = encodedBlock;
- }
-
- public AMQDataBlock[] getBlocks()
- {
- return _blocks;
- }
-
- public ByteBuffer getEncodedBlock()
- {
- return _encodedBlock;
- }
-
- public long getSize()
- {
- long frameSize = 0;
- for (int i = 0; i < _blocks.length; i++)
- {
- frameSize += _blocks[i].getSize();
- }
- if (_encodedBlock != null)
- {
- _encodedBlock.rewind();
- frameSize += _encodedBlock.remaining();
- }
- return frameSize;
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- if (_encodedBlock != null)
- {
- buffer.put(_encodedBlock);
- }
- 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("{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/Final/java/common/src/main/java/org/apache/qpid/framing/Content.java b/Final/java/common/src/main/java/org/apache/qpid/framing/Content.java
deleted file mode 100644
index e5feeec2a4..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java b/Final/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java
deleted file mode 100644
index be38695384..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/ContentBody.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.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class ContentBody extends 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)
- {
- ByteBuffer copy = payload.duplicate();
- buffer.put(copy.rewind());
- }
- }
-
- 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/Final/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java b/Final/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java
deleted file mode 100644
index c42995d148..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java b/Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java
deleted file mode 100644
index 02631a5f88..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.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.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class ContentHeaderBody extends 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 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/Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java b/Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java
deleted file mode 100644
index 8d5e2f9fb4..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java b/Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.java
deleted file mode 100644
index 561d7852fd..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderProperties.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.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();
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java b/Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java
deleted file mode 100644
index 712eb437db..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.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.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-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 == BasicConsumeBody.getClazz((byte)8, (byte)0))
- {
- 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/Final/java/common/src/main/java/org/apache/qpid/framing/EncodableAMQDataBlock.java b/Final/java/common/src/main/java/org/apache/qpid/framing/EncodableAMQDataBlock.java
deleted file mode 100644
index 9cf96e698c..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java b/Final/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java
deleted file mode 100644
index ccba8bd41e..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/EncodingUtils.java
+++ /dev/null
@@ -1,1028 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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];
- }
-
- writeBytes(buffer, 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)
- {
- short length = buffer.getUnsigned();
- if (length == 0)
- {
- return null;
- }
- else
- {
- byte[] dataBytes = new byte[length];
- buffer.get(dataBytes, 0, length);
-
- return dataBytes;
- }
- }
-
- public static void writeBytes(ByteBuffer buffer, byte[] data)
- {
- if (data != null)
- {
- // TODO: check length fits in an unsigned byte
- writeUnsignedByte(buffer, (short) data.length);
- buffer.put(data);
- }
- else
- {
- // really writing out unsigned byte
- buffer.put((byte) 0);
- }
- }
-
- // 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/Final/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java b/Final/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java
deleted file mode 100644
index 46b10b5963..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/FieldTable.java
+++ /dev/null
@@ -1,1017 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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);
- }
-
- private 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;
- }
- }
-
- 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));
- }
-
- 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.isTraceEnabled();
-
- if (trace)
- {
- _logger.trace("FieldTable::writeToBuffer: Writing encoded length of " + getEncodedSize() + "...");
- if (_properties != null)
- {
- _logger.trace(_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 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 (_encodedForm.position() != 0)
- {
- _encodedForm.flip();
- }
- // _encodedForm.limit((int)getEncodedSize());
-
- buffer.put(_encodedForm);
- }
- 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.isTraceEnabled())
- {
- _logger.trace("Writing Property:" + me.getKey() + " Type:" + me.getValue().getType() + " Value:"
- + me.getValue().getValue());
- _logger.trace("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.isTraceEnabled())
- {
- _logger.trace("Exception thrown:" + e);
- _logger.trace("Writing Property:" + me.getKey() + " Type:" + me.getValue().getType() + " Value:"
- + me.getValue().getValue());
- _logger.trace("Buffer Position:" + buffer.position() + " Remaining:" + buffer.remaining());
- }
-
- throw new RuntimeException(e);
- }
- }
- }
- }
-
- private void setFromBuffer(ByteBuffer buffer, long length) throws AMQFrameDecodingException
- {
-
- final boolean trace = _logger.isTraceEnabled();
- 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.trace("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.trace("FieldTable::FieldTable(buffer," + length + "): Done.");
- }
- }
-
- 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/Final/java/common/src/main/java/org/apache/qpid/framing/FieldTableFactory.java b/Final/java/common/src/main/java/org/apache/qpid/framing/FieldTableFactory.java
deleted file mode 100644
index e9d75137ef..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java b/Final/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java
deleted file mode 100644
index 7246c4a1cf..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.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.framing;
-
-import org.apache.mina.common.ByteBuffer;
-
-public class HeartbeatBody extends 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;
- }
-
- protected int getSize()
- {
- return 0;//heartbeats we generate have no payload
- }
-
- protected void writePayload(ByteBuffer buffer)
- {
- }
-
- 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/Final/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBodyFactory.java b/Final/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBodyFactory.java
deleted file mode 100644
index c7ada708dc..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/MethodConverter_8_0.java b/Final/java/common/src/main/java/org/apache/qpid/framing/MethodConverter_8_0.java
deleted file mode 100644
index 9a113f452b..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/MethodConverter_8_0.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.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.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 = BasicPublishBody.getClazz(getProtocolMajorVersion(),getProtocolMinorVersion());
- _basicPublishMethodId = BasicPublishBody.getMethod(getProtocolMajorVersion(),getProtocolMinorVersion());
-
- }
-
- public MessagePublishInfo convertToInfo(AMQMethodBody methodBody)
- {
- final BasicPublishBody body = (BasicPublishBody) methodBody;
-
- return new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return body.getExchange();
- }
-
- public boolean isImmediate()
- {
- return body.getImmediate();
- }
-
- public boolean isMandatory()
- {
- return body.getMandatory();
- }
-
- public AMQShortString getRoutingKey()
- {
- return body.getRoutingKey();
- }
- };
-
- }
-
- public AMQMethodBody convertToBody(MessagePublishInfo info)
- {
-
- return new BasicPublishBody(getProtocolMajorVersion(),
- getProtocolMinorVersion(),
- _basicPublishClassId,
- _basicPublishMethodId,
- info.getExchange(),
- info.isImmediate(),
- info.isMandatory(),
- info.getRoutingKey(),
- 0) ; // ticket
-
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java b/Final/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.java
deleted file mode 100644
index 8b40fe72eb..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/ProtocolInitiation.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.
- *
- */
-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 void checkVersion() throws AMQException
- {
-
- if(_protocolHeader.length != 4)
- {
- throw new AMQProtocolHeaderException("Protocol header should have exactly four octets");
- }
- 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"));
- }
- catch (UnsupportedEncodingException e)
- {
-
- }
- }
- }
- if (_protocolClass != CURRENT_PROTOCOL_CLASS)
- {
- throw new AMQProtocolClassException("Protocol class " + CURRENT_PROTOCOL_CLASS + " was expected; received " +
- _protocolClass);
- }
- if (_protocolInstance != TCP_PROTOCOL_INSTANCE)
- {
- throw new AMQProtocolInstanceException("Protocol instance " + TCP_PROTOCOL_INSTANCE + " was expected; received " +
- _protocolInstance);
- }
-
- 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.");
- }
- }
-
- 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/Final/java/common/src/main/java/org/apache/qpid/framing/SmallCompositeAMQDataBlock.java b/Final/java/common/src/main/java/org/apache/qpid/framing/SmallCompositeAMQDataBlock.java
deleted file mode 100644
index 26c048e34a..0000000000
--- a/Final/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 ByteBuffer _encodedBlock;
-
- 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(ByteBuffer encodedBlock, AMQDataBlock block)
- {
- this(block);
- _encodedBlock = encodedBlock;
- }
-
- public AMQDataBlock getBlock()
- {
- return _block;
- }
-
- public ByteBuffer getEncodedBlock()
- {
- return _encodedBlock;
- }
-
- public long getSize()
- {
- long frameSize = _block.getSize();
-
- if (_encodedBlock != null)
- {
- _encodedBlock.rewind();
- frameSize += _encodedBlock.remaining();
- }
- return frameSize;
- }
-
- public void writePayload(ByteBuffer buffer)
- {
- if (_encodedBlock != null)
- {
- buffer.put(_encodedBlock);
- }
- _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(_encodedBlock);
-
- buf.append(" _block=[").append(_block.toString()).append("]");
-
- buf.append("}");
- return buf.toString();
- }
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java b/Final/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java
deleted file mode 100644
index 6006e9793c..0000000000
--- a/Final/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(_protocolMajorVersion, _protocolMinorVersion, classID, methodID, in, size);
-
- }
-
- public ProtocolVersionMethodConverter getProtocolVersionMethodConverter()
- {
- return _protocolVersionConverter;
- }
-
- public void configure()
- {
- _protocolVersionConverter.configure();
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/AbstractMethodConverter.java b/Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/AbstractMethodConverter.java
deleted file mode 100644
index 1c335f3036..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/ContentChunk.java b/Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/ContentChunk.java
deleted file mode 100644
index 6312e478a8..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfo.java b/Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfo.java
deleted file mode 100644
index 706499c1b0..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfo.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.framing.abstraction;
-
-import org.apache.qpid.framing.AMQShortString;
-
-public interface MessagePublishInfo
-{
-
- public AMQShortString getExchange();
-
- public boolean isImmediate();
-
- public boolean isMandatory();
-
- public AMQShortString getRoutingKey();
-
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java b/Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java
deleted file mode 100644
index 42e2f7ad97..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java b/Final/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java
deleted file mode 100644
index 99588a0908..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/pool/Event.java b/Final/java/common/src/main/java/org/apache/qpid/pool/Event.java
deleted file mode 100644
index 5996cbf89c..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/pool/Job.java b/Final/java/common/src/main/java/org/apache/qpid/pool/Job.java
deleted file mode 100644
index ba3c5d03fa..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/pool/Job.java
+++ /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.
- *
- */
-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 Runnable
-{
- /** 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;
-
- /**
- * 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.
- */
- Job(IoSession session, JobCompletionHandler completionHandler, int maxEvents)
- {
- _session = session;
- _completionHandler = completionHandler;
- _maxEvents = maxEvents;
- }
-
- /**
- * 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.
- */
- void processAll()
- {
- // limit the number of events processed in one run
- for (int i = 0; i < _maxEvents; i++)
- {
- Event e = _eventQueue.poll();
- if (e == null)
- {
- break;
- }
- else
- {
- e.process(_session);
- }
- }
- }
-
- /**
- * 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()
- {
- processAll();
- deactivate();
- _completionHandler.completed(_session, this);
- }
-
- /**
- * 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);
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java b/Final/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
deleted file mode 100644
index cbe08a192e..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.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.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
-
-/**
- * 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 This seems a bit bizarre. ReadWriteThreadModel creates seperate pooling filters for read and write events.
- * The pooling filters themselves batch read and write events into jobs, but hand these jobs to a common thread
- * pool for execution. So the same thread pool ends up handling read and write events, albeit with many threads
- * so there is concurrency. But why go to the trouble of seperating out the read and write events in that case?
- * Why not just batch them into jobs together? Perhaps its so that seperate thread pools could be used for these
- * stages.
- *
- * @todo Why set an event limit of 10 on the Job? This also seems bizarre, as the job can have more than 10 events in
- * it. Its just that it runs them 10 at a time, but the completion hander here checks if there are more to run
- * and trips off another batch of 10 until they are all done. Why not just have a straight forward
- * consumer/producer queue scenario without the batches of 10? So instead of having many jobs with batches of 10
- * in them, just have one queue of events and worker threads taking the next event. There will be coordination
- * between worker threads and new events arriving on the job anyway, so the simpler scenario may have the same
- * amount of contention. I can see that the batches of 10 is done, so that no job is allowed to hog the worker
- * pool for too long. I'm not convinced this fairly complex scheme will actually add anything, and it might be
- * better to encapsulate it under a Queue interface anyway, so that different queue implementations can easily
- * be substituted in.
- *
- * @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 a mapping from Mina sessions to batched jobs for execution. */
- private final ConcurrentMap<IoSession, Job> _jobs = new ConcurrentHashMap<IoSession, Job>();
-
- /** 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. */
- private final int _maxEvents = Integer.getInteger("amqj.server.read_write_pool.max_events", 10);
-
- /**
- * 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)
- {
- _poolReference = refCountingPool;
- _name = name;
- }
-
- /**
- * 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 session The Mina session to work in.
- * @param event The event to hand off asynchronously.
- */
- void fireAsynchEvent(IoSession session, Event event)
- {
- Job job = getJobForSession(session);
- // job.acquire(); //prevents this job being removed from _jobs
- job.add(event);
-
- // Additional checks on pool to check that it hasn't shutdown.
- // The alternative is to catch the RejectedExecutionException that will result from executing on a shutdown pool
- if (job.activate() && (_poolReference.getPool() != null) && !_poolReference.getPool().isShutdown())
- {
- _poolReference.getPool().execute(job);
- }
-
- }
-
- /**
- * 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, _maxEvents);
- 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.
- */
- private Job getJobForSession(IoSession session)
- {
- return (Job) session.getAttribute(_name);
- }
-
- /*private Job createJobForSession(IoSession session)
- {
- return addJobForSession(session, new Job(session, this, _maxEvents));
- }*/
-
- /*private Job addJobForSession(IoSession session, Job job)
- {
- // atomic so ensures all threads agree on the same job
- Job existing = _jobs.putIfAbsent(session, job);
-
- return (existing == null) ? job : existing;
- }*/
-
- /**
- * 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())
- // {
- // job.release();
- // if (!job.isReferenced())
- // {
- // _jobs.remove(session);
- // }
- // }
- // else
- if (!job.isComplete())
- {
- // ritchiem : 2006-12-13 Do we need to perform the additional checks here?
- // Can the pool be shutdown at this point?
- if (job.activate() && (_poolReference.getPool() != null) && !_poolReference.getPool().isShutdown())
- {
- _poolReference.getPool().execute(job);
- }
- }
- }
-
- /**
- * 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);
- }
-
- /**
- * 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)
- {
-
- fireAsynchEvent(session, 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)
- {
- fireAsynchEvent(session, 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);
- }
-
- /**
- * 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)
- {
- fireAsynchEvent(session, 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)
- {
- fireAsynchEvent(session, new CloseEvent(nextFilter));
- }
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/pool/ReadWriteThreadModel.java b/Final/java/common/src/main/java/org/apache/qpid/pool/ReadWriteThreadModel.java
deleted file mode 100644
index 8cea70e597..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/pool/ReferenceCountingExecutorService.java b/Final/java/common/src/main/java/org/apache/qpid/pool/ReferenceCountingExecutorService.java
deleted file mode 100644
index 84c9e1f465..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/pool/ReferenceCountingExecutorService.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.pool;
-
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * 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);
-
- /**
- * 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.
- */
- ExecutorService acquireExecutorService()
- {
- synchronized (_lock)
- {
- if (_refCount++ == 0)
- {
- _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.
- */
- 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;
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java b/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.java
deleted file mode 100644
index 375df2a45d..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQConstant.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.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 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/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java b/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java
deleted file mode 100644
index fd6907a152..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java b/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java
deleted file mode 100644
index 2fbeeda1d4..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.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.protocol;
-
-import org.apache.qpid.framing.AMQMethodBody;
-
-/**
- * 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 Exception;
-
- /**
- * 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/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQProtocolWriter.java b/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQProtocolWriter.java
deleted file mode 100644
index 65884e4950..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java b/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java
deleted file mode 100644
index 7c1d6fdaa0..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.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.protocol;
-
-import org.apache.qpid.framing.VersionSpecificRegistry;
-
-/**
- * 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();
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java b/Final/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java
deleted file mode 100644
index 60a7f30185..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.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.protocol;
-
-/**
- * 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
-{
- /**
- * Reports the AMQP minor version, that the implementer can handle.
- *
- * @return The AMQP minor version.
- */
- public byte getProtocolMinorVersion();
-
- /**
- * Reports the AMQP major version, that the implementer can handle.
- *
- * @return The AMQP major version.
- */
- public byte getProtocolMajorVersion();
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/ssl/SSLContextFactory.java b/Final/java/common/src/main/java/org/apache/qpid/ssl/SSLContextFactory.java
deleted file mode 100644
index 950279fff1..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/ssl/SSLContextFactory.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.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
- */
- private String _certType;
-
- /**
- * 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 keystorePath, String keystorePassword,
- String certType)
- {
- _keystorePath = keystorePath;
- _keystorePassword = keystorePassword;
- if (_keystorePassword.equals("none"))
- {
- _keystorePassword = null;
- }
- _certType = certType;
- if (keystorePath == null) {
- throw new IllegalArgumentException("Keystore path must be specified");
- }
- if (certType == 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();
-
- // Set up key manager factory to use our key store
- KeyManagerFactory kmf = KeyManagerFactory.getInstance(_certType);
- kmf.init(ks, _keystorePassword.toCharArray());
-
- // Initialize the SSLContext to work with our key managers.
- SSLContext sslContext = SSLContext.getInstance("TLS");
- TrustManagerFactory tmf = TrustManagerFactory.getInstance(_certType);
- tmf.init(ks);
- 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();
- TrustManagerFactory tmf = TrustManagerFactory.getInstance(_certType);
- tmf.init(ks);
- SSLContext context = SSLContext.getInstance("TLS");
- context.init(null, tmf.getTrustManagers(), null);
- return context;
- }
-
- private KeyStore getInitializedKeyStore() throws GeneralSecurityException, IOException
- {
- KeyStore ks = KeyStore.getInstance("JKS");
- InputStream in = null;
- try
- {
- File f = new File(_keystorePath);
- if (f.exists())
- {
- in = new FileInputStream(f);
- }
- else
- {
- in = Thread.currentThread().getContextClassLoader().getResourceAsStream(_keystorePath);
- }
- if (in == null)
- {
- throw new IOException("Unable to load keystore resource: " + _keystorePath);
- }
- ks.load(in, _keystorePassword.toCharArray());
- }
- finally
- {
- if (in != null)
- {
- //noinspection EmptyCatchBlock
- try
- {
- in.close();
- }
- catch (IOException ignored)
- {
- }
- }
- }
- return ks;
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java b/Final/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.java
deleted file mode 100644
index 1774fa1194..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/url/AMQBindingURL.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.url;
-
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-
-public class AMQBindingURL implements BindingURL
-{
- private static final Logger _logger = LoggerFactory.getLogger(AMQBindingURL.class);
-
- String _url;
- AMQShortString _exchangeClass;
- AMQShortString _exchangeName;
- AMQShortString _destinationName;
- AMQShortString _queueName;
- private HashMap<String, String> _options;
-
- public AMQBindingURL(String url) throws URLSyntaxException
- {
- // 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 URLSyntaxException
- {
- try
- {
- URI connection = new URI(_url);
-
- String exchangeClass = connection.getScheme();
-
- if (exchangeClass == null)
- {
- _url = ExchangeDefaults.DIRECT_EXCHANGE_CLASS + "://" + "" + "//" + _url;
- // URLHelper.parseError(-1, "Exchange Class not specified.", _url);
- parseBindingURL();
-
- return;
- }
- else
- {
- setExchangeClass(exchangeClass);
- }
-
- String exchangeName = connection.getHost();
-
- if (exchangeName == null)
- {
- if (getExchangeClass().equals(ExchangeDefaults.DIRECT_EXCHANGE_CLASS))
- {
- setExchangeName("");
- }
- else
- {
- throw URLHelper.parseError(-1, "Exchange Name not specified.", _url);
- }
- }
- else
- {
- setExchangeName(exchangeName);
- }
-
- String queueName;
-
- if ((connection.getPath() == null) || connection.getPath().equals(""))
- {
- throw URLHelper.parseError(_url.indexOf(_exchangeName.toString()) + _exchangeName.length(),
- "Destination or Queue requried", _url);
- }
- else
- {
- int slash = connection.getPath().indexOf("/", 1);
- if (slash == -1)
- {
- throw URLHelper.parseError(_url.indexOf(_exchangeName.toString()) + _exchangeName.length(),
- "Destination requried", _url);
- }
- else
- {
- String path = connection.getPath();
- setDestinationName(path.substring(1, slash));
-
- // We don't set queueName yet as the actual value we use depends on options set
- // when we are dealing with durable subscriptions
-
- queueName = path.substring(slash + 1);
-
- }
- }
-
- URLHelper.parseOptions(_options, connection.getQuery());
-
- processOptions();
-
- // We can now call setQueueName as the URL is full parsed.
-
- setQueueName(queueName);
-
- // Fragment is #string (not used)
- _logger.debug("URL Parsed: " + this);
-
- }
- catch (URISyntaxException uris)
- {
-
- throw URLHelper.parseError(uris.getIndex(), uris.getReason(), uris.getInput());
-
- }
- }
-
- private void setExchangeClass(String exchangeClass)
- {
- setExchangeClass(new AMQShortString(exchangeClass));
- }
-
- private void setQueueName(String name) throws URLSyntaxException
- {
- setQueueName(new AMQShortString(name));
- }
-
- private void setDestinationName(String name)
- {
- setDestinationName(new AMQShortString(name));
- }
-
- private void setExchangeName(String exchangeName)
- {
- setExchangeName(new AMQShortString(exchangeName));
- }
-
- private void processOptions()
- {
- // this is where we would parse any options that needed more than just storage.
- }
-
- 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) throws URLSyntaxException
- {
- if (_exchangeClass.equals(ExchangeDefaults.TOPIC_EXCHANGE_CLASS))
- {
- if (Boolean.parseBoolean(getOption(OPTION_DURABLE)))
- {
- if (containsOption(BindingURL.OPTION_CLIENTID) && containsOption(BindingURL.OPTION_SUBSCRIPTION))
- {
- _queueName =
- new AMQShortString(getOption(BindingURL.OPTION_CLIENTID + ":" + BindingURL.OPTION_SUBSCRIPTION));
- }
- else
- {
- throw URLHelper.parseError(-1, "Durable subscription must have values for " + BindingURL.OPTION_CLIENTID
- + " and " + BindingURL.OPTION_SUBSCRIPTION + ".", _url);
-
- }
- }
- else
- {
- _queueName = null;
- }
- }
- else
- {
- _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))
- {
- return getQueueName();
- }
-
- if (containsOption(BindingURL.OPTION_ROUTING_KEY))
- {
- return new AMQShortString(getOption(OPTION_ROUTING_KEY));
- }
-
- return getDestinationName();
- }
-
- 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));
-
- return sb.toString();
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/url/BindingURL.java b/Final/java/common/src/main/java/org/apache/qpid/url/BindingURL.java
deleted file mode 100644
index 67be2db86f..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/url/BindingURL.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.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";
-
-
- String getURL();
-
- AMQShortString getExchangeClass();
-
- AMQShortString getExchangeName();
-
- AMQShortString getDestinationName();
-
- AMQShortString getQueueName();
-
- String getOption(String key);
-
- boolean containsOption(String key);
-
- AMQShortString getRoutingKey();
-
- String toString();
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/url/URLHelper.java b/Final/java/common/src/main/java/org/apache/qpid/url/URLHelper.java
deleted file mode 100644
index c08b443acf..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/url/URLHelper.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.url;
-
-import java.util.HashMap;
-
-public class URLHelper
-{
- public static char DEFAULT_OPTION_SEPERATOR = '&';
- public static char ALTERNATIVE_OPTION_SEPARATOR = ',';
- public static char BROKER_SEPARATOR = ';';
-
- public static void parseOptions(HashMap<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(HashMap<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/Final/java/common/src/main/java/org/apache/qpid/url/URLSyntaxException.java b/Final/java/common/src/main/java/org/apache/qpid/url/URLSyntaxException.java
deleted file mode 100644
index 3ff7195794..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java b/Final/java/common/src/main/java/org/apache/qpid/util/CommandLineParser.java
deleted file mode 100644
index dc73bce28f..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedMessageQueueAtomicSize.java b/Final/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedMessageQueueAtomicSize.java
deleted file mode 100644
index 461cf9591d..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedMessageQueueAtomicSize.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.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();
- }
- };
- }
-
- @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/Final/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueAtomicSize.java b/Final/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueAtomicSize.java
deleted file mode 100644
index c4d7683a02..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueNoSize.java b/Final/java/common/src/main/java/org/apache/qpid/util/ConcurrentLinkedQueueNoSize.java
deleted file mode 100644
index 1f168345a1..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/util/FileUtils.java b/Final/java/common/src/main/java/org/apache/qpid/util/FileUtils.java
deleted file mode 100644
index 3b8ebc1666..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/util/FileUtils.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.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
- {
- is = new BufferedInputStream(new FileInputStream(filename));
- }
- catch (FileNotFoundException e)
- {
- throw new RuntimeException(e);
- }
-
- return readStreamAsString(is);
- }
-
- /**
- * 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);
- }
- }
-}
diff --git a/Final/java/common/src/main/java/org/apache/qpid/util/MessageQueue.java b/Final/java/common/src/main/java/org/apache/qpid/util/MessageQueue.java
deleted file mode 100644
index b5efaa61b6..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/util/PrettyPrintingUtils.java b/Final/java/common/src/main/java/org/apache/qpid/util/PrettyPrintingUtils.java
deleted file mode 100644
index 10f6a27293..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/util/PropertiesUtils.java b/Final/java/common/src/main/java/org/apache/qpid/util/PropertiesUtils.java
deleted file mode 100644
index 63cf6f252b..0000000000
--- a/Final/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/Final/java/common/src/main/java/org/apache/qpid/util/ReflectionUtils.java b/Final/java/common/src/main/java/org/apache/qpid/util/ReflectionUtils.java
deleted file mode 100644
index 495918911a..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/util/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.util;
-
-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/Final/java/common/src/main/java/org/apache/qpid/util/ReflectionUtilsException.java b/Final/java/common/src/main/java/org/apache/qpid/util/ReflectionUtilsException.java
deleted file mode 100644
index 20499641ac..0000000000
--- a/Final/java/common/src/main/java/org/apache/qpid/util/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.util;
-
-/**
- * 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/Final/java/common/src/main/resources/org/apache/qpid/ssl/qpid.cert b/Final/java/common/src/main/resources/org/apache/qpid/ssl/qpid.cert
deleted file mode 100644
index e6702108e6..0000000000
--- a/Final/java/common/src/main/resources/org/apache/qpid/ssl/qpid.cert
+++ /dev/null
Binary files differ
diff --git a/Final/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java b/Final/java/common/src/test/java/org/apache/qpid/framing/BasicContentHeaderPropertiesTest.java
deleted file mode 100644
index 4fd1f60d69..0000000000
--- a/Final/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/Final/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java b/Final/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.java
deleted file mode 100644
index e63b0df770..0000000000
--- a/Final/java/common/src/test/java/org/apache/qpid/framing/PropertyFieldTableTest.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.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"));
- }
-
- 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/Final/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java b/Final/java/common/src/test/java/org/apache/qpid/pool/PoolingFilterTest.java
deleted file mode 100644
index 6383d52298..0000000000
--- a/Final/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/Final/java/common/src/test/java/org/apache/qpid/session/TestSession.java b/Final/java/common/src/test/java/org/apache/qpid/session/TestSession.java
deleted file mode 100644
index aafc91b03b..0000000000
--- a/Final/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/Final/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java b/Final/java/common/src/test/java/org/apache/qpid/util/CommandLineParserTest.java
deleted file mode 100644
index 66fb3252df..0000000000
--- a/Final/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/Final/java/distribution/pom.xml b/Final/java/distribution/pom.xml
deleted file mode 100644
index ecfdfd5345..0000000000
--- a/Final/java/distribution/pom.xml
+++ /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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-distribution</artifactId>
- <packaging>jar</packaging>
- <name>Qpid Distribution</name>
- <version>1.0-incubating-M2</version>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- <java.source.version>1.5</java.source.version>
- <qpid.version>${pom.version}</qpid.version>
- <qpid.targetDir>${project.build.directory}</qpid.targetDir>
-
- <!-- This is an assembly/distribution pom so no test code exists -->
- <maven.test.skip>true</maven.test.skip>
- </properties>
-
- <repositories>
- <repository>
- <id>repo1.maven.org</id>
- <name>Maven eclipse Repository</name>
- <url>http://repo1.maven.org/eclipse</url>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>${pom.groupId}</groupId>
- <artifactId>qpid-broker</artifactId>
- <version>${pom.version}</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>${pom.groupId}</groupId>
- <artifactId>qpid-client</artifactId>
- <version>${pom.version}</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>${pom.groupId}.management</groupId>
- <artifactId>org.apache.qpid.management.ui</artifactId>
- <version>${pom.version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>${java.source.version}</source>
- <target>${java.source.version}</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${assembly.version}</version>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/bin.xml</descriptor>
- </descriptors>
- <finalName>qpid-${pom.version}</finalName>
- <outputDirectory>${qpid.targetDir}</outputDirectory>
- <tarLongFileMode>gnu</tarLongFileMode>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <finalName>qpid-incubating</finalName>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
-
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>distribution-package</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/bin.xml</descriptor>
- <descriptor>src/main/assembly/src.xml</descriptor>
- <descriptor>src/main/assembly/management-eclipse-plugin.xml</descriptor>
- <descriptor>src/main/assembly/management-eclipse-plugin-unix.xml</descriptor>
- </descriptors>
- <finalName>qpid-${pom.version}</finalName>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- <defaultGoal>assembly:assembly</defaultGoal>
- </build>
-
- <profiles>
- <profile>
- <id>tests</id>
-
- <dependencies>
- <dependency>
- <groupId>${pom.groupId}</groupId>
- <artifactId>qpid-broker</artifactId>
- <version>${pom.version}</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>${pom.groupId}</groupId>
- <artifactId>qpid-broker</artifactId>
- <version>${pom.version}</version>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>${pom.groupId}</groupId>
- <artifactId>qpid-client</artifactId>
- <version>${pom.version}</version>
- <type>jar</type>
- </dependency>
- <dependency>
- <groupId>${pom.groupId}</groupId>
- <artifactId>qpid-client</artifactId>
- <version>${pom.version}</version>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>${pom.groupId}</groupId>
- <artifactId>qpid-perftests</artifactId>
- <version>${pom.version}</version>
- <type>test-jar</type>
- </dependency>
- <dependency>
- <groupId>${pom.groupId}</groupId>
- <artifactId>qpid-systests</artifactId>
- <version>${pom.version}</version>
- <type>test-jar</type>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>distribution-package</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/bin-test.xml</descriptor>
- </descriptors>
- <finalName>qpid-${pom.version}</finalName>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-
- </profile>
- </profiles>
-
-</project>
diff --git a/Final/java/distribution/src/main/assembly/bin-test.xml b/Final/java/distribution/src/main/assembly/bin-test.xml
deleted file mode 100644
index 04d83916e4..0000000000
--- a/Final/java/distribution/src/main/assembly/bin-test.xml
+++ /dev/null
@@ -1,120 +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>
- <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
- <id>java-bin-with-tests</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
-
- <fileSets>
- <!-- Include the currently hardwired Apache Legal bits -->
- <fileSet>
- <directory>../resources</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- <includes>
- <include>DISCLAIMER</include>
- <include>LICENSE</include>
- <include>NOTICE</include>
- <include>README</include>
- </includes>
- <fileMode>0444</fileMode>
- </fileSet>
-
- <!-- Include any release information -->
- <fileSet>
- <directory>src/main/release</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- </fileSet>
-
- <!-- Include any release information -->
- <fileSet>
- <directory>../release-docs</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- </fileSet>
-
- <!-- Include the classpath jar qpid-incubating.jar -->
- <fileSet>
- <directory>target</directory>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <includes>
- <include>qpid-incubating.jar</include>
- </includes>
- </fileSet>
-
- <!-- Include etc -->
- <fileSet>
- <directory>../common/etc</directory>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <fileMode>0640</fileMode>
- </fileSet>
- <fileSet>
- <directory>../broker/etc</directory>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <fileMode>0640</fileMode>
- </fileSet>
-
- <!-- Include bin scripts-->
- <fileSet>
- <directory>../broker/bin</directory>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <fileMode>0750</fileMode>
- </fileSet>
- <fileSet>
- <directory>../common/bin</directory>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <fileMode>0750</fileMode>
- </fileSet>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <unpack>false</unpack>
- <excludes>
- <!-- Exclude the jar output of this build process -->
- <exclude>org.apache.qpid:qpid-distribution</exclude>
- <!-- Exclude the Console dependancies -->
- <exclude>org.apache.qpid.management:org.apache.qpid.management.ui</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.commands</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.contenttype</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.expressions</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.jobs</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.runtime</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.auth</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.registry</exclude>
- <exclude>org.eclipse.equinox:org.eclipse.equinox.common</exclude>
- <exclude>org.eclipse.equinox:org.eclipse.equinox.preferences</exclude>
- <exclude>org.eclipse.equinox:org.eclipse.equinox.registry</exclude>
- <exclude>org.eclipse.help:org.eclipse.help</exclude>
- <exclude>org.eclipse.jface:org.eclipse.jface</exclude>
- <exclude>org.eclipse.osgi:org.eclipse.osgi</exclude>
- <exclude>org.eclipse.swt:org.eclipse.swt</exclude>
- <exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86</exclude>
- <exclude>org.eclipse.ui:org.eclipse.ui</exclude>
- <exclude>org.eclipse.ui:org.eclipse.ui.forms</exclude>
- <exclude>org.eclipse.ui:org.eclipse.ui.workbench</exclude>
- </excludes>
- <scope>runtime</scope>
- </dependencySet>
- </dependencySets>
-</assembly>
diff --git a/Final/java/distribution/src/main/assembly/bin.xml b/Final/java/distribution/src/main/assembly/bin.xml
deleted file mode 100644
index 3620659e48..0000000000
--- a/Final/java/distribution/src/main/assembly/bin.xml
+++ /dev/null
@@ -1,127 +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>
- <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
- <id>java-bin</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
-
- <fileSets>
- <!-- Include the currently hardwired Apache Legal bits -->
- <fileSet>
- <directory>../resources</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- <includes>
- <include>DISCLAIMER</include>
- <include>LICENSE</include>
- <include>NOTICE</include>
- <include>README</include>
- </includes>
- <fileMode>0444</fileMode>
- </fileSet>
-
- <!-- Include any release information -->
- <fileSet>
- <directory>src/main/release</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- </fileSet>
-
- <!-- Include any release information -->
- <fileSet>
- <directory>..//release-docs</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- </fileSet>
-
- <!-- Include any release information -->
- <fileSet>
- <directory>../release-docs</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- </fileSet>
-
- <!-- Include the classpath jar qpid-incubating.jar -->
- <fileSet>
- <directory>target</directory>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <includes>
- <include>qpid-incubating.jar</include>
- </includes>
- </fileSet>
-
- <!-- Include etc -->
- <fileSet>
- <directory>../common/etc</directory>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <fileMode>0640</fileMode>
- </fileSet>
- <fileSet>
- <directory>../broker/etc</directory>
- <outputDirectory>qpid-${qpid.version}/etc</outputDirectory>
- <fileMode>0640</fileMode>
- </fileSet>
-
- <!-- Include bin scripts-->
- <fileSet>
- <directory>../broker/bin</directory>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <fileMode>0750</fileMode>
- </fileSet>
- <fileSet>
- <directory>../common/bin</directory>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <fileMode>0750</fileMode>
- </fileSet>
-
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <unpack>false</unpack>
- <excludes>
- <!-- Exclude the jar output of this build process -->
- <exclude>org.apache.qpid:qpid-distribution</exclude>
- <!-- Exclude the Console dependancies -->
- <exclude>org.apache.qpid.management:org.apache.qpid.management.ui</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.commands</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.contenttype</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.expressions</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.jobs</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.runtime</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.auth</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.registry</exclude>
- <exclude>org.eclipse.equinox:org.eclipse.equinox.common</exclude>
- <exclude>org.eclipse.equinox:org.eclipse.equinox.preferences</exclude>
- <exclude>org.eclipse.equinox:org.eclipse.equinox.registry</exclude>
- <exclude>org.eclipse.help:org.eclipse.help</exclude>
- <exclude>org.eclipse.jface:org.eclipse.jface</exclude>
- <exclude>org.eclipse.osgi:org.eclipse.osgi</exclude>
- <exclude>org.eclipse.swt:org.eclipse.swt</exclude>
- <exclude>org.eclipse.swt:org.eclipse.swt.win32.win32.x86</exclude>
- <exclude>org.eclipse.ui:org.eclipse.ui</exclude>
- <exclude>org.eclipse.ui:org.eclipse.ui.forms</exclude>
- <exclude>org.eclipse.ui:org.eclipse.ui.workbench</exclude>
- </excludes>
- <scope>runtime</scope>
- </dependencySet>
- </dependencySets>
-</assembly>
diff --git a/Final/java/distribution/src/main/assembly/management-eclipse-plugin-unix.xml b/Final/java/distribution/src/main/assembly/management-eclipse-plugin-unix.xml
deleted file mode 100644
index 02ede019e5..0000000000
--- a/Final/java/distribution/src/main/assembly/management-eclipse-plugin-unix.xml
+++ /dev/null
@@ -1,131 +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>
- <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
- <id>management-console-unix</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>tar.gz</format>
- </formats>
-<!--
- <moduleSets>
- <moduleSet>
- <includes>
- <include>org.apache.qpid.management:org.apache.qpid.management.ui</include>
- </includes>
- <binaries>
- <includeDependencies>true</includeDependencies>
- <unpack>false</unpack>
- </binaries>
- </moduleSet>
- </moduleSets>
- -->
- <fileSets>
-
-
- <!-- Include the currently hardwired Apache Legal bits -->
- <fileSet>
- <directory>../resources</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- <includes>
- <include>DISCLAIMER</include>
- <include>LICENSE</include>
- <include>NOTICE</include>
- <include>README</include>
- </includes>
- <fileMode>0444</fileMode>
- </fileSet>
-
- <fileSet>
- <directory>..</directory>
- <outputDirectory>qpidmc</outputDirectory>
- <includes>
- <include>*.txt</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>src/main/release</directory>
- <outputDirectory>qpidmc</outputDirectory>
- </fileSet>
-
- <!-- Include any release information -->
- <fileSet>
- <directory>../release-docs</directory>
- <outputDirectory>qpidmc</outputDirectory>
- </fileSet>
-
- <fileSet>
- <directory>../management/eclipse-plugin/src/main/resources/unix/configuration</directory>
- <outputDirectory>qpidmc/configuration</outputDirectory>
- </fileSet>
-
- <fileSet>
- <directory>../management/eclipse-plugin/src/main/resources</directory>
- <outputDirectory>qpidmc</outputDirectory>
- <includes>
- <include>license.eclipse.txt</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>../management/eclipse-plugin</directory>
- <outputDirectory>qpidmc</outputDirectory>
- <includes>
- <include>README.txt</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>../management/eclipse-plugin/bin</directory>
- <outputDirectory>qpidmc/bin</outputDirectory>
- <includes>
- <include>qpidmc*.sh</include>
- </includes>
- <fileMode>0777</fileMode>
- </fileSet>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>qpidmc/eclipse/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.0</outputDirectory>
- <outputFileNameMapping>${artifactId}_${version}/</outputFileNameMapping>
- <unpack>true</unpack>
- <includes>
- <include>org.eclipse.core:org.eclipse.core.runtime.compatibility.registry</include>
- </includes>
- <scope>runtime</scope>
- </dependencySet>
-
- <dependencySet>
- <outputDirectory>qpidmc/eclipse/plugins</outputDirectory>
- <outputFileNameMapping>${artifactId}_${version}.${extension}</outputFileNameMapping>
- <unpack>false</unpack>
- <excludes>
- <exclude>org.apache.qpid:qpid-distribution</exclude>
- </excludes>
- <includes>
- <include>org.eclipse.ui:org.eclipse.ui.forms</include>
- <include>org.apache.qpid.management:org.apache.qpid.management.ui</include>
- </includes>
- <scope>runtime</scope>
- </dependencySet>
-</dependencySets>
-</assembly>
diff --git a/Final/java/distribution/src/main/assembly/management-eclipse-plugin.xml b/Final/java/distribution/src/main/assembly/management-eclipse-plugin.xml
deleted file mode 100644
index 05df2c030b..0000000000
--- a/Final/java/distribution/src/main/assembly/management-eclipse-plugin.xml
+++ /dev/null
@@ -1,162 +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>
- <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
- <id>management-console-win32</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>zip</format>
- </formats>
-
- <fileSets>
-
- <!-- Include the currently hardwired Apache Legal bits -->
- <fileSet>
- <directory>../resources</directory>
- <outputDirectory>qpidmc</outputDirectory>
- <includes>
- <include>DISCLAIMER</include>
- <include>LICENSE</include>
- <include>NOTICE</include>
- <include>README</include>
- </includes>
- <fileMode>0444</fileMode>
- </fileSet>
-
- <fileSet>
- <directory>src/main/release</directory>
- <outputDirectory>qpidmc</outputDirectory>
- </fileSet>
-
- <!-- Include any release information -->
- <fileSet>
- <directory>../release-docs</directory>
- <outputDirectory>qpidmc</outputDirectory>
- </fileSet>
-
-
- <fileSet>
- <directory>..</directory>
- <outputDirectory>qpidmc</outputDirectory>
- <includes>
- <include>*.txt</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>../management/eclipse-plugin/src/main/resources/win32/configuration</directory>
- <outputDirectory>qpidmc/configuration</outputDirectory>
- </fileSet>
-
- <fileSet>
- <directory>../management/eclipse-plugin/src/main/resources</directory>
- <outputDirectory>qpidmc/eclipse</outputDirectory>
- <includes>
- <include>*.*</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>../management/eclipse-plugin</directory>
- <outputDirectory>qpidmc</outputDirectory>
- <includes>
- <include>README.txt</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>../management/eclipse-plugin/bin</directory>
- <outputDirectory>qpidmc/bin</outputDirectory>
- <excludes>
- <!-- Exclude the Unix scripts -->
- <exclude>qpidmc*.sh</exclude>
- </excludes>
- <fileMode>0777</fileMode>
- </fileSet>
-
- <!-- Required to make eclipse load the JMXRemote SASL pluging -->
- <!-- This should be removed as JMXRemote SASL module is not ASF license friendly -->
- <!-- However management console doesn't seem to work without it -->
- <fileSet>
- <directory>../management/eclipse-plugin/src/main/resources/sasl</directory>
- <outputDirectory>qpidmc/eclipse/plugins/jmxremote.sasl_1.0.1/META-INF</outputDirectory>
- <includes>
- <include>MANIFEST.MF</include>
- </includes>
- </fileSet>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>qpidmc/eclipse/plugins</outputDirectory>
- <outputFileNameMapping>${artifactId}_${version}.${extension}</outputFileNameMapping>
- <unpack>false</unpack>
- <excludes>
- <exclude>org.apache.qpid:qpid-distribution</exclude>
- <exclude>org.apache.qpid:qpid-common</exclude>
- <exclude>org.apache.qpid:qpid-broker</exclude>
- <exclude>org.apache.qpid:qpid-client</exclude>
- <exclude>commons-cli:commons-cli</exclude>
- <exclude>commons-configuration:commons-configuration</exclude>
- <exclude>commons-lang:commons-lang</exclude>
- <exclude>org.apache.mina:mina-filter-ssl</exclude>
- <exclude>org.apache.mina:mina-java5</exclude>
- <exclude>backport-util-concurrent:backport-util-concurrent</exclude>
- <exclude>org.slf4j:slf4j-simple</exclude>
- <exclude>junit:junit</exclude>
- <exclude>org.easymock:easymockclassextension</exclude>
- <exclude>commons-codec:commons-codec</exclude>
- <exclude>org.apache.geronimo.specs:geronimo-jms_1.1_spec</exclude>
- <exclude>commons-collections:commons-collections</exclude>
- <exclude>commons-lang:commons-lang</exclude>
- <exclude>org.apache.mina:mina-core</exclude>
- <exclude>commons-beanutils:commons-beanutils</exclude>
- <exclude>commons-beanutils:commons-beanutils-core</exclude>
- <exclude>commons-digester:commons-digester</exclude>
- <exclude>commons-logging:commons-logging</exclude>
- <exclude>commons-logging:commons-logging-api</exclude>
- <exclude>dom4j:dom4j</exclude>
- <exclude>isorelax:isorelax</exclude>
- <exclude>jaxen:jaxen</exclude>
- <exclude>log4j:log4j</exclude>
- <exclude>msv:msv</exclude>
- <exclude>xalan:xalan</exclude>
- <exclude>xml-apis:xml-apis</exclude>
- <exclude>saxpath:saxpath</exclude>
- <exclude>servletapi:servletapi</exclude>
- <exclude>relaxngDatatype:relaxngDatatype</exclude>
- <exclude>xerces:xercesImpl</exclude>
- <exclude>javax.servlet:servlet-api</exclude>
- <exclude>org.eclipse.core:org.eclipse.core.runtime.compatibility.registry</exclude>
- </excludes>
- <scope>runtime</scope>
- </dependencySet>
- <dependencySet>
- <outputDirectory>qpidmc/eclipse/plugins/org.eclipse.core.runtime.compatibility.registry_3.2.0</outputDirectory>
- <outputFileNameMapping>${artifactId}_${version}/</outputFileNameMapping>
- <unpack>true</unpack>
- <includes>
- <include>org.eclipse.core:org.eclipse.core.runtime.compatibility.registry</include>
- </includes>
- <scope>runtime</scope>
- </dependencySet>
- </dependencySets>
-
-</assembly>
diff --git a/Final/java/distribution/src/main/assembly/src.xml b/Final/java/distribution/src/main/assembly/src.xml
deleted file mode 100644
index efdc4d98f4..0000000000
--- a/Final/java/distribution/src/main/assembly/src.xml
+++ /dev/null
@@ -1,106 +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>
- <!-- id typically identifies the "type" (src vs bin etc) of the assembly -->
- <id>java-src</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
-
- <fileSets>
- <fileSet>
- <directory>../resources</directory>
- <outputDirectory>qpid-${qpid.version}-src</outputDirectory>
- <includes>
- <include>DISCLAIMER</include>
- <include>LICENSE</include>
- <include>NOTICE</include>
- <include>README</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>src/main/release</directory>
- <outputDirectory>qpid-${qpid.version}-src</outputDirectory>
- </fileSet>
-
- <!-- Include any release information -->
- <fileSet>
- <directory>../release-docs</directory>
- <outputDirectory>qpid-${qpid.version}-src</outputDirectory>
- </fileSet>
-
- <fileSet>
- <directory>..</directory>
- <outputDirectory>qpid-${qpid.version}-src/java</outputDirectory>
- <excludes>
- <exclude>build.xml</exclude>
- <exclude>distribution/build.xml</exclude>
- <exclude>benchmark</exclude>
- <exclude>benchmark/**/*</exclude>
- <exclude>**/target</exclude>
- <exclude>**/target/**/*</exclude>
- <exclude>**/build</exclude>
- <exclude>**/build/**/*</exclude>
- <exclude>**/.settings</exclude>
- <exclude>**/.classpath</exclude>
- <exclude>**/.project</exclude>
- <exclude>**/.wtpmodules</exclude>
- <exclude>**/surefire*</exclude>
- <exclude>**/cobertura.ser</exclude>
- <exclude>bin</exclude>
- <exclude>bin/*</exclude>
- <exclude>lib</exclude>
- <exclude>lib/**/*</exclude>
- <exclude>**/var/journal</exclude>
- <exclude>**/build.out*</exclude>
- <exclude>**/eclipse-plugin/bin/**</exclude>
- <exclude>**/eclipse-plugin/plugins/**</exclude>
- <exclude>**/eclipse-plugin/src/main/resources/**</exclude>
- </excludes>
- </fileSet>
-
- <fileSet>
- <directory>../../gentools</directory>
- <outputDirectory>qpid-${qpid.version}-src/gentools</outputDirectory>
- <excludes>
- <exclude>**/build</exclude>
- <exclude>**/build/**/*</exclude>
- <exclude>**/*.class</exclude>
- </excludes>
- </fileSet>
-
- <fileSet>
- <directory>../../specs</directory>
- <outputDirectory>qpid-${qpid.version}-src/specs</outputDirectory>
- <includes>
- <include>amqp.0-8.xml</include>
- <include>cluster.0-8.xml</include>
- </includes>
- </fileSet>
-
- <fileSet>
- <directory>../../python</directory>
- <outputDirectory>qpid-${qpid.version}-src/python</outputDirectory>
- </fileSet>
- </fileSets>
-</assembly>
diff --git a/Final/java/doc/AMQBlazeDetailedDesign.vsd b/Final/java/doc/AMQBlazeDetailedDesign.vsd
deleted file mode 100644
index 90577c69cf..0000000000
--- a/Final/java/doc/AMQBlazeDetailedDesign.vsd
+++ /dev/null
Binary files differ
diff --git a/Final/java/doc/FramingClassDiagram.vsd b/Final/java/doc/FramingClassDiagram.vsd
deleted file mode 100644
index 8db65255ea..0000000000
--- a/Final/java/doc/FramingClassDiagram.vsd
+++ /dev/null
Binary files differ
diff --git a/Final/java/etc/coding_standards.xml b/Final/java/etc/coding_standards.xml
deleted file mode 100644
index 8f8b808884..0000000000
--- a/Final/java/etc/coding_standards.xml
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!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/Final/java/etc/license_header.txt b/Final/java/etc/license_header.txt
deleted file mode 100644
index 02ee6e8f98..0000000000
--- a/Final/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/Final/java/etc/log4j.xml b/Final/java/etc/log4j.xml
deleted file mode 100644
index 266c466a3a..0000000000
--- a/Final/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/Final/java/integrationtests/README.txt b/Final/java/integrationtests/README.txt
deleted file mode 100644
index 00a21883a9..0000000000
--- a/Final/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/Final/java/integrationtests/docs/RunningSustainedTests.txt b/Final/java/integrationtests/docs/RunningSustainedTests.txt
deleted file mode 100644
index db4405a32d..0000000000
--- a/Final/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/Final/java/integrationtests/jar-with-dependencies.xml b/Final/java/integrationtests/jar-with-dependencies.xml
deleted file mode 100644
index 3e95e7ab22..0000000000
--- a/Final/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/Final/java/integrationtests/pom.xml b/Final/java/integrationtests/pom.xml
deleted file mode 100644
index c13e300386..0000000000
--- a/Final/java/integrationtests/pom.xml
+++ /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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-integrationtests</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid Integration Tests</name>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-systests</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.4.0</version>
- </dependency>
-
- <dependency>
- <groupId>uk.co.thebadgerset</groupId>
- <artifactId>junit-toolkit</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <!-- JUnit is a compile and runtime dependancy for these tests, not just a test time dependency. -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <!-- These need to be included at compile time only, for the retrotranslator verification to find them. -->
- <dependency>
- <groupId>net.sf.retrotranslator</groupId>
- <artifactId>retrotranslator-runtime</artifactId>
- <scope>provided</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- </plugin>
-
- <!-- Backports the module to Java 1.4. This is done during the packaging phase as a transformation of the Jar. -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>retrotranslator-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>retro-intergration-tests</id>
- <phase>package</phase>
- <goals>
- <goal>translate-project</goal>
- </goals>
- <configuration>
- <!--<destdir>${project.build.directory}/retro-classes</destdir>-->
- <destjar>${project.build.directory}/${project.build.finalName}-java14.jar</destjar>
- <verify>${retrotranslator.verify}</verify>
- <verifyClasspath>
- <element>${retrotranslator.1.4-rt-path}</element>
- <element>${retrotranslator.1.4-jce-path}</element>
- <element>${retrotranslator.1.4-jsse-path}</element>
- <element>${retrotranslator.1.4-sasl-path}</element>
- </verifyClasspath>
- <failonwarning>false</failonwarning>
- <classifier>java14</classifier>
- <attach>true</attach>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-SNAPSHOT</version>
- <configuration>
- <descriptors>
- <descriptor>jar-with-dependencies.xml</descriptor>
- </descriptors>
- <outputDirectory>target</outputDirectory>
- <workDirectory>target/assembly/work</workDirectory>
- </configuration>
- </plugin>
-
- </plugins>
-
- <resources>
- <!-- Ensure all resources defined in the resources directory are copied into the build jar. -->
- <resource>
- <targetPath></targetPath>
- <filtering>false</filtering>
- <directory>src/resources</directory>
- <includes>
- <include>**/*</include>
- </includes>
- </resource>
- </resources>
-
- </build>
-
-</project>
diff --git a/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase1DummyRun.java
deleted file mode 100644
index 45bbfcd148..0000000000
--- a/Final/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/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase2BasicP2P.java
deleted file mode 100644
index 1d30ff7ca6..0000000000
--- a/Final/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/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase3BasicPubSub.java
deleted file mode 100644
index 622ddc2f64..0000000000
--- a/Final/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/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase4P2PMessageSize.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase4P2PMessageSize.java
deleted file mode 100644
index 0388c56678..0000000000
--- a/Final/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/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase5PubSubMessageSize.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/clienttestcases/TestCase5PubSubMessageSize.java
deleted file mode 100644
index ab59e16ab3..0000000000
--- a/Final/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/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase1DummyRun.java
deleted file mode 100644
index 60cd9f47f3..0000000000
--- a/Final/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/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase2BasicP2P.java
deleted file mode 100644
index 8983249daa..0000000000
--- a/Final/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/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase3BasicPubSub.java
deleted file mode 100644
index 6e87c3e3ee..0000000000
--- a/Final/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/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase4P2PMessageSize.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase4P2PMessageSize.java
deleted file mode 100644
index c3f450ec42..0000000000
--- a/Final/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/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase5PubSubMessageSize.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/interop/testcases/InteropTestCase5PubSubMessageSize.java
deleted file mode 100644
index 86a0a60ea4..0000000000
--- a/Final/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/Final/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedClientTestCase.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedClientTestCase.java
deleted file mode 100644
index 2764f2c3aa..0000000000
--- a/Final/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.isTraceEnabled())
- {
- log.trace("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/Final/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedTestCase.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/sustained/SustainedTestCase.java
deleted file mode 100644
index 5979a459ec..0000000000
--- a/Final/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/Final/java/integrationtests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java b/Final/java/integrationtests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.java
deleted file mode 100644
index 8f0ef193ef..0000000000
--- a/Final/java/integrationtests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClient.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.distributedtesting;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
-
-import org.apache.qpid.interop.clienttestcases.*;
-import org.apache.qpid.sustained.SustainedClientTestCase;
-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.ClockSynchronizer;
-import org.apache.qpid.test.framework.clocksynch.UDPClockSynchronizer;
-import org.apache.qpid.test.framework.distributedcircuit.TestClientCircuitEnd;
-
-import uk.co.thebadgerset.junit.extensions.SleepThrottle;
-import uk.co.thebadgerset.junit.extensions.Throttle;
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-import uk.co.thebadgerset.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 SustainedTestClient</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 brokerUrl The url of the broker to connect to.
- * @param virtualHost 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 brokerUrl, String virtualHost, String clientName, boolean join)
- {
- log.debug("public TestClient(String brokerUrl = " + brokerUrl + ", String virtualHost = " + virtualHost
- + ", String clientName = " + clientName + ", boolean join = " + join + "): called");
-
- // Retain the connection parameters.
- this.brokerUrl = brokerUrl;
- this.virtualHost = virtualHost;
- 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(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;
- 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);
- Collections.addAll(testCaseClasses, TestCase1DummyRun.class, TestCase2BasicP2P.class, TestCase3BasicPubSub.class,
- TestCase4P2PMessageSize.class, TestCase5PubSubMessageSize.class, SustainedClientTestCase.class,
- TestClientCircuitEnd.class);
-
- try
- {
- client.start(testCaseClasses);
- }
- catch (Exception e)
- {
- log.error("The test client was unable to start.", e);
- console.info(e.getMessage());
- System.exit(1);
- }
- }
-
- /**
- * 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/Final/java/integrationtests/src/resources/sustained-log4j.xml b/Final/java/integrationtests/src/resources/sustained-log4j.xml
deleted file mode 100644
index c5ab3137bf..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/META-INF/MANIFEST.MF b/Final/java/management/eclipse-plugin/META-INF/MANIFEST.MF
deleted file mode 100644
index a03c35c457..0000000000
--- a/Final/java/management/eclipse-plugin/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,13 +0,0 @@
-Manifest-Version: 1.0
-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-Localization: plugin
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime,
- org.eclipse.ui.forms,
- jmxremote.sasl
-Eclipse-LazyStart: true
-Bundle-Vendor: Apache Software Foundation
diff --git a/Final/java/management/eclipse-plugin/README.txt b/Final/java/management/eclipse-plugin/README.txt
deleted file mode 100644
index 5325bf27ec..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/bin/qpidmc.bat b/Final/java/management/eclipse-plugin/bin/qpidmc.bat
deleted file mode 100644
index 1f3207f043..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/bin/qpidmc.sh b/Final/java/management/eclipse-plugin/bin/qpidmc.sh
deleted file mode 100755
index 2472545a14..0000000000
--- a/Final/java/management/eclipse-plugin/bin/qpidmc.sh
+++ /dev/null
@@ -1,64 +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 [ "$JAVA_HOME" == "" ]; then
- echo "The JAVA_HOME environment variable is not defined";
- exit 0;
-fi
-
-if [ "$QPIDMC_HOME" == "" ]; then
- echo "The QPIDMC_HOME environment variable is not defined correctly";
- exit 0;
-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
-
-os=win32
-ws=win32
-arch=x86
-
-##echo $os
-##echo $ws
-##echo $arch
-
-## If this is to be run on different platform other than windows then following parameters should be passed
-## qpidmc.sh <operating system> <windowing system> <platform achitecture>
-## eg. qpidmc.sh linux motif x86
-if [ $# -eq 3 ]; then
- os=$1
- ws=$2
- arch=$3
-fi
-
-if [ $os = "SunOS" ]; then
- os="solaris"
-elif [ $os = "Linux" ]; then
- os="linux"
-fi
-
-"$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 $os -ws $ws -arch $arch
diff --git a/Final/java/management/eclipse-plugin/bin/qpidmc_gtk.sh b/Final/java/management/eclipse-plugin/bin/qpidmc_gtk.sh
deleted file mode 100755
index 10b463d63b..0000000000
--- a/Final/java/management/eclipse-plugin/bin/qpidmc_gtk.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.
-#
-
-os=`uname | tr A-Z a-z`
-arch=`uname -p`
-
-$QPIDMC_HOME/bin/qpidmc.sh $os gtk $arch
diff --git a/Final/java/management/eclipse-plugin/bin/qpidmc_motif.sh b/Final/java/management/eclipse-plugin/bin/qpidmc_motif.sh
deleted file mode 100755
index f53be75d87..0000000000
--- a/Final/java/management/eclipse-plugin/bin/qpidmc_motif.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.
-#
-
-os=`uname | tr A-Z a-z`
-arch=`uname -p`
-
-$QPIDMC_HOME/bin/qpidmc.sh $os motif $arch
diff --git a/Final/java/management/eclipse-plugin/icons/Thumbs.db b/Final/java/management/eclipse-plugin/icons/Thumbs.db
deleted file mode 100644
index 306bfb2eda..0000000000
--- a/Final/java/management/eclipse-plugin/icons/Thumbs.db
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/add.gif b/Final/java/management/eclipse-plugin/icons/add.gif
deleted file mode 100644
index 252d7ebcb8..0000000000
--- a/Final/java/management/eclipse-plugin/icons/add.gif
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/delete.gif b/Final/java/management/eclipse-plugin/icons/delete.gif
deleted file mode 100644
index 6f647666d3..0000000000
--- a/Final/java/management/eclipse-plugin/icons/delete.gif
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/icon_ClosedFolder.gif b/Final/java/management/eclipse-plugin/icons/icon_ClosedFolder.gif
deleted file mode 100644
index beb6ed134c..0000000000
--- a/Final/java/management/eclipse-plugin/icons/icon_ClosedFolder.gif
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/icon_OpenFolder.gif b/Final/java/management/eclipse-plugin/icons/icon_OpenFolder.gif
deleted file mode 100644
index a9c777343c..0000000000
--- a/Final/java/management/eclipse-plugin/icons/icon_OpenFolder.gif
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/mbean_view.png b/Final/java/management/eclipse-plugin/icons/mbean_view.png
deleted file mode 100644
index 9871b72bb8..0000000000
--- a/Final/java/management/eclipse-plugin/icons/mbean_view.png
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/notifications.gif b/Final/java/management/eclipse-plugin/icons/notifications.gif
deleted file mode 100644
index f1e585bdf7..0000000000
--- a/Final/java/management/eclipse-plugin/icons/notifications.gif
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/qpidConnections.gif b/Final/java/management/eclipse-plugin/icons/qpidConnections.gif
deleted file mode 100644
index 89489f11f2..0000000000
--- a/Final/java/management/eclipse-plugin/icons/qpidConnections.gif
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/qpidmc.gif b/Final/java/management/eclipse-plugin/icons/qpidmc.gif
deleted file mode 100644
index baf929fbc5..0000000000
--- a/Final/java/management/eclipse-plugin/icons/qpidmc.gif
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/qpidmc16.gif b/Final/java/management/eclipse-plugin/icons/qpidmc16.gif
deleted file mode 100644
index 4df535bb9a..0000000000
--- a/Final/java/management/eclipse-plugin/icons/qpidmc16.gif
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/qpidmc32.bmp b/Final/java/management/eclipse-plugin/icons/qpidmc32.bmp
deleted file mode 100644
index e42ce01dff..0000000000
--- a/Final/java/management/eclipse-plugin/icons/qpidmc32.bmp
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/qpidmc32.gif b/Final/java/management/eclipse-plugin/icons/qpidmc32.gif
deleted file mode 100644
index e42ce01dff..0000000000
--- a/Final/java/management/eclipse-plugin/icons/qpidmc32.gif
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/reconnect.gif b/Final/java/management/eclipse-plugin/icons/reconnect.gif
deleted file mode 100644
index e2f8c3e1fe..0000000000
--- a/Final/java/management/eclipse-plugin/icons/reconnect.gif
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/refresh.gif b/Final/java/management/eclipse-plugin/icons/refresh.gif
deleted file mode 100644
index a063c230ac..0000000000
--- a/Final/java/management/eclipse-plugin/icons/refresh.gif
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/splash.bmp b/Final/java/management/eclipse-plugin/icons/splash.bmp
deleted file mode 100644
index b528a508c5..0000000000
--- a/Final/java/management/eclipse-plugin/icons/splash.bmp
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/icons/stop.gif b/Final/java/management/eclipse-plugin/icons/stop.gif
deleted file mode 100644
index dc47edf069..0000000000
--- a/Final/java/management/eclipse-plugin/icons/stop.gif
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/plugin.properties b/Final/java/management/eclipse-plugin/plugin.properties
deleted file mode 100644
index 8507441886..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/plugin.xml b/Final/java/management/eclipse-plugin/plugin.xml
deleted file mode 100644
index 5774859b47..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/pom.xml b/Final/java/management/eclipse-plugin/pom.xml
deleted file mode 100644
index fd8bdce74f..0000000000
--- a/Final/java/management/eclipse-plugin/pom.xml
+++ /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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid.management</groupId>
- <artifactId>org.apache.qpid.management.ui</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid Management</name>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>../..</topDirectoryLocation>
- </properties>
-
- <repositories>
- <repository>
- <id>repo1.maven.org</id>
- <name>Maven eclipse Repository</name>
- <url>http://repo1.maven.org/eclipse</url>
- </repository>
- <repository>
- <id>apache.snapshots</id>
- <name>Apache SNAPSHOT Repository</name>
- <url>http://people.apache.org/repo/m2-snapshot-repository</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <dependencies>
- <dependency>
- <groupId>com.ibm.icu</groupId>
- <artifactId>com.ibm.icu</artifactId>
- <version>3.4.4</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.eclipse.jface</groupId>
- <artifactId>org.eclipse.jface</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>org.eclipse.core.commands</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>org.eclipse.core.contenttype</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>org.eclipse.core.expressions</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>org.eclipse.core.jobs</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>org.eclipse.core.runtime</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>org.eclipse.core.runtime.compatibility.auth</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.core</groupId>
- <artifactId>org.eclipse.core.runtime.compatibility.registry</artifactId>
- <version>3.2.0</version>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>org.eclipse.equinox.common</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>org.eclipse.equinox.preferences</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.equinox</groupId>
- <artifactId>org.eclipse.equinox.registry</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.help</groupId>
- <artifactId>org.eclipse.help</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.osgi</groupId>
- <artifactId>org.eclipse.osgi</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.swt</groupId>
- <artifactId>org.eclipse.swt.win32.win32.x86</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.swt</groupId>
- <artifactId>org.eclipse.swt</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.ui</groupId>
- <artifactId>org.eclipse.ui.forms</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.ui</groupId>
- <artifactId>org.eclipse.ui.workbench</artifactId>
- <version>3.2.1</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>org.eclipse.ui</groupId>
- <artifactId>org.eclipse.ui</artifactId>
- <version>3.2.0</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.4.0</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-broker</artifactId>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <resources>
- <resource>
- <directory>icons/</directory>
- <targetPath>icons/</targetPath>
- <includes>
- <include>**</include>
- </includes>
- </resource>
- <resource>
- <directory>icons/</directory>
- <targetPath>/</targetPath>
- <includes>
- <include>splash.bmp</include>
- </includes>
- </resource>
- <resource>
- <directory>${basedir}</directory>
- <targetPath>/</targetPath>
- <includes>
- <include>plugin.xml</include>
- <include>plugin.properties</include>
- </includes>
- </resource>
- </resources>
- <plugins>
- <!--
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- </plugin>
- -->
-
- <!-- This is required to identify the JAR to eclipse as a plugin -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <archive>
- <manifestFile>META-INF/MANIFEST.MF</manifestFile>
- </archive>
- <finalName>${artifactId}_${version}</finalName>
- </configuration>
- </plugin>
-
- <!--
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>false</skip>
- </configuration>
- </plugin>
- -->
- </plugins>
- </build>
-
-</project>
diff --git a/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Activator.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Activator.java
deleted file mode 100644
index 5eab267c28..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Application.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Application.java
deleted file mode 100644
index a1c4b7ddb0..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationActionBarAdvisor.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationActionBarAdvisor.java
deleted file mode 100644
index b5c1b5074a..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.java
deleted file mode 100644
index 0ad85dbf33..0000000000
--- a/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationRegistry.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.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 String securityMechanism = System.getProperty("security", null);
- public static final String connectorClass = System.getProperty("jmxconnector");
- 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;
- }
-
- public static String getSecurityMechanism()
- {
- return securityMechanism;
- }
-
- public static String getJMXConnectorClass()
- {
- return connectorClass;
- }
-}
diff --git a/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchAdvisor.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchAdvisor.java
deleted file mode 100644
index a46fa870e4..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchWindowAdvisor.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ApplicationWorkbenchWindowAdvisor.java
deleted file mode 100644
index e3aedef28e..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Constants.java
deleted file mode 100644
index d6f895b64a..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedBean.java
deleted file mode 100644
index 31825e925d..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedObject.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedObject.java
deleted file mode 100644
index 96e0fa46c6..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedServer.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ManagedServer.java
deleted file mode 100644
index 480fdb429a..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Perspective.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/Perspective.java
deleted file mode 100644
index f93200cadf..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/ServerRegistry.java
deleted file mode 100644
index 313e143df5..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.java
deleted file mode 100644
index 53aa927299..0000000000
--- a/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AbstractAction.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.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";
-
- /**
- * 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);
- 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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.java
deleted file mode 100644
index 7a36ca6160..0000000000
--- a/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/AddServer.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.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.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.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());
-
- int x = display.getBounds().width;
- int y = display.getBounds().height;
- shell.setBounds(x/3, y/3, 425, 275);
-
- createWidgets(shell);
-
- 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));
-
- 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();
- }
- });
- }
-
-}
diff --git a/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/CloseConnection.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/CloseConnection.java
deleted file mode 100644
index a3e52149df..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/EditAttribute.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/EditAttribute.java
deleted file mode 100644
index d3af3661b0..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.java
deleted file mode 100644
index dd9e792912..0000000000
--- a/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/ReconnectServer.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.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.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.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());
-
- int x = display.getBounds().width;
- int y = display.getBounds().height;
- shell.setBounds(x/3, y/3, 350, 200);
-
- createWidgets(shell);
-
- 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));
-
- 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();
- }
- });
- }
-
-}
diff --git a/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/Refresh.java
deleted file mode 100644
index 34251c12d7..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/RemoveServer.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/RemoveServer.java
deleted file mode 100644
index e329255414..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/VersionAction.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/VersionAction.java
deleted file mode 100644
index 11db02f5a2..0000000000
--- a/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/actions/VersionAction.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.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;
- }
- }
- 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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/InfoRequiredException.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/InfoRequiredException.java
deleted file mode 100644
index 672426a59d..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/ManagementConsoleException.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/exceptions/ManagementConsoleException.java
deleted file mode 100644
index 17c127c01a..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientListener.java
deleted file mode 100644
index 2be0ddbebf..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientNotificationListener.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/ClientNotificationListener.java
deleted file mode 100644
index c6ecda4b4c..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXManagedObject.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXManagedObject.java
deleted file mode 100644
index 3561e16098..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
deleted file mode 100644
index f671a1dc9a..0000000000
--- a/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/JMXServerRegistry.java
+++ /dev/null
@@ -1,628 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.lang.reflect.Constructor;
-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 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);
- String securityMechanism = ApplicationRegistry.getSecurityMechanism();
- String connectorClassName = ApplicationRegistry.getJMXConnectorClass();
-
- if ((securityMechanism != null) && (connectorClassName != null))
- {
- createSASLConnector(securityMechanism, connectorClassName);
- }
- else
- {
- _jmxUrl = new JMXServiceURL(server.getUrl());
- _jmxc = JMXConnectorFactory.connect(_jmxUrl, null);
- }
-
- _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);
- }
-
- public MBeanServerConnection getServerConnection()
- {
- return _mbsc;
- }
-
- private void createSASLConnector(String mech, String className) throws Exception
- {
- String text = "Security mechanism " + mech + " is not supported.";
- // Check if the given connector, which supports SASL is available
- Class connectorClass = Class.forName(className);
-
- _jmxUrl = new JMXServiceURL("jmxmp", getManagedServer().getHost(), getManagedServer().getPort());
- _env = new HashMap<String, Object>();
- CallbackHandler handler;
- if (MECH_CRAMMD5.equals(mech))
- {
- // For SASL/CRAM-MD5
- 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));
- handler = new UsernameHashedPasswordCallbackHandler(getManagedServer().getUser(),
- getManagedServer().getPassword());
- _env.put("jmx.remote.profiles", SASL_CRAMMD5);
- _env.put("jmx.remote.sasl.callback.handler", handler);
-
- }
- else if (MECH_PLAIN.equals(mech))
- {
- // For SASL/PLAIN
- Security.addProvider(new SaslProvider());
- handler = new UserPasswordCallbackHandler(getManagedServer().getUser(), getManagedServer().getPassword());
- _env.put("jmx.remote.profiles", SASL_PLAIN);
- _env.put("jmx.remote.sasl.callback.handler", handler);
- }
- else
- {
- MBeanUtility.printOutput(text);
- throw new Exception(text);
- }
- // Now create the instance of JMXMPConnector
- Class[] paramTypes = {JMXServiceURL.class, Map.class};
- Constructor cons = connectorClass.getConstructor(paramTypes);
-
- Object[] args = {_jmxUrl, _env};
- Object theObject = cons.newInstance(args);
-
- _jmxc = (JMXConnector)theObject;
-
- Thread connectorThread = new Thread(new ConnectorThread());
- connectorThread.start();
- long timeNow = System.currentTimeMillis();
- connectorThread.join(ApplicationRegistry.timeout);
-
- if (_connectionException != null)
- {
- throw _connectionException;
- }
- if (!_connected)
- {
- if (System.currentTimeMillis() - timeNow >= ApplicationRegistry.timeout)
- throw new Exception("Qpid server connection timed out");
- else
- throw new Exception("Qpid server connection failed");
- }
- }
-
- private class ConnectorThread implements Runnable
- {
- public void run()
- {
- try
- {
- _connected = false;
- _connectionException = null;
-
- _jmxc.connect();
- _connected = true;
- }
- catch (Exception ex)
- {
- _connectionException = ex;
- MBeanUtility.printStackTrace(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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java
deleted file mode 100644
index 2d1883533b..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/AttributeData.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/AttributeData.java
deleted file mode 100644
index ccd4cf8df8..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ManagedAttributeModel.java
deleted file mode 100644
index b3219f15ea..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationInfoModel.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationInfoModel.java
deleted file mode 100644
index 6d4160889e..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/NotificationObject.java
deleted file mode 100644
index 926e5f0a24..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationData.java
deleted file mode 100644
index bf3b730b3e..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationDataModel.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/OperationDataModel.java
deleted file mode 100644
index 96964a81ef..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ParameterData.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/model/ParameterData.java
deleted file mode 100644
index d12217c6eb..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/CRAMMD5HashedSaslClientFactory.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/CRAMMD5HashedSaslClientFactory.java
deleted file mode 100644
index 32a0c12344..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/ClientSaslFactory.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/ClientSaslFactory.java
deleted file mode 100644
index ce9a273eaa..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/JCAProvider.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/JCAProvider.java
deleted file mode 100644
index d8189f3ac3..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/PlainSaslClient.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/PlainSaslClient.java
deleted file mode 100644
index 22190f29eb..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/SaslProvider.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/SaslProvider.java
deleted file mode 100644
index 2917de8740..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UserPasswordCallbackHandler.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UserPasswordCallbackHandler.java
deleted file mode 100644
index 1602229c85..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UsernameHashedPasswordCallbackHandler.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/sasl/UsernameHashedPasswordCallbackHandler.java
deleted file mode 100644
index f4e3d2661e..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/AttributesTabControl.java
deleted file mode 100644
index 3234503fb5..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ConnectionTypeTabControl.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ConnectionTypeTabControl.java
deleted file mode 100644
index d891a45210..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ExchangeTypeTabControl.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ExchangeTypeTabControl.java
deleted file mode 100644
index ee55b251ee..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/INotificationViewer.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/INotificationViewer.java
deleted file mode 100644
index bc560b6064..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanTypeTabControl.java
deleted file mode 100644
index 24dfb519fd..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/MBeanView.java
deleted file mode 100644
index 344c3c4e7f..0000000000
--- a/Final/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 (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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NavigationView.java
deleted file mode 100644
index 1da13a9b56..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NotificationsTabControl.java
deleted file mode 100644
index 6894080859..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NumberVerifyListener.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/NumberVerifyListener.java
deleted file mode 100644
index 1774209dae..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
deleted file mode 100644
index f2cd594684..0000000000
--- a/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/OperationTabControl.java
+++ /dev/null
@@ -1,899 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.Collections;
-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.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
- */
-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
- String securityMechanism = ApplicationRegistry.getSecurityMechanism();
- if ((MECH_CRAMMD5.equals(securityMechanism)) && PASSWORD.equalsIgnoreCase(param.getName()))
- {
- try
- {
- param.setValue(ViewUtility.getMD5HashedCharArray(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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/QueueTypeTabControl.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/QueueTypeTabControl.java
deleted file mode 100644
index 31a0bc857b..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TabControl.java
deleted file mode 100644
index c13c92066c..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/TreeObject.java
deleted file mode 100644
index 9545ed9876..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/VHNotificationsTabControl.java
deleted file mode 100644
index be25707bd3..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java b/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java
deleted file mode 100644
index 4f2b70f869..0000000000
--- a/Final/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/views/ViewUtility.java
+++ /dev/null
@@ -1,641 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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();
- }
- }
-
- public static int popupInfoMessage(String title, String message)
- {
- MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_INFORMATION | SWT.OK);
- messageBox.setMessage(message);
- messageBox.setText(title);
- int response = messageBox.open();
-
- return response;
- }
-
- public static int popupErrorMessage(String title, String message)
- {
- MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_ERROR | SWT.OK);
- messageBox.setMessage(message);
- messageBox.setText(title);
- int response = messageBox.open();
-
- return response;
- }
-
- public static int popupConfirmationMessage(String title, String message)
- {
- MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(),
- SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL);
- messageBox.setMessage(message);
- messageBox.setText(title);
- int response = messageBox.open();
-
- return response;
- }
-
- public static void popupError(String title, String message, Throwable ex)
- {
- IStatus status = new Status(IStatus.ERROR, ApplicationWorkbenchAdvisor.PERSPECTIVE_ID,
- IStatus.ERROR, ex.toString(), ex);
- ErrorDialog.openError(Display.getCurrent().getActiveShell(), title, message, status);
-
- }
-
- public static void popupError(String errorMsg)
- {
- Display display = Display.getCurrent();
- Shell shell = new Shell(display, SWT.BORDER | SWT.CLOSE | SWT.MIN | SWT.MAX);
- shell.setText("Attribute");
- shell.setLayout(new GridLayout());
- int x = display.getBounds().width;
- int y = display.getBounds().height;
- int width = 500;
- int height = 250;
- shell.setBounds(x/4, y/4, width, height);
-
- Label label = new Label(shell, SWT.NONE);
- label.setText(errorMsg);
- label.setLayoutData(new GridData(SWT.TRAIL, SWT.TOP, false, false));
-
- shell.open();
- while (!shell.isDisposed())
- {
- if (!display.readAndDispatch())
- {
- display.sleep();
- }
- }
- shell.dispose();
- }
-
- 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[] getMD5HashedCharArray(Object text) throws NoSuchAlgorithmException, UnsupportedEncodingException
- {
- byte[] data = ((String)text).getBytes("utf-8");
-
- MessageDigest md = MessageDigest.getInstance("MD5");
-
- for (byte b : data)
- {
- md.update(b);
- }
-
- byte[] digest = md.digest();
-
- char[] byteArray = new char[digest.length];
- int index = 0;
- for (byte b : digest)
- {
- byteArray[index++] = (char)b;
- }
- return byteArray;
- }
-
- 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/Final/java/management/eclipse-plugin/src/main/resources/.eclipseproduct b/Final/java/management/eclipse-plugin/src/main/resources/.eclipseproduct
deleted file mode 100644
index 28ee27ca17..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/resources/eclipse.exe b/Final/java/management/eclipse-plugin/src/main/resources/eclipse.exe
deleted file mode 100644
index 7826d1ed80..0000000000
--- a/Final/java/management/eclipse-plugin/src/main/resources/eclipse.exe
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/src/main/resources/eclipse.ini b/Final/java/management/eclipse-plugin/src/main/resources/eclipse.ini
deleted file mode 100644
index 6a4ecb5b5d..0000000000
--- a/Final/java/management/eclipse-plugin/src/main/resources/eclipse.ini
+++ /dev/null
@@ -1,4 +0,0 @@
--vmargs
--Xms40m
--Xmx256m
--Declipse.consoleLog=true
diff --git a/Final/java/management/eclipse-plugin/src/main/resources/license.eclipse.txt b/Final/java/management/eclipse-plugin/src/main/resources/license.eclipse.txt
deleted file mode 100644
index da433e89f9..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/main/resources/sasl/MANIFEST.MF b/Final/java/management/eclipse-plugin/src/main/resources/sasl/MANIFEST.MF
deleted file mode 100644
index d18b1a073d..0000000000
--- a/Final/java/management/eclipse-plugin/src/main/resources/sasl/MANIFEST.MF
+++ /dev/null
@@ -1,8 +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: .
-Bundle-Vendor:
-Bundle-Localization: plugin
diff --git a/Final/java/management/eclipse-plugin/src/main/resources/startup.jar b/Final/java/management/eclipse-plugin/src/main/resources/startup.jar
deleted file mode 100644
index 2f26eceece..0000000000
--- a/Final/java/management/eclipse-plugin/src/main/resources/startup.jar
+++ /dev/null
Binary files differ
diff --git a/Final/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini b/Final/java/management/eclipse-plugin/src/main/resources/unix/configuration/config.ini
deleted file mode 100644
index aa2d21fd48..0000000000
--- a/Final/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.motif.linux.x86,org.eclipse.swt.gtk.linux.x86_64,org.eclipse.swt.gtk.linux.x86,org.eclipse.swt.gtk.linux.ppc,org.eclipse.swt.motif.hpux.PA_RISC,org.eclipse.swt.gtk.solaris.sparc,org.eclipse.swt.motif.solaris.sparc,org.eclipse.swt.carbon.macocx,org.eclipse.ui,org.eclipse.ui.forms,org.eclipse.ui.workbench
-osgi.bundles.defaultStartLevel=4
-eof=eof \ No newline at end of file
diff --git a/Final/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini b/Final/java/management/eclipse-plugin/src/main/resources/win32/configuration/config.ini
deleted file mode 100644
index e83321e650..0000000000
--- a/Final/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/Final/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ManagementConsoleTest.java b/Final/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ManagementConsoleTest.java
deleted file mode 100644
index 56eadbb3b2..0000000000
--- a/Final/java/management/eclipse-plugin/src/test/java/org/apache/qpid/management/ui/ManagementConsoleTest.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;
-
-import junit.framework.TestCase;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.exchange.DestNameExchange;
-import org.apache.qpid.server.management.AMQManagedObject;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.AMQQueueMBean;
-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");
- }
-
- /**
- * 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 = new AMQQueue(new AMQShortString("testQueueForManagement"), false, null, false, _virtualHost);
- 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
- DestNameExchange exchange = new DestNameExchange();
- 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/Final/java/perftests/RunningPerformanceTests.txt b/Final/java/perftests/RunningPerformanceTests.txt
deleted file mode 100644
index 54291483bf..0000000000
--- a/Final/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 uk.co.thebadgerset: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/Final/java/perftests/bin/run_many.sh b/Final/java/perftests/bin/run_many.sh
deleted file mode 100755
index cca2ffec21..0000000000
--- a/Final/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/Final/java/perftests/bin/topicListener.sh b/Final/java/perftests/bin/topicListener.sh
deleted file mode 100755
index a728592cd7..0000000000
--- a/Final/java/perftests/bin/topicListener.sh
+++ /dev/null
@@ -1,33 +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-incubating.jar
-TEST_JAR=$QPID_HOME/../../../../perftests/target/qpid-perftests-1.0-incubating-M2-SNAPSHOT.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:$TEST_JAR
-
-. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.oldtopic.Listener $*
diff --git a/Final/java/perftests/bin/topicPublisher.sh b/Final/java/perftests/bin/topicPublisher.sh
deleted file mode 100755
index f9b6bc19fe..0000000000
--- a/Final/java/perftests/bin/topicPublisher.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-incubating.jar
-TEST_JAR=$QPID_HOME/../../../../perftests/target/qpid-perftests-1.0-incubating-M2-SNAPSHOT.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:$TEST_JAR
-
-. qpid-run -Damqj.logging.level="INFO" org.apache.qpid.oldtopic.Publisher $*
diff --git a/Final/java/perftests/dist-zip.xml b/Final/java/perftests/dist-zip.xml
deleted file mode 100644
index 0039bfb157..0000000000
--- a/Final/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/Final/java/perftests/distribution/pom.xml b/Final/java/perftests/distribution/pom.xml
deleted file mode 100644
index 24b9bd6b67..0000000000
--- a/Final/java/perftests/distribution/pom.xml
+++ /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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-perftests-distribution</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid Performance Tests Distribution</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- <java.source.version>1.5</java.source.version>
- <qpid.version>${pom.version}</qpid.version>
- <qpid.targetDir>${project.build.directory}</qpid.targetDir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-perftests</artifactId>
- <type>jar</type>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-perftests</artifactId>
- <type>test-jar</type>
- <version>${pom.version}</version>
- </dependency>
- <dependency>
- <groupId>uk.co.thebadgerset</groupId>
- <artifactId>junit-toolkit</artifactId>
- <scope>runtime</scope>
- </dependency>
- <dependency>
- <groupId>uk.co.thebadgerset</groupId>
- <artifactId>junit-toolkit-maven-plugin</artifactId>
- <scope>runtime</scope>
- </dependency>
- </dependencies>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>${java.source.version}</source>
- <target>${java.source.version}</target>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${assembly.version}</version>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/performance.xml</descriptor>
- </descriptors>
- <finalName>qpid-${pom.version}</finalName>
- <outputDirectory>${qpid.targetDir}</outputDirectory>
- <tarLongFileMode>gnu</tarLongFileMode>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <finalName>qpid-performance</finalName>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- </manifest>
- </archive>
- </configuration>
- </plugin>
- </plugins>
- </pluginManagement>
-
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>distribution-package</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/performance.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- </build>
-
-</project>
diff --git a/Final/java/perftests/distribution/src/main/assembly/performance.xml b/Final/java/perftests/distribution/src/main/assembly/performance.xml
deleted file mode 100644
index a564261a24..0000000000
--- a/Final/java/perftests/distribution/src/main/assembly/performance.xml
+++ /dev/null
@@ -1,103 +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>
- <id>performance-test-java</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
-
- <fileSets>
- <!-- Apache Licensing -->
- <fileSet>
- <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>
-
- <!-- Performance txt files-->
- <fileSet>
- <directory>..</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- <includes>
- <include>*.txt</include>
- </includes>
- </fileSet>
-
- <!-- Execution Scripts -->
- <fileSet>
- <directory>../bin</directory>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <includes>
- <include>*</include>
- </includes>
- <fileMode>777</fileMode>
- </fileSet>
-
- <!-- Provide Source in easy access location -->
- <fileSet>
- <directory>../src/main</directory>
- <outputDirectory>qpid-${qpid.version}/src</outputDirectory>
- <includes>
- <include>**/*.java</include>
- <include>**/*.log4j</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>../src/test</directory>
- <outputDirectory>qpid-${qpid.version}/src</outputDirectory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </fileSet>
-
- <!-- Metadata Jar -->
- <fileSet>
- <directory>target</directory>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <includes>
- <include>qpid-performance.jar</include>
- </includes>
- </fileSet>
- </fileSets>
- <dependencySets>
- <dependencySet>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <unpack>false</unpack>
- <excludes>
- <exclude>org.apache.qpid:qpid-perftests-distribution</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
-</assembly>
diff --git a/Final/java/perftests/etc/scripts/CTQ-Qpid-1.sh b/Final/java/perftests/etc/scripts/CTQ-Qpid-1.sh
deleted file mode 100755
index 057dec5c63..0000000000
--- a/Final/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/Final/java/perftests/etc/scripts/CTQ-Qpid-2.sh b/Final/java/perftests/etc/scripts/CTQ-Qpid-2.sh
deleted file mode 100755
index 08057cbf44..0000000000
--- a/Final/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/Final/java/perftests/etc/scripts/CTQ-Qpid-3.sh b/Final/java/perftests/etc/scripts/CTQ-Qpid-3.sh
deleted file mode 100755
index 0bb7e25197..0000000000
--- a/Final/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/Final/java/perftests/etc/scripts/CTQ-Qpid-4.sh b/Final/java/perftests/etc/scripts/CTQ-Qpid-4.sh
deleted file mode 100755
index 278e44d12b..0000000000
--- a/Final/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/Final/java/perftests/etc/scripts/CTQ-Qpid-5.sh b/Final/java/perftests/etc/scripts/CTQ-Qpid-5.sh
deleted file mode 100755
index 5dee0176b2..0000000000
--- a/Final/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/Final/java/perftests/etc/scripts/CTQ-Qpid-6.sh b/Final/java/perftests/etc/scripts/CTQ-Qpid-6.sh
deleted file mode 100755
index b9996da77d..0000000000
--- a/Final/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/Final/java/perftests/etc/scripts/PT-Qpid-13.sh b/Final/java/perftests/etc/scripts/PT-Qpid-13.sh
deleted file mode 100755
index c2c6d6fd81..0000000000
--- a/Final/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 uk.co.thebadgerset.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 uk.co.thebadgerset.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 uk.co.thebadgerset.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 uk.co.thebadgerset.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 uk.co.thebadgerset.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 uk.co.thebadgerset.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/Final/java/perftests/etc/scripts/PT-Qpid-14.sh b/Final/java/perftests/etc/scripts/PT-Qpid-14.sh
deleted file mode 100755
index f0adaa1c30..0000000000
--- a/Final/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 uk.co.thebadgerset.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 uk.co.thebadgerset.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 uk.co.thebadgerset.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 uk.co.thebadgerset.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 uk.co.thebadgerset.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 uk.co.thebadgerset.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/Final/java/perftests/etc/scripts/sendAndWaitClient.sh b/Final/java/perftests/etc/scripts/sendAndWaitClient.sh
deleted file mode 100755
index af4b788658..0000000000
--- a/Final/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/Final/java/perftests/jar-with-dependencies.xml b/Final/java/perftests/jar-with-dependencies.xml
deleted file mode 100644
index 5813b6334b..0000000000
--- a/Final/java/perftests/jar-with-dependencies.xml
+++ /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.
--->
-<!-- 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 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/Final/java/perftests/pom.xml b/Final/java/perftests/pom.xml
deleted file mode 100644
index e62c316d85..0000000000
--- a/Final/java/perftests/pom.xml
+++ /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.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-perftests</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid Performance Tests</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- <log4j.perftests>perftests.log4j</log4j.perftests>
- </properties>
-
- <!-- Temporary local maven repo, whilst JUnit Toolkit is still reaching stable version to add to central maven repository. -->
- <repositories>
- <repository>
- <id>junit-toolkit.snapshots</id>
- <name>JUnit Toolkit SNAPSHOT Repository</name>
- <url>http://junit-toolkit.svn.sourceforge.net/svnroot/junit-toolkit/snapshots/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <!-- Temporary local maven repo, whilst JUnit Toolkit is still reaching stable version to add to central maven repository. -->
- <pluginRepositories>
- <pluginRepository>
- <id>junit-toolkit-plugin.snapshots</id>
- <name>JUnit Toolkit SNAPSHOT Repository</name>
- <url>http://junit-toolkit.svn.sourceforge.net/svnroot/junit-toolkit/snapshots/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
-
- <dependencies>
-
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-systests</artifactId>
- </dependency>
-
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
-
- <dependency>
- <groupId>uk.co.thebadgerset</groupId>
- <artifactId>junit-toolkit</artifactId>
- </dependency>
-
- <!-- Test dependencies. -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.4.0</version>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- </plugin>
-
- <!-- The JUnit Toolkit maven2 plugin is in the process of being added to the maven repository.
-
- Configures the toolkit test runner for performance testing. These can be run from within maven, or by using the generated
- scripts.
-
- To run from within maven:
-
- mvn uk.co.thebadgerset:junit-toolkit-maven-plugin:tktest
-
- To run from the command line (after doing assembly:assembly goal):
-
- java -cp target/test_jar-jar-with-dependencies.jar uk.co.thebadgerset.junit.extensions.TKTestRunner -s 1 -r 100000
- -o target org.apache.qpid.requestreply.PingPongTestPerf
-
- To generate the scripts do:
-
- mvn uk.co.thebadgerset:junit-toolkit-maven-plugin:tkscriptgen
-
- Then to run the scripts, in the target directory do (after doing assembly:assembly goal):
-
- ./script_name.sh
-
- These scripts can find everything in the 'all test dependencies' jar created by the assembly:assembly goal.
- -->
- <plugin>
- <groupId>uk.co.thebadgerset</groupId>
- <artifactId>junit-toolkit-maven-plugin</artifactId>
-
- <configuration>
- <scriptOutDirectory>target</scriptOutDirectory>
- <testJar>${project.build.finalName}.jar</testJar>
- <systemproperties>
- <property>
- <name>-Xms</name>
- <value>256m</value>
- </property>
- <property>
- <name>-Xmx</name>
- <value>1024m</value>
- </property>
- <property>
- <name>log4j.configuration</name>
- <value>${log4j.perftests}</value>
- </property>
- <property>
- <name>amqj.logging.level</name>
- <value>warn</value>
- </property>
- <property><!-- Turn off most logging messages from the junit-toolkit test tool itself. -->
- <name>badger.level</name>
- <value>warn</value>
- </property>
- <property>
- <name>amqj.test.logging.level</name>
- <value>info</value>
- </property>
- </systemproperties>
-
- <commands>
- <!-- Single pings. These can be scaled up by overriding the parameters when calling the test script. -->
- <Ping-Once>-n Ping-Once -s[1] -r 1 -t testPingOk -o . org.apache.qpid.ping.PingTestPerf</Ping-Once>
- <Ping-Once-Async>-n Ping-Once-Async -s[1] -r 1 -t testAsyncPingOk -o . org.apache.qpid.ping.PingAsyncTestPerf</Ping-Once-Async>
- <Ping-Latency>-n Ping-Latency -s[1000] -d10S -t testPingLatency -o . org.apache.qpid.ping.PingLatencyTestPerf rate=100 batchSize=100</Ping-Latency>
-
- <!-- More example Tests. These are examples to exercise all the features of the test harness. Can scale up with option overrides. -->
- <Ping-Tx>-n Ping-Tx -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf transacted=true</Ping-Tx>
- <Ping-Size>-n Ping-Size -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=512</Ping-Size>
- <Ping-Concurrent>-n Ping-Concurrent -s[100] -c [4] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf</Ping-Concurrent>
- <Ping-Many-Queues>-n Ping-Many-Queues -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf destinationCount=4</Ping-Many-Queues>
- <Ping-Duration>-n Ping-Duration -s[100] -d10S -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf</Ping-Duration>
- <Ping-Rate>-n Ping-Rate -s[100] -d10S -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf rate=500</Ping-Rate>
- <Ping-PubSub>-n Ping-PubSub -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true</Ping-PubSub>
- <Ping-Many-Topics>-n Ping-Many-Topics -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf pubsub=true destinationCount=4</Ping-Many-Topics>
- <Ping-Persistent>-n Ping-Persistent -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true</Ping-Persistent>
- <Ping-Batch-Logging>-n Ping-Batch-Logging -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf batchSize=10</Ping-Batch-Logging>
- <Ping-Failover-Before-Send>-n Ping-Failover-Before-Send -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf commitBatchSize=10 failBeforeSend=true</Ping-Failover-Before-Send>
- <Ping-Failover-After-Send>-n Ping-Failover-After-Send -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf commitBatchSize=10 failAfterSend=true</Ping-Failover-After-Send>
- <Ping-Failover-Before-Commit>-n Ping-Failover-Before-Commit -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf commitBatchSize=10 failBeforeCommit=true</Ping-Failover-Before-Commit>
- <Ping-Failover-After-Commit>-n Ping-Failover-After-Commit -s[100] -o . -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf commitBatchSize=10 failAfterCommit=true</Ping-Failover-After-Commit>
-
- <!--
- ***** 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.
- -->
- <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 </TQR-Qpid-01>
- <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 </TQR-Qpid-02>
- <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 </TTR-Qpid-01>
- <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 </TTR-Qpid-02>
- <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 </PQR-Qpid-01>
- <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 </PQR-Qpid-02>
- <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 </PTR-Qpid-01>
- <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 </PTR-Qpid-02>
-
- <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 </TQR-Qpid-03-TX>
- <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 </TQR-Qpid-04-AUTOACK>
- <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 </TQR-Qpid-05-CLIENTACK>
- <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 </TQR-Qpid-06-DUPSOKACK>
- <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 </TQR-Qpid-07-NOACK>
- <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 </TQR-Qpid-08-PREACK>
-
- <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 </TTR-Qpid-03-TX>
- <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 </TTR-Qpid-04-AUTOACK>
- <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 </TTR-Qpid-05-CLIENTACK>
- <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 </TTR-Qpid-06-DUPSOKACK>
- <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 </TTR-Qpid-07-NOACK>
- <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 </TTR-Qpid-08-PREACK>
-
- <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 </PQR-Qpid-03-TX>
- <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 </PQR-Qpid-04-AUTOACK>
- <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 </PQR-Qpid-05-CLIENTACK>
- <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 </PQR-Qpid-06-DUPSOKACK>
- <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 </PQR-Qpid-07-NOACK>
- <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 </PQR-Qpid-08-PREACK>
-
- <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 </PTR-Qpid-03-TX>
- <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 </PTR-Qpid-04-AUTOACK>
- <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 </PTR-Qpid-05-CLIENTACK>
- <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 </PTR-Qpid-06-DUPSOKACK>
- <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 </PTR-Qpid-07-NOACK>
- <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 </PTR-Qpid-08-PREACK>
-
- <!-- Performance Tests. -->
-
- <!-- Transient, P2P Tests -->
- <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 </TQCT-Qpid-01>
- <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 </TQCT-Qpid-02>
- <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 </TQCL-Qpid-01>
- <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 </TQCL-Qpid-02>
-
- <!-- <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 </TQC-Qpid-05> -->
- <!-- <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 </TQC-Qpid-06> -->
-
- <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 </TQM-Qpid-01-512b>
- <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 </TQM-Qpid-02-512b>
- <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 </TQM-Qpid-01-1K>
- <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 </TQM-Qpid-02-1K>
- <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 </TQM-Qpid-01-5K>
- <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 </TQM-Qpid-02-5K>
- <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 </TQM-Qpid-01-10K>
- <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 </TQM-Qpid-02-10K>
- <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</TQM-Qpid-01-50K>
- <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</TQM-Qpid-02-50K>
- <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</TQM-Qpid-01-100K>
- <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</TQM-Qpid-02-100K>
- <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</TQM-Qpid-01-500K>
- <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</TQM-Qpid-02-500K>
- <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</TQM-Qpid-01-1M>
- <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</TQM-Qpid-02-1M>
-
- <!-- Transient, Pub/Sub Tests -->
- <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 </TTCT-Qpid-01>
- <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 </TTCT-Qpid-02>
- <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 </TTCL-Qpid-01>
- <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 </TTCL-Qpid-02>
-
- <!-- <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 </TTC-Qpid-05> -->
- <!-- <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 </TTC-Qpid-06> -->
-
- <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 </TTM-Qpid-01-512b>
- <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 </TTM-Qpid-02-512b>
- <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 </TTM-Qpid-01-1K>
- <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 </TTM-Qpid-02-1K>
- <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 </TTM-Qpid-01-5K>
- <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 </TTM-Qpid-02-5K>
- <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 </TTM-Qpid-01-10K>
- <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 </TTM-Qpid-02-10K>
- <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</TTM-Qpid-01-50K>
- <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</TTM-Qpid-02-50K>
- <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</TTM-Qpid-01-100K>
- <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</TTM-Qpid-02-100K>
- <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</TTM-Qpid-01-500K>
- <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</TTM-Qpid-02-500K>
- <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</TTM-Qpid-01-1M>
- <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</TTM-Qpid-02-1M>
-
- <!-- Persistent, P2P Tests -->
- <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 </PQCT-Qpid-01>
- <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 </PQCT-Qpid-02>
- <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 </PQCL-Qpid-01>
- <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 </PQCL-Qpid-02>
-
- <!-- <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 </PQC-Qpid-05> -->
- <!-- <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 </PQC-Qpid-06> -->
-
- <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 </PQM-Qpid-01-512b>
- <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 </PQM-Qpid-02-512b>
- <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 </PQM-Qpid-01-1K>
- <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 </PQM-Qpid-02-1K>
- <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 </PQM-Qpid-01-5K>
- <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 </PQM-Qpid-02-5K>
- <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 </PQM-Qpid-01-10K>
- <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 </PQM-Qpid-02-10K>
- <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</PQM-Qpid-01-50K>
- <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</PQM-Qpid-02-50K>
- <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</PQM-Qpid-01-100K>
- <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</PQM-Qpid-02-100K>
- <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</PQM-Qpid-01-500K>
- <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</PQM-Qpid-02-500K>
- <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</PQM-Qpid-01-1M>
- <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</PQM-Qpid-02-1M>
-
- <!-- Persistent, Pub/Sub Tests -->
- <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 </PTCT-Qpid-01>
- <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 </PTCT-Qpid-02>
- <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 </PTCL-Qpid-01>
- <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 </PTCL-Qpid-02>
-
- <!-- <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 </PTC-Qpid-05> -->
- <!-- <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 </PTC-Qpid-06> -->
-
- <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 </PTM-Qpid-01-512b>
- <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 </PTM-Qpid-02-512b>
- <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 </PTM-Qpid-01-1K>
- <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 </PTM-Qpid-02-1K>
- <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 </PTM-Qpid-01-5K>
- <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 </PTM-Qpid-02-5K>
- <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 </PTM-Qpid-01-10K>
- <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 </PTM-Qpid-02-10K>
- <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</PTM-Qpid-01-50K>
- <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</PTM-Qpid-02-50K>
- <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</PTM-Qpid-01-100K>
- <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</PTM-Qpid-02-100K>
- <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</PTM-Qpid-01-500K>
- <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</PTM-Qpid-02-500K>
- <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</PTM-Qpid-01-1M>
- <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</PTM-Qpid-02-1M>
-
- <!-- Benchmarking tests. -->
- <!-- Throughput. -->
- <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 </TQBT-TX-Qpid-01>
- <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 </TQBT-AA-Qpid-01>
- <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 </TQBT-NA-Qpid-01>
- <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=true consAckMode=0 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TTBT-TX-Qpid-01>
- <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 </TTBT-AA-Qpid-01>
- <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 </TTBT-NA-Qpid-01>
-
- <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 </PQBT-TX-Qpid-01>
- <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 </PQBT-AA-Qpid-01>
- <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=true consAckMode=0 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PTBT-TX-Qpid-01>
- <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 </PTBT-AA-Qpid-01>
-
- <!-- Job Queueing. 1:10 -->
- <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 </TQBL-AA-Qpid-02-01>
- <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 </TQBL-AA-Qpid-02-02>
- <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 </TQBL-AA-Qpid-02-03>
- <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 </TQBL-AA-Qpid-02-04>
- <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 </TQBL-AA-Qpid-02-05>
- <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 </TQBL-AA-Qpid-02-06>
- <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 </TQBL-AA-Qpid-02-07>
- <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 </TQBL-AA-Qpid-02-08>
- <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 </TQBL-AA-Qpid-02-09>
- <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 </TQBL-AA-Qpid-02-10>
-
- <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 </PQBL-AA-Qpid-02-01>
- <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 </PQBL-AA-Qpid-02-02>
- <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 </PQBL-AA-Qpid-02-03>
- <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 </PQBL-AA-Qpid-02-04>
- <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 </PQBL-AA-Qpid-02-05>
- <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 </PQBL-AA-Qpid-02-06>
- <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 </PQBL-AA-Qpid-02-07>
- <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 </PQBL-AA-Qpid-02-08>
- <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 </PQBL-AA-Qpid-02-09>
- <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 </PQBL-AA-Qpid-02-10>
-
- <!-- Broadcast of small sized time critical messages. Lowish rates. Transient/Persistent. 1:100, auto ack. -->
- <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 </TTBL-AA-Qpid-03-01>
- <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 </TTBL-AA-Qpid-03-02>
- <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 </TTBL-AA-Qpid-03-03>
- <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 </TTBL-AA-Qpid-03-04>
- <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 </TTBL-AA-Qpid-03-05>
- <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 </TTBL-AA-Qpid-03-06>
- <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 </TTBL-AA-Qpid-03-07>
- <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 </TTBL-AA-Qpid-03-08>
- <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 </TTBL-AA-Qpid-03-09>
- <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 </TTBL-AA-Qpid-03-10>
-
- <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 </PTBL-AA-Qpid-03-01>
- <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 </PTBL-AA-Qpid-03-02>
- <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 </PTBL-AA-Qpid-03-03>
- <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 </PTBL-AA-Qpid-03-04>
- <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 </PTBL-AA-Qpid-03-05>
- <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 </PTBL-AA-Qpid-03-06>
- <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 </PTBL-AA-Qpid-03-07>
- <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 </PTBL-AA-Qpid-03-08>
- <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 </PTBL-AA-Qpid-03-09>
- <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 </PTBL-AA-Qpid-03-10>
-
- <!-- Broadcast of medium sized time critical messages. Lowish rates. Transient/Persistent. 1:100, auto ack. -->
- <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 </TTBL-AA-Qpid-04-01>
- <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 </TTBL-AA-Qpid-04-02>
- <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 </TTBL-AA-Qpid-04-03>
- <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 </TTBL-AA-Qpid-04-04>
- <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 </TTBL-AA-Qpid-04-05>
- <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 </TTBL-AA-Qpid-04-06>
- <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 </TTBL-AA-Qpid-04-07>
- <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 </TTBL-AA-Qpid-04-08>
- <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 </TTBL-AA-Qpid-04-09>
- <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 </TTBL-AA-Qpid-04-10>
-
- <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 </PTBL-AA-Qpid-04-01>
- <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 </PTBL-AA-Qpid-04-02>
- <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 </PTBL-AA-Qpid-04-03>
- <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 </PTBL-AA-Qpid-04-04>
- <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 </PTBL-AA-Qpid-04-05>
- <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 </PTBL-AA-Qpid-04-06>
- <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 </PTBL-AA-Qpid-04-07>
- <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 </PTBL-AA-Qpid-04-08>
- <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 </PTBL-AA-Qpid-04-09>
- <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 </PTBL-AA-Qpid-04-10>
-
- <!-- Low-latency broadcast of time sensitive events. Transient, no_ack. -->
- <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 </TTBL-NA-Qpid-05-01>
- <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 </TTBL-NA-Qpid-05-02>
- <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 </TTBL-NA-Qpid-05-03>
- <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 </TTBL-NA-Qpid-05-04>
- <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 </TTBL-NA-Qpid-05-05>
- <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 </TTBL-NA-Qpid-05-06>
- <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 </TTBL-NA-Qpid-05-07>
- <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 </TTBL-NA-Qpid-05-08>
- <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 </TTBL-NA-Qpid-05-09>
- <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 </TTBL-NA-Qpid-05-10>
-
- <!-- Low-latency broadcast of medium sized time sensitive events. Transient, no_ack. -->
- <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 </TTBL-NA-Qpid-06-01>
- <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 </TTBL-NA-Qpid-06-02>
- <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 </TTBL-NA-Qpid-06-03>
- <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 </TTBL-NA-Qpid-06-04>
- <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 </TTBL-NA-Qpid-06-05>
- <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 </TTBL-NA-Qpid-06-06>
- <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 </TTBL-NA-Qpid-06-07>
- <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 </TTBL-NA-Qpid-06-08>
- <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 </TTBL-NA-Qpid-06-09>
- <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 </TTBL-NA-Qpid-06-10>
-
- <!-- Benchmarking Tests for P2P. -->
- <!--
- Bench mark 1. P2P messaging from 1:1 to 1:32, shared queue, load balancing scenario.
- Non-tx, and 1 msg per tx.
- Persistent and non-persistent.
- No rate limiting.
- Message size 256 bytes.
- -->
- <!--
- <TQBT-Qpid-01-1C> -n TQBT-Qpid-01-1C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-01-1C>
- <TQBT-Qpid-01-2C> -n TQBT-Qpid-01-2C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=2 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-01-2C>
- <TQBT-Qpid-01-4C> -n TQBT-Qpid-01-4C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=4 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-01-4C>
- <TQBT-Qpid-01-8C> -n TQBT-Qpid-01-8C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=8 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-01-8C>
- <TQBT-Qpid-01-16C>-n TQBT-Qpid-01-16C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=16 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-01-16C>
- <TQBT-Qpid-01-32C>-n TQBT-Qpid-01-32C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=32 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-01-32C>
-
- <TQBT-Qpid-02-1C> -n TQBT-Qpid-02-1C -d1M -s[1000] -c[1] -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 </TQBT-Qpid-02-1C>
- <TQBT-Qpid-02-2C> -n TQBT-Qpid-02-2C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=2 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-02-2C>
- <TQBT-Qpid-02-4C> -n TQBT-Qpid-02-4C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=4 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-02-4C>
- <TQBT-Qpid-02-8C> -n TQBT-Qpid-02-8C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=8 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-02-8C>
- <TQBT-Qpid-02-16C>-n TQBT-Qpid-02-16C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=16 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-02-16C>
- <TQBT-Qpid-02-32C>-n TQBT-Qpid-02-32C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=32 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-02-32C>
-
- <PQBT-Qpid-01-1C> -n PQBT-Qpid-01-1C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-01-1C>
- <PQBT-Qpid-01-2C> -n PQBT-Qpid-01-2C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=2 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-01-2C>
- <PQBT-Qpid-01-4C> -n PQBT-Qpid-01-4C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=4 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-01-4C>
- <PQBT-Qpid-01-8C> -n PQBT-Qpid-01-8C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=8 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-01-8C>
- <PQBT-Qpid-01-16C>-n PQBT-Qpid-01-16C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=16 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-01-16C>
- <PQBT-Qpid-01-32C>-n PQBT-Qpid-01-32C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=32 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-01-32C>
-
- <PQBT-Qpid-02-1C> -n PQBT-Qpid-02-1C -d1M -s[1000] -c[1] -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 </PQBT-Qpid-02-1C>
- <PQBT-Qpid-02-2C> -n PQBT-Qpid-02-2C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=2 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-02-2C>
- <PQBT-Qpid-02-4C> -n PQBT-Qpid-02-4C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=4 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-02-4C>
- <PQBT-Qpid-02-8C> -n PQBT-Qpid-02-8C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=8 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-02-8C>
- <PQBT-Qpid-02-16C>-n PQBT-Qpid-02-16C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=16 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-02-16C>
- <PQBT-Qpid-02-32C>-n PQBT-Qpid-02-32C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=32 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-02-32C>
-
- <TQBL-Qpid-01-1C> -n TQBL-Qpid-01-1C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-01-1C>
- <TQBL-Qpid-01-2C> -n TQBL-Qpid-01-2C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=2 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-01-2C>
- <TQBL-Qpid-01-4C> -n TQBL-Qpid-01-4C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=4 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-01-4C>
- <TQBL-Qpid-01-8C> -n TQBL-Qpid-01-8C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=8 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-01-8C>
- <TQBL-Qpid-01-16C>-n TQBL-Qpid-01-16C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=16 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-01-16C>
- <TQBL-Qpid-01-32C>-n TQBL-Qpid-01-32C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=32 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-01-32C>
-
- <TQBL-Qpid-02-1C> -n TQBL-Qpid-02-1C -d1M -s[1000] -c[1] -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=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-02-1C>
- <TQBL-Qpid-02-2C> -n TQBL-Qpid-02-2C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=2 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-02-2C>
- <TQBL-Qpid-02-4C> -n TQBL-Qpid-02-4C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=4 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-02-4C>
- <TQBL-Qpid-02-8C> -n TQBL-Qpid-02-8C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=8 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-02-8C>
- <TQBL-Qpid-02-16C>-n TQBL-Qpid-02-16C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=16 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-02-16C>
- <TQBL-Qpid-02-32C>-n TQBL-Qpid-02-32C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=32 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-02-32C>
-
- <PQBL-Qpid-01-1C> -n PQBL-Qpid-01-1C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-01-1C>
- <PQBL-Qpid-01-2C> -n PQBL-Qpid-01-2C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=2 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-01-2C>
- <PQBL-Qpid-01-4C> -n PQBL-Qpid-01-4C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=4 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-01-4C>
- <PQBL-Qpid-01-8C> -n PQBL-Qpid-01-8C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=8 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-01-8C>
- <PQBL-Qpid-01-16C>-n PQBL-Qpid-01-16C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=16 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-01-16C>
- <PQBL-Qpid-01-32C>-n PQBL-Qpid-01-32C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=32 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-01-32C>
-
- <PQBL-Qpid-02-1C> -n PQBL-Qpid-02-1C -d1M -s[1000] -c[1] -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=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-02-1C>
- <PQBL-Qpid-02-2C> -n PQBL-Qpid-02-2C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=2 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-02-2C>
- <PQBL-Qpid-02-4C> -n PQBL-Qpid-02-4C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=4 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-02-4C>
- <PQBL-Qpid-02-8C> -n PQBL-Qpid-02-8C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=8 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-02-8C>
- <PQBL-Qpid-02-16C>-n PQBL-Qpid-02-16C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=16 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-02-16C>
- <PQBL-Qpid-02-32C>-n PQBL-Qpid-02-32C -d1M -s[1000] -c[1] -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=32 transacted=false consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=1000 messageSize=256 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-02-32C>
- -->
-
- <!--
- Bench mark 2. P2P messaging 1:1, scaled up from 1 to 32 times. Queues not shared, just one to one throughput.
- Non-tx, and 1 msg per tx.
- Persistent and non-persistent.
- No rate limiting.
- Message size from 128 bytes to 1 Meg.
- -->
- <!--
- <TQBT-Qpid-03-128b>-n TQBT-Qpid-03-128b -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-03-128b>
- <TQBT-Qpid-03-256b>-n TQBT-Qpid-03-256b -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-03-256b>
- <TQBT-Qpid-03-512b>-n TQBT-Qpid-03-512b -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-03-512b>
- <TQBT-Qpid-03-1K>-n TQBT-Qpid-03-1K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-03-1K>
- <TQBT-Qpid-03-5K>-n TQBT-Qpid-03-5K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-03-5K>
- <TQBT-Qpid-03-10K>-n TQBT-Qpid-03-10K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-03-10K>
- <TQBT-Qpid-03-50K>-n TQBT-Qpid-03-50K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=51200 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-03-50K>
- <TQBT-Qpid-03-100K>-n TQBT-Qpid-03-100K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=102400 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-03-100K>
- <TQBT-Qpid-03-500K>-n TQBT-Qpid-03-500K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512000 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-03-500K>
- <TQBT-Qpid-03-1M>-n TQBT-Qpid-03-1M -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=1048576 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-03-1M>
-
- <TQBT-Qpid-04-128b>-n TQBT-Qpid-04-128b -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-04-128b>
- <TQBT-Qpid-04-256b>-n TQBT-Qpid-04-256b -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-04-256b>
- <TQBT-Qpid-04-512b>-n TQBT-Qpid-04-512b -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-04-512b>
- <TQBT-Qpid-04-1K>-n TQBT-Qpid-04-1K -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-04-1K>
- <TQBT-Qpid-04-5K>-n TQBT-Qpid-04-5K -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-04-5K>
- <TQBT-Qpid-04-10K>-n TQBT-Qpid-04-10K -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-04-10K>
- <TQBT-Qpid-04-50K>-n TQBT-Qpid-04-50K -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=51200 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-04-50K>
- <TQBT-Qpid-04-100K>-n TQBT-Qpid-04-100K -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=102400 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-04-100K>
- <TQBT-Qpid-04-500K>-n TQBT-Qpid-04-500K -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=512000 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-04-500K>
- <TQBT-Qpid-04-1M>-n TQBT-Qpid-04-1M -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=1048576 destinationCount=1 rate=0 maxPending=2000000 </TQBT-Qpid-04-1M>
-
- <PQBT-Qpid-03-128b>-n PQBT-Qpid-03-128b -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-03-128b>
- <PQBT-Qpid-03-256b>-n PQBT-Qpid-03-256b -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-03-256b>
- <PQBT-Qpid-03-512b>-n PQBT-Qpid-03-512b -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-03-512b>
- <PQBT-Qpid-03-1K>-n PQBT-Qpid-03-1K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-03-1K>
- <PQBT-Qpid-03-5K>-n PQBT-Qpid-03-5K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-03-5K>
- <PQBT-Qpid-03-10K>-n PQBT-Qpid-03-10K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-03-10K>
- <PQBT-Qpid-03-50K>-n PQBT-Qpid-03-50K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=51200 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-03-50K>
- <PQBT-Qpid-03-100K>-n PQBT-Qpid-03-100K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=102400 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-03-100K>
- <PQBT-Qpid-03-500K>-n PQBT-Qpid-03-500K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512000 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-03-500K>
- <PQBT-Qpid-03-1M>-n PQBT-Qpid-03-1M -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=1048576 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-03-1M>
-
- <PQBT-Qpid-04-128b>-n PQBT-Qpid-04-128b -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-04-128b>
- <PQBT-Qpid-04-256b>-n PQBT-Qpid-04-256b -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-04-256b>
- <PQBT-Qpid-04-512b>-n PQBT-Qpid-04-512b -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-04-512b>
- <PQBT-Qpid-04-1K>-n PQBT-Qpid-04-1K -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-04-1K>
- <PQBT-Qpid-04-5K>-n PQBT-Qpid-04-5K -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-04-5K>
- <PQBT-Qpid-04-10K>-n PQBT-Qpid-04-10K -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-04-10K>
- <PQBT-Qpid-04-50K>-n PQBT-Qpid-04-50K -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=51200 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-04-50K>
- <PQBT-Qpid-04-100K>-n PQBT-Qpid-04-100K -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=102400 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-04-100K>
- <PQBT-Qpid-04-500K>-n PQBT-Qpid-04-500K -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=512000 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-04-500K>
- <PQBT-Qpid-04-1M>-n PQBT-Qpid-04-1M -d1M -s[100] -c[1,32],samples=6,exp -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=100 messageSize=1048576 destinationCount=1 rate=0 maxPending=2000000 </PQBT-Qpid-04-1M>
-
- <TQBL-Qpid-03-128b>-n TQBL-Qpid-03-128b -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-03-128b>
- <TQBL-Qpid-03-256b>-n TQBL-Qpid-03-256b -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-03-256b>
- <TQBL-Qpid-03-512b>-n TQBL-Qpid-03-512b -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-03-512b>
- <TQBL-Qpid-03-1K>-n TQBL-Qpid-03-1K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-03-1K>
- <TQBL-Qpid-03-5K>-n TQBL-Qpid-03-5K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-03-5K>
- <TQBL-Qpid-03-10K>-n TQBL-Qpid-03-10K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-03-10K>
- <TQBL-Qpid-03-50K>-n TQBL-Qpid-03-50K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=51200 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-03-50K>
- <TQBL-Qpid-03-100K>-n TQBL-Qpid-03-100K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=102400 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-03-100K>
- <TQBL-Qpid-03-500K>-n TQBL-Qpid-03-500K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512000 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-03-500K>
- <TQBL-Qpid-03-1M>-n TQBL-Qpid-03-1M -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=false pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=1048576 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-03-1M>
-
- <TQBL-Qpid-04-128b>-n TQBL-Qpid-04-128b -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-04-128b>
- <TQBL-Qpid-04-256b>-n TQBL-Qpid-04-256b -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-04-256b>
- <TQBL-Qpid-04-512b>-n TQBL-Qpid-04-512b -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-04-512b>
- <TQBL-Qpid-04-1K>-n TQBL-Qpid-04-1K -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-04-1K>
- <TQBL-Qpid-04-5K>-n TQBL-Qpid-04-5K -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-04-5K>
- <TQBL-Qpid-04-10K>-n TQBL-Qpid-04-10K -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-04-10K>
- <TQBL-Qpid-04-50K>-n TQBL-Qpid-04-50K -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=51200 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-04-50K>
- <TQBL-Qpid-04-100K>-n TQBL-Qpid-04-100K -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=102400 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-04-100K>
- <TQBL-Qpid-04-500K>-n TQBL-Qpid-04-500K -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=512000 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-04-500K>
- <TQBL-Qpid-04-1M>-n TQBL-Qpid-04-1M -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=1048576 destinationCount=1 rate=0 maxPending=2000000 </TQBL-Qpid-04-1M>
-
- <PQBL-Qpid-03-128b>-n PQBL-Qpid-03-128b -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-03-128b>
- <PQBL-Qpid-03-256b>-n PQBL-Qpid-03-256b -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-03-256b>
- <PQBL-Qpid-03-512b>-n PQBL-Qpid-03-512b -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-03-512b>
- <PQBL-Qpid-03-1K>-n PQBL-Qpid-03-1K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-03-1K>
- <PQBL-Qpid-03-5K>-n PQBL-Qpid-03-5K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-03-5K>
- <PQBL-Qpid-03-10K>-n PQBL-Qpid-03-10K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-03-10K>
- <PQBL-Qpid-03-50K>-n PQBL-Qpid-03-50K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=51200 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-03-50K>
- <PQBL-Qpid-03-100K>-n PQBL-Qpid-03-100K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=102400 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-03-100K>
- <PQBL-Qpid-03-500K>-n PQBL-Qpid-03-500K -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=512000 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-03-500K>
- <PQBL-Qpid-03-1M>-n PQBL-Qpid-03-1M -d1M -s[100] -c[1,32],samples=6,exp -o $QPID_WORK/results -t testPingLatency org.apache.qpid.ping.PingLatencyTestPerf persistent=true pubsub=false uniqueDests=true numConsumers=1 transacted=true consTransacted=false consAckMode=1 commitBatchSize=1 batchSize=100 messageSize=1048576 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-03-1M>
-
- <PQBL-Qpid-04-128b>-n PQBL-Qpid-04-128b -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-04-128b>
- <PQBL-Qpid-04-256b>-n PQBL-Qpid-04-256b -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-04-256b>
- <PQBL-Qpid-04-512b>-n PQBL-Qpid-04-512b -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=512 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-04-512b>
- <PQBL-Qpid-04-1K>-n PQBL-Qpid-04-1K -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=1024 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-04-1K>
- <PQBL-Qpid-04-5K>-n PQBL-Qpid-04-5K -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=5120 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-04-5K>
- <PQBL-Qpid-04-10K>-n PQBL-Qpid-04-10K -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=10240 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-04-10K>
- <PQBL-Qpid-04-50K>-n PQBL-Qpid-04-50K -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=51200 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-04-50K>
- <PQBL-Qpid-04-100K>-n PQBL-Qpid-04-100K -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=102400 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-04-100K>
- <PQBL-Qpid-04-500K>-n PQBL-Qpid-04-500K -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=512000 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-04-500K>
- <PQBL-Qpid-04-1M>-n PQBL-Qpid-04-1M -d1M -s[100] -c[1,32],samples=6,exp -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=1 batchSize=100 messageSize=1048576 destinationCount=1 rate=0 maxPending=2000000 </PQBL-Qpid-04-1M>
- -->
-
- <!-- Failover Tests. -->
- <FT-Qpid-01>-n FT-Qpid-01 -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 transacted=true broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" failBeforeSend=true -o $QPID_WORK/results</FT-Qpid-01>
- <FT-Qpid-02>-n FT-Qpid-02 -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=10000 transacted=true broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" failAfterSend=true -o $QPID_WORK/results</FT-Qpid-02>
- <FT-Qpid-03>-n FT-Qpid-03 -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=1000 transacted=true broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" failAfterCommit=true -o $QPID_WORK/results</FT-Qpid-03>
- <FT-Qpid-04>-n FT-Qpid-04 -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=1000 broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" transacted=false failBeforeSend=true -o $QPID_WORK/results</FT-Qpid-04>
- <FT-Qpid-05>-n FT-Qpid-05 -s[2500] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf messageSize=256 batchSize=1000 broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" transacted=false failAfterSend=true -o $QPID_WORK/results</FT-Qpid-05>
- <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 broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" failBeforeSend=true -o $QPID_WORK/results</FT-Qpid-01-P>
- <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 broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" failAfterSend=true -o $QPID_WORK/results</FT-Qpid-02-P>
- <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 broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" failAfterCommit=true -o $QPID_WORK/results</FT-Qpid-03-P>
- <FT-Qpid-04-P>-n FT-Qpid-04-P -s[250] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=1000 broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" transacted=false failBeforeSend=true -o $QPID_WORK/results</FT-Qpid-04-P>
- <FT-Qpid-05-P>-n FT-Qpid-05-P -s[250] -t testAsyncPingOk org.apache.qpid.ping.PingAsyncTestPerf persistent=true messageSize=256 batchSize=1000 broker="tcp://127.0.0.1:5001;tcp://127.0.0.1:5002" transacted=false failAfterSend=true -o $QPID_WORK/results</FT-Qpid-05-P>
-
- </commands>
- </configuration>
-
- <executions>
- <execution>
- <phase>test</phase>
- </execution>
- </executions>
- </plugin>
-
- <!-- Bundles all the dependencies, fully expanded into a single jar, required to run the tests.
- Also builds all thescripts and this jar into distributable .zip and .tar.gz files.
-
- Usefull when bundling system, integration or performance tests into a convenient
- package to hand over to testers. To use it run:
-
- java -cp target/your_app_name-all-test-deps.jar path.to.your.Class
-
- or often:
-
- java -cp target/your_app_name-all-test-deps.jar junit.framework.textui.TestRunner path.to.your.test.Class
-
- or other JUnit test runner invocations.
- -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>2.2-SNAPSHOT</version>
- <configuration>
- <descriptors>
- <descriptor>jar-with-dependencies.xml</descriptor>
- <!--<descriptor>dist-zip.xml</descriptor>-->
- </descriptors>
- <outputDirectory>target</outputDirectory>
- <workDirectory>target/assembly/work</workDirectory>
- </configuration>
- </plugin>
-
- <!-- Build a manifest only jar with all the required jars for the broker in its classpath. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <executions>
- <execution>
- <id>test_jar</id>
- <configuration>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- </manifest>
- </archive>
- </configuration>
- <goals>
- <goal>jar</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- </plugins>
-
- <resources>
- <!-- Include source files in built jar -->
- <resource>
- <targetPath>src/</targetPath>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </resource>
- <!-- Include a log4j configuration in the jar at the root level (don't name this log4j.properties though as won't be able to override it). -->
- <resource>
- <targetPath>/</targetPath>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>perftests.log4j</include>
- </includes>
- </resource>
- </resources>
- </build>
-
-</project>
diff --git a/Final/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java b/Final/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.java
deleted file mode 100644
index 64ccb719b6..0000000000
--- a/Final/java/perftests/src/main/java/org/apache/qpid/client/message/TestMessageFactory.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.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.Queue;
-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 JMSTextMessage newJMSTextMessage(int size, String encoding) throws JMSException
- {
- ByteBuffer byteBuffer = (new SimpleByteBufferAllocator()).allocate(size, true);
- JMSTextMessage message = new JMSTextMessage(byteBuffer, encoding);
- 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/Final/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java b/Final/java/perftests/src/main/java/org/apache/qpid/config/AMQConnectionFactoryInitialiser.java
deleted file mode 100644
index cac0064785..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java b/Final/java/perftests/src/main/java/org/apache/qpid/config/AbstractConfig.java
deleted file mode 100644
index 14db74438f..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java b/Final/java/perftests/src/main/java/org/apache/qpid/config/ConnectionFactoryInitialiser.java
deleted file mode 100644
index a9984eb09a..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/config/Connector.java b/Final/java/perftests/src/main/java/org/apache/qpid/config/Connector.java
deleted file mode 100644
index ff2377f087..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java b/Final/java/perftests/src/main/java/org/apache/qpid/config/ConnectorConfig.java
deleted file mode 100644
index b120ed3f12..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java b/Final/java/perftests/src/main/java/org/apache/qpid/config/JBossConnectionFactoryInitialiser.java
deleted file mode 100644
index a0248a8f79..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/oldtopic/Config.java b/Final/java/perftests/src/main/java/org/apache/qpid/oldtopic/Config.java
deleted file mode 100644
index 5b6169ed2d..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/oldtopic/Listener.java b/Final/java/perftests/src/main/java/org/apache/qpid/oldtopic/Listener.java
deleted file mode 100644
index 4732782d4c..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/oldtopic/MessageFactory.java b/Final/java/perftests/src/main/java/org/apache/qpid/oldtopic/MessageFactory.java
deleted file mode 100644
index b2fbeb7e35..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/oldtopic/Publisher.java b/Final/java/perftests/src/main/java/org/apache/qpid/oldtopic/Publisher.java
deleted file mode 100644
index f811704323..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/perftests/QpidTestThroughputPerf.java b/Final/java/perftests/src/main/java/org/apache/qpid/perftests/QpidTestThroughputPerf.java
deleted file mode 100644
index 760d1c84a4..0000000000
--- a/Final/java/perftests/src/main/java/org/apache/qpid/perftests/QpidTestThroughputPerf.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.perftests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-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.FrameworkBaseCase;
-import org.apache.qpid.test.framework.MessagingTestConfigProperties;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-
-import uk.co.thebadgerset.junit.extensions.TestThreadAware;
-import uk.co.thebadgerset.junit.extensions.TimingController;
-import uk.co.thebadgerset.junit.extensions.TimingControllerAware;
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-import uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
-
-import java.util.LinkedList;
-
-/**
- * QpidTestThroughputPerf 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. As the time samples is taken over a reasonable
- * sized message batch, it measures message throughput.
- *
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </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.
- */
-public class QpidTestThroughputPerf extends FrameworkBaseCase implements TimingControllerAware, TestThreadAware
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(QpidTestThroughputPerf.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 QpidTestThroughputPerf(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 uk.co.thebadgerset.junit.extensions.TimingController} to set the
- * controller on an aware test.
- *
- * @param controller The timing controller.
- */
- public void setTimingController(TimingController controller)
- {
- timingController = controller;
- }
-
- /**
- * Performs test fixture creation on a per thread basis. This will only be called once for each test thread.
- */
- public void threadSetUp()
- {
- // 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(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()
- { }
-
- /**
- * 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 QpidTestThroughputPerf("testThroughput"));
-
- return suite;
- }
-}
diff --git a/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingAsyncTestPerf.java b/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingAsyncTestPerf.java
deleted file mode 100644
index 06081e6ebf..0000000000
--- a/Final/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 uk.co.thebadgerset.junit.extensions.TimingController;
-import uk.co.thebadgerset.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/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java b/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingClient.java
deleted file mode 100644
index b9632eee4c..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java b/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingDurableClient.java
deleted file mode 100644
index db6f384914..0000000000
--- a/Final/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 uk.co.thebadgerset.junit.extensions.util.MathUtils;
-import uk.co.thebadgerset.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/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingLatencyTestPerf.java b/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingLatencyTestPerf.java
deleted file mode 100644
index 16a6e9c501..0000000000
--- a/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingLatencyTestPerf.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.ping;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.message.AMQMessage;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.requestreply.PingPongProducer;
-
-import uk.co.thebadgerset.junit.extensions.TimingController;
-import uk.co.thebadgerset.junit.extensions.TimingControllerAware;
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-
-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/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java b/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingSendOnlyClient.java
deleted file mode 100644
index 2879f0c322..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingTestPerf.java b/Final/java/perftests/src/main/java/org/apache/qpid/ping/PingTestPerf.java
deleted file mode 100644
index 0c2aa80a09..0000000000
--- a/Final/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 uk.co.thebadgerset.junit.extensions.AsymptoticTestCase;
-import uk.co.thebadgerset.junit.extensions.TestThreadAware;
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-import uk.co.thebadgerset.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/Final/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongBouncer.java b/Final/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongBouncer.java
deleted file mode 100644
index 82b36bf233..0000000000
--- a/Final/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.trace("Failing Before Commit");
- doFailover();
- }
-
- session.commit();
-
- if (_failAfterCommit)
- {
- _logger.trace("Failing After Commit");
- doFailover();
- }
-
- _logger.trace("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/Final/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java b/Final/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java
deleted file mode 100644
index 99ed9f8367..0000000000
--- a/Final/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongProducer.java
+++ /dev/null
@@ -1,1688 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.AMQException;
-import org.apache.qpid.client.*;
-import org.apache.qpid.client.message.AMQMessage;
-import org.apache.qpid.client.message.TestMessageFactory;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.jms.MessageProducer;
-import org.apache.qpid.jms.Session;
-import org.apache.qpid.url.URLSyntaxException;
-import org.apache.qpid.util.CommandLineParser;
-
-import uk.co.thebadgerset.junit.extensions.BatchedThrottle;
-import uk.co.thebadgerset.junit.extensions.Throttle;
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-import javax.jms.*;
-
-import java.io.IOException;
-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 /*, MessageListener*/, ExceptionListener
-{
- /** Used for debugging. */
- private static final Logger log = Logger.getLogger(PingPongProducer.class);
-
- /** 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 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(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(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);
- }
-
- /** 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 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.
- _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);
- _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();
-
- // Create a connection to the broker.
- createConnection(_clientID);
-
- // Create transactional or non-transactional sessions, based on the command line arguments.
- _producerSession = (Session) _connection.createSession(_transacted, _ackMode);
-
- _consumerSession = new Session[_noOfConsumers];
-
- for (int i = 0; i < _noOfConsumers; i++)
- {
- _consumerSession[i] = (Session) _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 AMQException Any underlying exceptions are allowed to fall through.
- * @throws URLSyntaxException Any underlying exceptions are allowed to fall through.
- */
- protected void createConnection(String clientID) throws AMQException, URLSyntaxException
- {
- // log.debug("protected void createConnection(String clientID = " + clientID + "): called");
-
- // log.debug("Creating a connection for the message producer.");
-
- _connection = new AMQConnection(_brokerDetails, _username, _password, clientID, _virtualpath);
-
- // log.debug("Creating " + _noOfConsumers + " connections for the consumers.");
-
- _consumerConnection = new Connection[_noOfConsumers];
-
- for (int i = 0; i < _noOfConsumers; i++)
- {
- _consumerConnection[i] = new AMQConnection(_brokerDetails, _username, _password, clientID, _virtualpath);
- }
- }
-
- /**
- * 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.
- * @throws AMQException Any AMQExceptions are allowed to fall through.
- */
- public void createPingDestinations(int noOfDestinations, String selector, String rootName, boolean unique,
- boolean durable) throws JMSException, AMQException
- {
- /*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++)
- {
- AMQDestination 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)
- {
- if (!durable)
- {
- destination = new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_NAME, rootName + id);
- // log.debug("Created non-durable topic " + destination);
- }
- else
- {
- destination =
- AMQTopic.createDurableTopic(new AMQTopic(ExchangeDefaults.TOPIC_EXCHANGE_NAME, rootName + id),
- _clientID, (AMQConnection) _connection);
- // log.debug("Created durable topic " + destination);
- }
- }
- // Otherwise this is a p2p pinger, in which case create queues.
- else
- {
- AMQShortString destinationName = new AMQShortString(rootName + id);
- destination =
- new AMQQueue(ExchangeDefaults.DIRECT_EXCHANGE_NAME, destinationName, destinationName, false, false,
- _isDurable);
- ((AMQSession) _producerSession).createQueue(destinationName, false, _isDurable, false);
- ((AMQSession) _producerSession).bindQueue(destinationName, destinationName, null,
- ExchangeDefaults.DIRECT_EXCHANGE_NAME);
-
- // 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, PREFETCH_DEFAULT, NO_LOCAL_DEFAULT, EXCLUSIVE_DEFAULT,
- selector);
-
- 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);
- }
-
- /**
- * 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);
-
- // Warn that the bounce back client is not available.
- if (e.getLinkedException() instanceof AMQNoConsumersException)
- {
- // log.debug("No consumers on queue.");
- }
-
- 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)
- {
- // log.debug("public int getExpectedNumPings(int numpings = " + numpings + "): called");
-
- // log.debug("Each ping will be received by " + (_isPubSub ? getConsumersPerDestination() : 1) + " consumers.");
-
- return 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/Final/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongTestPerf.java b/Final/java/perftests/src/main/java/org/apache/qpid/requestreply/PingPongTestPerf.java
deleted file mode 100644
index e52deeecf1..0000000000
--- a/Final/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 uk.co.thebadgerset.junit.extensions.AsymptoticTestCase;
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-import uk.co.thebadgerset.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 uk.co.thebadgerset.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/Final/java/perftests/src/main/java/org/apache/qpid/topic/Config.java b/Final/java/perftests/src/main/java/org/apache/qpid/topic/Config.java
deleted file mode 100644
index d5c0979399..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java b/Final/java/perftests/src/main/java/org/apache/qpid/topic/Listener.java
deleted file mode 100644
index 6dcea42bfe..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java b/Final/java/perftests/src/main/java/org/apache/qpid/topic/MessageFactory.java
deleted file mode 100644
index 4efdc1cb56..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java b/Final/java/perftests/src/main/java/org/apache/qpid/topic/Publisher.java
deleted file mode 100644
index c3b19b558a..0000000000
--- a/Final/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/Final/java/perftests/src/main/java/perftests.log4j b/Final/java/perftests/src/main/java/perftests.log4j
deleted file mode 100644
index 3bd8c201f8..0000000000
--- a/Final/java/perftests/src/main/java/perftests.log4j
+++ /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.
-#
-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.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.uk.co.thebadgerset.junit.extensions=${badger.level}, console
-log4j.additivity.uk.co.thebadgerset.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/Final/java/pom.xml b/Final/java/pom.xml
deleted file mode 100644
index 28db0467d2..0000000000
--- a/Final/java/pom.xml
+++ /dev/null
@@ -1,773 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- <name>Qpid</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <packaging>pom</packaging>
-
- <scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/incubator/qpid/branches/M2/java</connection>
- <developerConnection>scm:svn:http://svn.apache.org/repos/asf/incubator/qpid/branches/M2/java</developerConnection>
- <url>http://svn.apache.org/viewvc/incubator/qpid/branches/M2/java</url>
- </scm>
-
- <prerequisites>
- <maven>2.0.4</maven>
- </prerequisites>
-
- <distributionManagement>
-
- <snapshotRepository>
- <id>apache.snapshots</id>
- <name>Apache SNAPSHOT Repository</name>
- <url>scp://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
- </snapshotRepository>
-
- <repository>
- <id>apache.incubating</id>
- <name>Apache Incubating Repository</name>
- <url>scp://people.apache.org/www/people.apache.org/repo/m2-incubating-repository</url>
- </repository>
-
- <!--
- <snapshotRepository>
- <uniqueVersion>true</uniqueVersion>
- <id>snapshot-repo</id>
- <name>Local Snapshot Repository</name>
- <url>file://${basedir}/${topDirectoryLocation}/snapshots</url>
- <layout>default</layout>
- </snapshotRepository>
- -->
-
- <!-- Qpid has a Wiki site, maven generated site not used. This is just so that it can be created locally for viewing the reports. -->
- <site>
- <id>Qpid_Site</id>
- <name>Qpid Site</name>
- <url>file:/temp</url>
- </site>
-
- </distributionManagement>
-
- <inceptionYear>2006</inceptionYear>
- <mailingLists>
- <mailingList>
- <name>Qpid Developer List</name>
- <subscribe>qpid-dev-subscribe@incubator.apache.org</subscribe>
- <unsubscribe>qpid-dev-unsubscribe@incubator.apache.org</unsubscribe>
- <post>qpid-dev@incubator.apache.org</post>
- <archive>http://mail-archives.apache.org/mod_mbox/incubator-qpid-dev</archive>
- </mailingList>
- <mailingList>
- <name>Qpid Commits List</name>
- <subscribe>qpid-commits-subscribe@incubator.apache.org</subscribe>
- <unsubscribe>qpid-commits-unsubscribe@incubator.apache.org</unsubscribe>
- <post>qpid-commits@incubator.apache.org</post>
- <archive>http://mail-archives.apache.org/mod_mbox/incubator-qpid-commits</archive>
- </mailingList>
- </mailingLists>
-
- <licenses>
- <license>
- <name>The Apache Software License, Version 2.0</name>
- <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
- <distribution>repo</distribution>
- </license>
- </licenses>
-
- <organization>
- <name>Apache Software Foundation</name>
- <url>http://www.apache.org/</url>
- </organization>
-
- <properties>
- <topDirectoryLocation>.</topDirectoryLocation>
-
- <surefire.fork.mode>never</surefire.fork.mode>
- <surefire.format>brief</surefire.format>
- <surefire.usefile>true</surefire.usefile>
- <compile.forked>false</compile.forked>
- <java.source.version>1.5</java.source.version>
- <compile.flags>-Xlint:fallthrough,finally</compile.flags>
-
- <!--
- This should always point to a default minimal log4j configuration that all developers are happy with as a useable default. To use your own
- log4j preferences set up an alternative in your settings.xml and avoid corrupting the default with private preferences.
- -->
- <!--<log4j.configuration>file:/${topDirectoryLocation}/etc/log4j.xml</log4j.configuration>-->
- <amqj.logging.level>warn</amqj.logging.level> <!-- This is referenced in the default log4j.xml -->
-
- <!--Versions for various plugins and features -->
- <antrun.version>1.2-SNAPSHOT</antrun.version>
- <!--<assembly.version>2.2-SNAPSHOT</assembly.version>-->
- <assembly.version>2.1</assembly.version>
- <cobertura.version>2.0</cobertura.version>
- <compiler.version>2.0.1</compiler.version>
- <dependency.plugin.version>1.0</dependency.plugin.version>
- <eclipse.plugin.version>2.2</eclipse.plugin.version>
- <jar.version>2.0</jar.version>
- <javadoc.version>2.0</javadoc.version>
- <junit.version>3.8.1</junit.version>
- <jxr.version>2.0</jxr.version>
- <mprojectinfo.version>2.0</mprojectinfo.version>
- <resources.version>2.2</resources.version>
- <site.version>2.0-beta-5</site.version>
- <surefire-report.version>2.1-SNAPSHOT</surefire-report.version>
- <surefire.version>2.2</surefire.version>
- <retrotranslator.plugin.version>1.0-alpha-2-SNAPSHOT</retrotranslator.plugin.version>
- <build-helper.plugin.version>1.0</build-helper.plugin.version>
- <eclipse.workspace.dir>${basedir}/${topDirectoryLocation}/../workspace</eclipse.workspace.dir>
- <clover.license.pathname>/set/clover/license/path/here</clover.license.pathname>
-
- <!-- Override these in local settings.xml to perform verification. Cannot make assumptions about 1.4 Jdk location to turn this on by default. -->
- <retrotranslator.verify>false</retrotranslator.verify>
- <retrotranslator.1.4-rt-path>pathto/rt.jar</retrotranslator.1.4-rt-path>
- <retrotranslator.1.4-jce-path>pathto/jce.jar</retrotranslator.1.4-jce-path>
- <retrotranslator.1.4-jsse-path>pathto/jsse.jar</retrotranslator.1.4-jsse-path>
- <retrotranslator.1.4-sasl-path>pathto/sasl.jar</retrotranslator.1.4-sasl-path>
-
- </properties>
-
- <modules>
- <module>common</module>
- <module>broker</module>
- <module>client</module>
- <module>cluster</module>
- <module>systests</module>
- <module>perftests</module>
- <module>integrationtests</module>
- <module>management/eclipse-plugin</module>
- <module>client/example</module>
- <module>client-java14</module>
-
- </modules>
-
-
- <build>
- <resources>
-
- <resource>
- <targetPath>META-INF/</targetPath>
- <filtering>false</filtering>
- <directory>../resources</directory>
- <includes>
- <include>DISCLAIMER</include>
- <include>LICENSE</include>
- <include>NOTICE</include>
- </includes>
- </resource>
-
- <resource>
- <directory>src/main/java</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- <exclude>**/log4j.properties</exclude>
- </excludes>
- </resource>
- <resource>
- <directory>src/main/resources</directory>
- </resource>
- <resource>
- <directory>src/main/resources-filtered</directory>
- <filtering>true</filtering>
- </resource>
- <resource>
- <directory>target/generated/src/main/resources</directory>
- </resource>
- </resources>
-
- <testResources>
- <testResource>
- <targetPath>META-INF/</targetPath>
- <filtering>false</filtering>
- <directory>../resources</directory>
- <includes>
- <include>DISCLAIMER</include>
- <include>LICENSE</include>
- <include>NOTICE</include>
- </includes>
- </testResource>
-
- <testResource>
- <directory>src/test/java</directory>
- <excludes>
- <exclude>**/*.java</exclude>
- </excludes>
- </testResource>
- <testResource>
- <directory>src/test/resources</directory>
- </testResource>
- <testResource>
- <directory>src/test/java</directory>
- <excludes>
- <exclude>**/*.xml</exclude>
- </excludes>
- <filtering>true</filtering>
- </testResource>
- </testResources>
-
- <pluginManagement>
- <plugins>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <version>${antrun.version}</version>
- <dependencies>
- <dependency>
- <groupId>ant</groupId>
- <artifactId>ant-nodeps</artifactId>
- <version>1.6.5</version>
- </dependency>
- </dependencies>
-
- <executions>
-
- <!-- This Ant task writes the module name, version and the Subversion version information out to a properties file.
- The svnversion command must be available to run from the command line for this to work. The build will not fail if
- svnversion cannot be run though.
- This is done during the 'compile' phase to reflect the version of the currently compiled code and to ensure that
- these properties are up to date when running from a file system classpath. Consider moving this to, or running a second
- time, during the 'package' phase to capture the version of any resources added to jar files.
- This svnversion command is always run in the top directory to accurately reflect the svnversion range accross all modules
- at the time of the build.
- The properties are placed into a file 'qpidversion.properties' in the target/classes directory of any child module
- that runs this plugin.
- The 'qpidversion.properties' file is loaded by the org.apache.qpid.common.QpidProperties class.
- Be carefull of the possibility that the 'common' module may run this antrun plugin and recieve its own set of
- qpidversion.properties and then the client or broker being built against an older version of the common library ending
- up with the wrong version information. This is unlikely to happen because the client or broker should pick up its own
- properties from the classpath first. If this happens it will be obvious because the productName property will be
- 'Qpid Common Utilities'. If this is a problem then push this ant task down into the client and broker poms and remove it
- from here.
- -->
- <execution>
- <id>version_properties</id>
- <phase>compile</phase>
- <configuration>
- <tasks>
-
- <exec executable="svnversion" spawn="false" failifexecutionfails="false"
- dir="${topDirectoryLocation}" outputproperty="svnversion">
- <arg line="."/>
- </exec>
-
- <!-- Write the version.properties out. -->
- <propertyfile file="target/classes/qpidversion.properties">
- <entry key="qpid.svnversion" value="${svnversion}"/>
- <entry key="qpid.name" value="${project.name}"/>
- <entry key="qpid.version" value="${project.version}"/>
- </propertyfile>
-
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>retrotranslator-maven-plugin</artifactId>
- <version>${retrotranslator.plugin.version}</version>
- </plugin>
-
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>build-helper-maven-plugin</artifactId>
- <version>${build-helper.plugin.version}</version>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <version>${jar.version}</version>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-resources-plugin</artifactId>
- <version>${resources.version}</version>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>${compiler.version}</version>
- <configuration>
- <source>${java.source.version}</source>
- <target>${java.source.version}</target>
- <fork>${compile.forked}</fork>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <version>${surefire.version}</version>
- <configuration>
- <excludes>
- <exclude>**/*$*</exclude>
- </excludes>
- <reportFormat>${surefire.format}</reportFormat>
- <useFile>${surefire.usefile}</useFile>
- <forkMode>${surefire.fork.mode}</forkMode>
- <childDelegation>false</childDelegation>
- <argLine>-ea</argLine>
- <systemProperties>
- <property>
- <name>amqj.logging.level</name>
- <value>${amqj.logging.level}</value>
- </property>
- <property>
- <name>log4j.configuration</name>
- <value>${log4j.configuration}</value>
- </property>
- </systemProperties>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-site-plugin</artifactId>
- <version>${site.version}</version>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <version>${eclipse.plugin.version}</version>
- <configuration>
- <!--downloadSources>true</downloadSources-->
- <buildcommands>
- <java.lang.String>org.eclipse.jdt.core.javabuilder</java.lang.String>
- </buildcommands>
- <projectnatures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </projectnatures>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-idea-plugin</artifactId>
- <configuration>
- <!--downloadSources>true</downloadSources-->
- <downloadJavadocs>true</downloadJavadocs>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-clover-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <licenseLocation>${clover.license.pathname}</licenseLocation>
- <jdk>${java.source.version}</jdk>
- </configuration>
- <executions>
- <execution>
- <phase>verify</phase>
- <goals>
- <goal>instrument</goal>
- <goal>aggregate</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
- <groupId>uk.co.thebadgerset</groupId>
- <artifactId>junit-toolkit-maven-plugin</artifactId>
- <version>0.6.1</version>
- </plugin>
-
-
-
-
- </plugins>
- </pluginManagement>
-
-
- <plugins>
-
- <!-- Disabled as plugin crashes on the systest module.
- Also, the resulting NOTICE file doesn't include all license info due to missing data in dependant poms.
-
- <plugin>
- <artifactId>maven-remote-resources-plugin</artifactId>
- <version>1.0-alpha-5</version>
- <executions>
- <execution>
- <goals>
- <goal>process</goal>
- </goals>
- <configuration>
- <resourceBundles>
- <resourceBundle>org.apache:apache-incubator-disclaimer-resource-bundle:1.1</resourceBundle>
- <resourceBundle>org.apache:apache-jar-resource-bundle:1.2</resourceBundle>
- </resourceBundles>
- <properties>
- <addLicense>true</addLicense>
- <projectName>Apache Qpid</projectName>
- </properties>
- </configuration>
- </execution>
- </executions>
- </plugin-->
- </plugins>
-
- <defaultGoal>install</defaultGoal>
-
- </build>
-
- <dependencyManagement>
- <dependencies>
-
- <!-- Comile time only dependencies. -->
- <dependency>
- <groupId>net.sf.retrotranslator</groupId>
- <artifactId>retrotranslator-runtime</artifactId>
- <version>1.2.1</version>
- <scope>provided</scope>
- </dependency>
-
- <!-- Compilation and run time dependecies. -->
- <dependency>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>commons-codec</groupId>
- <artifactId>commons-codec</artifactId>
- <version>1.3</version>
- </dependency>
- <dependency>
- <groupId>commons-collections</groupId>
- <artifactId>commons-collections</artifactId>
- <version>3.2</version>
- </dependency>
- <dependency>
- <groupId>commons-configuration</groupId>
- <artifactId>commons-configuration</artifactId>
- <version>1.2</version>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.1</version>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>1.0.4</version>
- </dependency>
- <dependency>
- <groupId>org.apache.geronimo.specs</groupId>
- <artifactId>geronimo-jms_1.1_spec</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>xml-resolver</groupId>
- <artifactId>xml-resolver</artifactId>
- <version>1.1</version>
- </dependency>
- <dependency>
- <groupId>net.sf.saxon</groupId>
- <artifactId>saxon</artifactId>
- <version>8.7</version>
- </dependency>
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.12</version>
- </dependency>
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-simple</artifactId>
- <version>1.4.3</version>
- </dependency>
- <dependency>
- <groupId>org.apache.mina</groupId>
- <artifactId>mina-core</artifactId>
- <version>1.0.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.mina</groupId>
- <artifactId>mina-filter-ssl</artifactId>
- <version>1.0.0</version>
- </dependency>
- <dependency>
- <groupId>org.apache.mina</groupId>
- <artifactId>mina-java5</artifactId>
- <version>1.0.0</version>
- </dependency>
- <dependency>
- <groupId>backport-util-concurrent</groupId>
- <artifactId>backport-util-concurrent</artifactId>
- <version>2.2</version>
- </dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>org.easymock</groupId>
- <artifactId>easymockclassextension</artifactId>
- <version>2.2</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>uk.co.thebadgerset</groupId>
- <artifactId>junit-toolkit</artifactId>
- <version>0.6.1</version>
- <scope>compile</scope>
- </dependency>
-
- <!-- Qpid Version Dependencies -->
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-common</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-broker</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-perftests</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-systests</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-mgmt-core</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-mgmt-client</artifactId>
- <version>${project.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-cluster</artifactId>
- <version>${project.version}</version>
- </dependency>
- </dependencies>
- </dependencyManagement>
-
- <reporting>
- <plugins>
- <!--
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>cobertura-maven-plugin</artifactId>
- <version>${cobertura.version}</version>
- </plugin>
- -->
-
- <!-- Run the javadoc report. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-javadoc-plugin</artifactId>
- <configuration>
- <tags>
- <tag>
- <name>todo</name>
- <placement>a</placement>
- <head>To do:</head>
- </tag>
- </tags>
- </configuration>
- </plugin>
-
- <!-- Generate the clover coverage report. -->
- <!--
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-clover-plugin</artifactId>
- </plugin>
- -->
-
- <!-- Standard Maven project info reports. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-project-info-reports-plugin</artifactId>
- <version>${mprojectinfo.version}</version>
- </plugin>
-
- <!-- Generate the surefire test report. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-report-plugin</artifactId>
- <version>${surefire-report.version}</version>
- </plugin>
-
- <!-- Generate the TODO lists. -->
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>taglist-maven-plugin</artifactId>
- </plugin>
-
- <!-- Generate the source code cross reference. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jxr-plugin</artifactId>
- </plugin>
-
- <!-- Minimal checkstyle rules. -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-checkstyle-plugin</artifactId>
- <configuration>
- <configLocation>${basedir}/${topDirectoryLocation}/etc/coding_standards.xml</configLocation>
- <headerLocation>${basedir}/${topDirectoryLocation}/etc/license_header.txt</headerLocation>
- </configuration>
- </plugin>
-
- <!-- Generate report on changed files. -->
- <!--
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-changelog-plugin</artifactId>
- </plugin>
- -->
-
- </plugins>
- </reporting>
-
- <repositories>
- <!-- not picking up any snapshots at the moment
- <repository>
- <id>apache.snapshots</id>
- <name>Apache SNAPSHOT Repository</name>
- <url>http://people.apache.org/repo/m2-snapshot-repository</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </repository>
- -->
- <repository>
- <id>Codehaus Snapshots</id>
- <url>http://snapshots.repository.codehaus.org/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </repository>
- </repositories>
-
- <pluginRepositories>
- <pluginRepository>
- <id>apache.snapshots</id>
- <name>Apache SNAPSHOT Repository</name>
- <url>http://people.apache.org/repo/m2-snapshot-repository</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
-
- <pluginRepository>
- <id>codehaus.snapshots</id>
- <name>Codehaus SNAPSHOT Repository</name>
- <url>http://snapshots.repository.codehaus.org</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- </pluginRepository>
-
- </pluginRepositories>
-
- <profiles>
- <profile>
- <id>fastinstall</id>
- <properties>
- <maven.test.skip>true</maven.test.skip>
- <skip.python.tests>true</skip.python.tests>
- </properties>
- </profile>
-
- <profile>
- <id>nochecks</id>
- </profile>
-
- <profile>
- <id>setup.eclipse</id>
- <build>
- <defaultGoal>process-test-sources</defaultGoal>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-eclipse-plugin</artifactId>
- <executions>
- <execution>
- <id>setup.eclipse.project</id>
- <phase>process-test-sources</phase>
- <goals>
- <goal>eclipse</goal>
- </goals>
- </execution>
- <execution>
- <id>setup.eclipse.workspace</id>
- <phase>process-test-sources</phase>
- <goals>
- <goal>add-maven-repo</goal>
- </goals>
- <configuration>
- <workspace>${eclipse.workspace.dir}</workspace>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- </profiles>
-</project>
diff --git a/Final/java/release-docs/RELEASE_NOTES.txt b/Final/java/release-docs/RELEASE_NOTES.txt
deleted file mode 100644
index ed93f3e450..0000000000
--- a/Final/java/release-docs/RELEASE_NOTES.txt
+++ /dev/null
@@ -1,160 +0,0 @@
-Apache Incubator Qpid Java M2 Release Notes
--------------------------------------------
-
-The Qpid M2 release contains support the for AMQP 0-8 specification.
-You can access the 0-8 specification using the following link.
-http://www.amqp.org/tikiwiki/tiki-index.php?page=Download
-
-For full details of Qpid capabilities, as they currently stand, 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.
-
-
-Known Issues/Outstanding Work
------------------------------
-
-You can view the outstanding task list for Qpid by visiting our JIRA:
-http://issues.apache.org/jira/browse/QPID
-
-Please note that most of the issues are fixed, but are kept open until the
-merged with trunk, at which point they will be closed
-
-Here is a filtered list for your convinience
----------------------------------------
-D-560 Add DiagnosticExchange exchange
-QPID-543 Add ability to register custom exchange types
-QPID-274 add connection configuratble timeout on
-waituntilStateHasChanged
-QPID-156 Implement persistent store with Apache compliant licence
-QPID-155 Add ability to configure (on/off) queue creation on demand
-QPID-43 Multiple-AMQP version support in the broker
-QPID-28 Allow user to select policy for undeliverable message handling
-QPID-27 Introduce user configurable redlivery delay
-QPID-22 Provide run scripts for clustered broker
-QPID-592 Limit number of bytes in write buffer queue
-QPID-583 Reinstate the old topic performance test
-QPID-582 Ensure Java codebase builds with Java 6
-QPID-567 Add basic multiversion support to Qpid for interop between M1,
-M2 and 0-8 and 0-9 AMQP implementations
-QPID-564 Reapply MINA performance patches
-QPID-430 Message Age Alerting should not depend upon queue activity
-QPID-19 Add protocol logging capability to client and broker
-QPID-11 Move protocol literals from code to AMQConstant
-QPID-659 Messages sent to a queue that uses selectors may cause high
-CPU load.
-QPID-654 ThreadPoolExecutor.getTask() can be seen WAITING causing test
-cases to hang
-QPID-653 Timeouts in tests causing spurious failures on slower machines
-QPID-647 Delivery Manager can stop starving consumers.
-QPID-645 Exception thrown while preparing TxnOp not logged or
-propogated
-QPID-643 CSDM causes duplicate message delivery.
-QPID-637 BasicConsumer.recieve can return null before the timeout
-expires due to InterruptedException
-QPID-632 ImmediateMessageTest fails occasionally because
-AMQNoConsumersException was not received.
-QPID-626 AMQSession deadlocks
-QPID-623 If all consumers of a queue use selectors then the broker will
-leak memory
-QPID-611 Queue Total size calculations can cause NPE on broker.
-QPID-610 Usages of queue.dequeue need to be checked to ensure memory
-loss doesn't occur
-QPID-609 Dispatcher threads are not always killed
-QPID-608 ConnectionTest fails because VM broker is not created
-QPID-607 Dispatcher threads do not die
-QPID-606 NPE from several systests occasionally
-QPID-604 Potential NullPointerException in FieldTable trace logging
-QPID-599 maven runs tests twice in client module
-QPID-594 Java client does not throw exceptions for failures during
-connection establishment
-QPID-590 Client can deadlock when session is accessed from two threads
-QPID-586 Client state manager is not interupted when unrecoverable
-error occurs on connection
-QPID-585 Client protocol state is maintiained between connections when
-the connection fails during initial connection
-QPID-584 Client allows RuntimeExceptions to be silently swallowed.
-QPID-579 Qpid Broker process fails to terminate on configuration errors
-QPID-578 AMQChannel.queueDeletion causes unacked msgs to be discarded.
-QPID-577 Setting a MessageListener after the connection has been
-started may result in apparent message loss.
-QPID-573 race condition between rollback() and the dispatcher thread in
-the java client
-QPID-572 broker delivers messages out of order
-QPID-558 AMQShortString should autoexpand when adding content to it
-QPID-549 AMQConnection.start() is not threadsafe
-QPID-545 Using a private queue with selector will result in non
-matching messages being left on the broker queue as they will not be consumed.
-QPID-539 HeadersExchange doesnot correctly implement isBound
-QPID-531 [Memory Leak] Broker retains messages that are consumed with
-NO_ACK
-QPID-469 Redelivered information is currently recorded per message it
-should be per message per queue.
-QPID-463 Java client doesn't close connection gracefully when faced
-with broker with unsuported protocol version
-QPID-462 Exclusive queues and with subscription that 'filtersMessages'
-will build up messages it doesn't hasInterest() in.
-QPID-397 Client closeure can be processed before final message ack.
-QPID-396 Broker OutOfMemory Error handling
-QPID-377 NumberFormatException thrown by broker when running one
-performance test
-QPID-293 setting MessageListener after connection has started can cause
-messages to be "lost" on a internal delivery queue.
-QPID-185 Amend Java Broker handling of ifUnused & ifEmpty flags
-QPID-168 qpid-server.bat needs updated to support same
-arguments/features as qpid-server (via qpid-run) bash script
-Bug QPID-168 qpid-server.bat needs updated to support same arguments/features as qpid-server (via qpid-run) bash script
-
-
-M2 Tasks Completed
--------------------
-
-The set of JIRA tasks completed as part of the M2 effort is available at:
-https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12310520&styleName=Html&version=12312116
-
-
-Here is a filtered (by Java components) version of the JIRA items
-
-QPID-190 refactoring the java broker mbean classes
-QPID-125 Moving eclipse plugin for broker management to Maven
-QPID-93 Delete the old management modules (trunk\qpid\java\management)
-QPID-418 Add ability to save user preferences to Java Management Console
-QPID-482 [Java] Small performance tweaks
-QPID-466 Create STRICT_AMQP System property to disable JMS extensions in Java client
-QPID-453 AMQShortString should implement Comparable
-QPID-421 Provide enumerated description for static constants including delivery mode
-QPID-420 Add client id to information displayed about connections on management console
-QPID-419 Introduce read-only and modify authorisation for all objects in a virtual host
-QPID-129 improving Broker MBeans
-QPID-616 Underflow in calculating message pending size in perftests.
-QPID-614 Race condition on queue browser close
-QPID-612 Duplicate temporary queue names when running unit tests
-QPID-600 Deadlocks on Connection.close
-QPID-540 Transient Broker throws NullPointerException and locks up.
-QPID-538 [Memory Leak] Connecting lots of consumers causes the broker memory to leak
-QPID-537 Make AMQMessage.incrementReference public
-QPID-527 encoding issue
-QPID-508 [Memory Leak] Broker does not return mandatory messages sent outside of a
-transaction.
-QPID-476 AMQProtocolSession channelId2SessionMap does not have sessions removed
-QPID-472 Creation of TemporaryQueues will not guarantee unqiue queue names if created
-rapidly.
-QPID-471 UserManagement panel lists all users but only after a View Users has been
-executed and is not updated on Create/Delete User
-QPID-467 Complete Interop Testing
-QPID-465 Incorrect Exception thrown from send() method.
-QPID-459 Broker doesn't correctly handle noLocal consumers when messages are
-pre-exisiting on queues.
-QPID-458 Queue Browsing Broken
-QPID-454 Message 'taken' notion is per message. But should be per message per queue
-QPID-443 Abruptly disconnecting client on transaction publish causes error
-QPID-440 Can create dangling transactions on unroutable messages.
-QPID-414 Authentication requires plain text passwords in password file
-QPID-408 Queue Depth data incorrect
-QPID-200 set/get Destination not implemented in JMSMessage impl
-QPID-166 Check for pre conditions to satisfy JMS spec requirments
-QPID-159 The following Interface implementations do not throw Exceptions as required by
-the spec
diff --git a/Final/java/resources/DISCLAIMER b/Final/java/resources/DISCLAIMER
deleted file mode 100644
index c321113c9e..0000000000
--- a/Final/java/resources/DISCLAIMER
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Qpid is an effort undergoing incubation at the Apache Software Foundation (ASF), sponsored by the Apache Incubator PMC.
-
-Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects.
-
-While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
diff --git a/Final/java/resources/LICENSE b/Final/java/resources/LICENSE
deleted file mode 100644
index 6b0b1270ff..0000000000
--- a/Final/java/resources/LICENSE
+++ /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/Final/java/resources/META-INF/DISCLAIMER b/Final/java/resources/META-INF/DISCLAIMER
deleted file mode 100644
index 1ca63e46e2..0000000000
--- a/Final/java/resources/META-INF/DISCLAIMER
+++ /dev/null
@@ -1,10 +0,0 @@
-Apache Qpid is an effort undergoing incubation at the Apache Software
-Foundation (ASF), sponsored by the Apache Incubator PMC.
-
-Incubation is required of all newly accepted projects until a further review
-indicates that the infrastructure, communications, and decision making process
-have stabilized in a manner consistent with other successful ASF projects.
-
-While incubation status is not necessarily a reflection of the completeness
-or stability of the code, it does indicate that the project has yet to be
-fully endorsed by the ASF.
diff --git a/Final/java/resources/META-INF/LICENSE b/Final/java/resources/META-INF/LICENSE
deleted file mode 100644
index 6b0b1270ff..0000000000
--- a/Final/java/resources/META-INF/LICENSE
+++ /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/Final/java/resources/META-INF/NOTICE b/Final/java/resources/META-INF/NOTICE
deleted file mode 100644
index f62ec14896..0000000000
--- a/Final/java/resources/META-INF/NOTICE
+++ /dev/null
@@ -1,105 +0,0 @@
-// ------------------------------------------------------------------
-// NOTICE file corresponding to the section 4d of The Apache License,
-// Version 2.0, in this case for Qpid Common Utilities
-// ------------------------------------------------------------------
-
-Apache Qpid
-Copyright 2006-2007 Apache Software Foundation
-
-This product includes software developed at
-Apache Software Foundation (http://www.apache.org/)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Unnamed - relaxngDatatype:relaxngDatatype:jar:20020414 (http://sourceforge.net/projects/relaxng)
-License: BSD License (http://www.opensource.org/licenses/bsd-license.php)
-
-This product includes/uses software, Apache MINA Core API (http://directory.apache.org/projects/mina/)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Unnamed - isorelax:isorelax:jar:20020414
-License: MIT license (http://www.opensource.org/licenses/mit-license.html)
-
-This product includes/uses software, SLF4J API Module (http://www.slf4j.org),
-developed by QOS.ch (http://www.qos.ch)
-License: MIT License (http://www.slf4j.org/license.html)
-
-This product includes/uses software, Commons Collections - commons-collections:commons-collections:jar:3.1,
-developed by Apache Software Foundation (http://www.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Commons Digester - commons-digester:commons-digester:jar:1.6
-developed by Apache Software Foundation (http://www.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Commons CLI - commons-cli:commons-cli:jar:1.0
-Ideveloped by Apache Software Foundation (http://www.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Unnamed - msv:msv:jar:20020414
-developed by (https://msv.dev.java.net/)
-License:
-
-This product includes/uses software, Codec (http://jakarta.apache.org/commons/codec/),
-developed by The Apache Software Foundation (http://jakarta.apache.org)
-License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Commons Logging - commons-logging:commons-logging:jar:1.0
-developed by Apache Software Foundation (http://www.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Backport of JSR 166 (http://www.mathcs.emory.edu/dcl/util/backport-util-concurrent/),
-developed by Dawid Kurzyniec (http://www.mathcs.emory.edu/~dawidk/)
-License: Public Domain (http://creativecommons.org/licenses/publicdomain)
-
-This product includes/uses software, Commons Lang - commons-lang:commons-lang:jar:2.1
-developed by Apache Software Foundation (http://www.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Apache MINA SSL Filter (http://directory.apache.org/subprojects/mina/mina-filter-ssl)
-developed by Apache Software Foundation (http://www.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Unnamed - xerces:xercesImpl:jar:2.2.1
-developed by The Apache Software Foundation (http://jakarta.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, - javax.servlet:servlet-api:jar:2.3
-
-This product includes/uses software, Xalan - xalan:xalan:jar:2.7.0
-developed by Apache Software Foundation (http://www.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Commons Configuration (http://jakarta.apache.org/commons/),
-developed by The Apache Software Foundation (http://jakarta.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Apache MINA Java5 Extensions (http://directory.apache.org/subprojects/mina/mina-java5)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Jaxen - jaxen:jaxen:jar:1.0-FCS
-License: Apache License (http://jaxen.org/faq.html)
-
-This product includes/uses software, BeanUtils (http://jakarta.apache.org/commons/beanutils/)
-developed by The Apache Software Foundation (http://jakarta.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, XML Commons External Components XML APIs (http://xml.apache.org/commons/#external),
-developed by Apache Software Foundation (http://www.apache.org/)
-License: The Apache Software License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.txt)
-
-This product includes/uses software, Commons Beanutils Core - commons-beanutils:commons-beanutils-core:jar:1.7.0
-developed by The Apache Software Foundation (http://jakarta.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Commons Logging API - commons-logging:commons-logging-api:jar:1.0.4
-developed by The Apache Software Foundation (http://jakarta.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Dom4j - dom4j:dom4j:jar:1.4
-developed by MetaStuff, Ltd. (http://www.dom4j.org/)
-License: BSD License (http://www.dom4j.org/license.html)
-
-This product includes/uses software, Saxon - saxpath:saxpath:jar:1.0-FCS
-developed by Michael Kay (http://saxon.sourceforge.net/)
-License: Mozilla Public License v1.0, (http://www.opensource.org/licenses/mozilla1.0.php)
-
diff --git a/Final/java/resources/NOTICE b/Final/java/resources/NOTICE
deleted file mode 100644
index a08641fcdf..0000000000
--- a/Final/java/resources/NOTICE
+++ /dev/null
@@ -1,93 +0,0 @@
-// ------------------------------------------------------------------
-// NOTICE file corresponding to the section 4d of The Apache License,
-// Version 2.0, in this case for Qpid Common Utilities
-// ------------------------------------------------------------------
-
-Apache Qpid
-Copyright 2006-2007 Apache Software Foundation
-
-This product includes software developed at
-Apache Software Foundation (http://www.apache.org/)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, SLF4J API Module (http://www.slf4j.org),
-developed by QOS.ch (http://www.qos.ch)
-License: MIT License (http://www.slf4j.org/license.html)
-
-This product includes/uses software, Backport of JSR 166 (http://www.mathcs.emory.edu/dcl/util/backport-util-concurrent/),
-developed by Dawid Kurzyniec (http://www.mathcs.emory.edu/~dawidk/)
-License: Public Domain (http://creativecommons.org/licenses/publicdomain)
-
-This product includes/uses software, JUnit Toolkit (http://sourceforge.net/projects/junit-toolkit/)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Apache Log4j (http://logging.apache.org/log4j/1.2)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Apache MINA Core API (http://directory.apache.org/projects/mina/)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Apache MINA SSL Filter (http://directory.apache.org/subprojects/mina/mina-filter-ssl)
-developed by Apache Software Foundation (http://www.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Apache MINA Java5 Extensions (http://directory.apache.org/subprojects/mina/mina-java5)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Commons Configuration (http://jakarta.apache.org/commons/),
-developed by The Apache Software Foundation (http://jakarta.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Commons Logging API - commons-logging:commons-logging-api:jar:1.0.4
-developed by The Apache Software Foundation (http://jakarta.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Commons Collections - commons-collections:commons-collections:jar:3.1,
-developed by Apache Software Foundation (http://www.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Commons CLI - commons-cli:commons-cli:jar:1.0
-Ideveloped by Apache Software Foundation (http://www.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Codec (http://jakarta.apache.org/commons/codec/),
-developed by The Apache Software Foundation (http://jakarta.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Commons Lang - commons-lang:commons-lang:jar:2.1
-developed by Apache Software Foundation (http://www.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product includes/uses software, Xalan - xalan:xalan:jar:2.7.0
-developed by Apache Software Foundation (http://www.apache.org)
-License: Apache 2.0 License (http://www.apache.org/licenses/LICENSE-2.0)
-
-This product uses/references the following software from Eclipse.
-License: Eclipse Public License - v 1.0 (http://www.eclipse.org/legal/epl-v10.html)
-(Note: the versions are ommited and only the name is specified.)
-org.eclipse.jface
-org.eclipse.core.*
-org.eclipse.equinox.*
-org.eclipse.osgi
-org.eclipse.swt
-
-This product includes/uses software, ICU4J - ICU4J 3.4.4
-developed by the ICU Project (http://icu-project.org/)
-License: http://source.icu-project.org/repos/icu/icu/trunk/license.html
-
-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.
-
diff --git a/Final/java/resources/README b/Final/java/resources/README
deleted file mode 100644
index 1d52d487fb..0000000000
--- a/Final/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/Final/java/systests/distribution/pom.xml b/Final/java/systests/distribution/pom.xml
deleted file mode 100644
index 172a59d3a1..0000000000
--- a/Final/java/systests/distribution/pom.xml
+++ /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.
- -->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-systests-distribution</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid System Tests Distribution</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- <java.source.version>1.5</java.source.version>
- <qpid.version>${pom.version}</qpid.version>
- <qpid.targetDir>${project.build.directory}</qpid.targetDir>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-systests</artifactId>
- </dependency>
- </dependencies>
-
- <build>
- <pluginManagement>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>${java.source.version}</source>
- <target>${java.source.version}</target>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-assembly-plugin</artifactId>
- <version>${assembly.version}</version>
- <configuration>
- <finalName>qpid-${pom.version}</finalName>
- <outputDirectory>${qpid.targetDir}</outputDirectory>
- <tarLongFileMode>gnu</tarLongFileMode>
- </configuration>
- </plugin>
-
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-jar-plugin</artifactId>
- <configuration>
- <finalName>qpid-systests</finalName>
- <archive>
- <manifest>
- <addClasspath>true</addClasspath>
- </manifest>
- </archive>
- </configuration>
- </plugin>
-
- </plugins>
- </pluginManagement>
-
- <plugins>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>distribution-package</id>
- <phase>package</phase>
- <goals>
- <goal>single</goal>
- </goals>
- <configuration>
- <descriptors>
- <descriptor>src/main/assembly/systests.xml</descriptor>
- </descriptors>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
-
- </build>
-
-</project>
diff --git a/Final/java/systests/distribution/src/main/assembly/systests.xml b/Final/java/systests/distribution/src/main/assembly/systests.xml
deleted file mode 100644
index 2d6a6d8572..0000000000
--- a/Final/java/systests/distribution/src/main/assembly/systests.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
--->
-<assembly>
- <id>system-test-java</id>
- <includeBaseDirectory>false</includeBaseDirectory>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
-
-<fileSets>
- <!-- Apache Licensing Details-->
- <fileSet>
- <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>..</directory>
- <outputDirectory>qpid-${qpid.version}</outputDirectory>
- <includes>
- <include>*.txt</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>../../release-docs</directory>
- <outputDirectory>qpid-${qpid.version}/docs</outputDirectory>
- <includes>
- <include>RELEASE_NOTES.txt</include>
- </includes>
- </fileSet>
-
- <!-- Scripts to run the system tests-->
- <fileSet>
- <directory>../bin</directory>
- <outputDirectory>qpid-${qpid.version}/bin</outputDirectory>
- <includes>
- <include>*</include>
- </includes>
- </fileSet>
-
- <!-- Include source files in easy access form -->
- <fileSet>
- <directory>../src/main</directory>
- <outputDirectory>qpid-${qpid.version}/src</outputDirectory>
- <includes>
- <include>**/*.java</include>
- <include>**/*.log4j</include>
- </includes>
- </fileSet>
- <fileSet>
- <directory>target</directory>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <includes>
- <include>qpid-systests.jar</include>
- </includes>
- </fileSet>
- </fileSets>
-
- <dependencySets>
- <dependencySet>
- <outputDirectory>qpid-${qpid.version}/lib</outputDirectory>
- <unpack>false</unpack>
- <excludes>
- <exclude>org.apache.qpid:qpid-systests-distribution</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
-</assembly>
diff --git a/Final/java/systests/etc/bin/testclients.sh b/Final/java/systests/etc/bin/testclients.sh
deleted file mode 100644
index 6aaa7c408e..0000000000
--- a/Final/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/Final/java/systests/pom.xml b/Final/java/systests/pom.xml
deleted file mode 100644
index b18bfc93de..0000000000
--- a/Final/java/systests/pom.xml
+++ /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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-systests</artifactId>
- <packaging>jar</packaging>
- <version>1.0-incubating-M2</version>
- <name>Qpid System Tests</name>
- <url>http://cwiki.apache.org/confluence/display/qpid</url>
-
- <parent>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid</artifactId>
- <version>1.0-incubating-M2</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <properties>
- <topDirectoryLocation>..</topDirectoryLocation>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-client</artifactId>
- <type>jar</type>
- </dependency>
-
- <dependency>
- <groupId>org.apache.qpid</groupId>
- <artifactId>qpid-broker</artifactId>
- <type>jar</type>
- </dependency>
-
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>uk.co.thebadgerset</groupId>
- <artifactId>junit-toolkit</artifactId>
- </dependency>
-
- <!-- Test Dependencies -->
- <dependency>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- <version>1.4.0</version>
- <scope>test</scope>
- </dependency>
-
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <testSourceDirectory>${basedir}/src/main</testSourceDirectory>
- <testClassesDirectory>target/classes</testClassesDirectory>
- <includes>
- <include>**/*Test.class</include>
- </includes>
- </configuration>
- </plugin>
-
- </plugins>
-
- <!-- Include source files in built jar -->
- <resources>
- <resource>
- <targetPath>src/</targetPath>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>**/*.java</include>
- </includes>
- </resource>
- <resource>
- <targetPath>src/</targetPath>
- <filtering>false</filtering>
- <directory>src/main/java</directory>
- <includes>
- <include>systests.log4j</include>
- </includes>
- </resource>
- </resources>
- </build>
-</project>
-
diff --git a/Final/java/systests/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java b/Final/java/systests/src/main/java/org/apache/mina/transport/vmpipe/support/VmPipeIdleStatusChecker.java
deleted file mode 100644
index 5323ad28bf..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/AMQBrokerManagerMBeanTest.java
deleted file mode 100644
index 370c2b43a7..0000000000
--- a/Final/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;
-
-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/Final/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.java
deleted file mode 100644
index 3ee8277eba..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/ack/TxAckTest.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 junit.framework.TestCase;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.AMQFrameDecodingException;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.server.queue.AMQMessage;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
-import org.apache.qpid.server.store.StoreContext;
-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)
- {
- TransactionalContext txnContext = new NonTransactionalContext(new TestableMemoryMessageStore(),
- _storeContext, null,
- new LinkedList<RequiredDeliveryException>(),
- new HashSet<Long>());
- for (int i = 0; i < messageCount; i++)
- {
- long deliveryTag = i + 1;
-
- MessagePublishInfo info = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- public boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return null;
- }
- };
-
- TestMessage message = new TestMessage(deliveryTag, i, info, txnContext);
- _map.add(deliveryTag, new UnacknowledgedMessage(null, message, null, deliveryTag));
- }
- _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)
- {
- UnacknowledgedMessage u = _map.get(tag);
- assertTrue("Message not found for tag " + tag, u != null);
- ((TestMessage) u.message).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 class TestMessage extends AMQMessage
- {
- private final long _tag;
- private int _count;
-
- TestMessage(long tag, long messageId, MessagePublishInfo publishBody, TransactionalContext txnContext)
- {
- super(messageId, publishBody, txnContext);
- try
- {
- setContentHeaderBody(new ContentHeaderBody()
- {
- public int getSize()
- {
- return 1;
- }
- });
- }
- catch (AMQException e)
- {
- // won't happen
- }
- _tag = tag;
- }
-
- public void incrementReference()
- {
- _count++;
- }
-
- public void decrementReference(StoreContext context)
- {
- _count--;
- }
-
- void assertCountEquals(int expected)
- {
- assertEquals("Wrong count for message with tag " + _tag, expected, _count);
- }
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java b/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.java
deleted file mode 100644
index ff5517bdd5..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/AbstractHeadersExchangeTestBase.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.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.AMQMessage;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.queue.MessageHandleFactory;
-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.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.routingComplete(_store, _storeContext, _handleFactory);
- }
-
- 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, m.isInQueue(q));
- //assert m.isInQueue(q) : "Expected " + m + " to be delivered to " + q;
- }
- else
- {
- assertFalse("Did not expect " + m + " to be delivered to " + q, m.isInQueue(q));
- //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 AMQQueue
- {
- 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"));
- }
-
- /**
- * 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
- * @param deliverFirst
- * @throws AMQException
- */
- public void process(StoreContext context, AMQMessage msg, boolean deliverFirst) throws AMQException
- {
- messages.add(new HeadersExchangeTest.Message(msg));
- }
- }
-
- /**
- * Just add some extra utility methods to AMQMessage to aid testing.
- */
- static class Message extends AMQMessage
- {
- private static MessageStore _messageStore = new SkeletonMessageStore();
-
- private static StoreContext _storeContext = new StoreContext();
-
- private static TransactionalContext _txnContext = new NonTransactionalContext(_messageStore, _storeContext,
- null,
- new LinkedList<RequiredDeliveryException>(),
- new HashSet<Long>());
-
- Message(String id, String... headers) throws AMQException
- {
- this(id, getHeaders(headers));
- }
-
- Message(String id, FieldTable headers) throws AMQException
- {
- this(getPublishRequest(id), getContentHeader(headers), null);
- }
-
- private Message(MessagePublishInfo publish, ContentHeaderBody header, List<ContentBody> bodies) throws AMQException
- {
- super(_messageStore.getNewMessageId(), publish, _txnContext, header);
- }
-
- private Message(AMQMessage msg) throws AMQException
- {
- super(msg);
- }
-
- void route(Exchange exchange) throws AMQException
- {
- exchange.route(this);
- }
-
- boolean isInQueue(TestQueue queue)
- {
- return queue.messages.contains(this);
- }
-
- 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/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.java
deleted file mode 100644
index eca642b556..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/HeadersExchangeTest.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.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());
- }
-
- 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/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.java
deleted file mode 100644
index 9b5c9c3d00..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/ImmediateMessageTest.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.server.exchange;
-
-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 uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-import uk.co.thebadgerset.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
-{
- /** 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 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()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
- }
-
- /** Check that an immediate message is committed succesfully in a transaction when a consumer is connected. */
- public void test_QPID_517_ImmediateOkTxP2P()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Send one message with no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
- }
-
- /** Check that an immediate message results in no consumers code, not using transactions, when a consumer is disconnected. */
- public void test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxP2P()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
-
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(testProps);
-
- // Send one message and get a linked no consumers exception.
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noConsumersAssertion())));
- }
-
- /** Check that an immediate message results in no consumers code, in a transaction, when a consumer is disconnected. */
- public void test_QPID_517_ImmediateFailsConsumerDisconnectedTxP2P()
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
-
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(testProps);
-
- // Send one message and get a linked no consumers exception.
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noConsumersAssertion())));
- }
-
- /** 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()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
- }
-
- /** 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()
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
- }
-
- /** Check that an immediate message is sent succesfully not using transactions when a consumer is connected. */
- public void test_QPID_517_ImmediateOkNoTxPubSub()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Send one message with no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
- }
-
- /** Check that an immediate message is committed succesfully in a transaction when a consumer is connected. */
- public void test_QPID_517_ImmediateOkTxPubSub()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, true);
-
- // Send one message with no errors.
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
- }
-
- /** Check that an immediate message results in no consumers code, not using transactions, when a consumer is disconnected. */
- public void test_QPID_517_ImmediateFailsConsumerDisconnectedNoTxPubSub()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- // Send one message and get a linked no consumers exception.
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noConsumersAssertion())));
- }
-
- /** Check that an immediate message results in no consumers code, in a transaction, when a consumer is disconnected. */
- public void test_QPID_517_ImmediateFailsConsumerDisconnectedTxPubSub()
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- // Send one message and get a linked no consumers exception.
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noConsumersAssertion())));
- }
-
- /** 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()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
- }
-
- /** 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()
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
- }
-
- 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/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.java
deleted file mode 100644
index df99d044d2..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/MandatoryMessageTest.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.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 uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-import uk.co.thebadgerset.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()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
- }
-
- /** Check that an mandatory message is committed succesfully in a transaction when a consumer is connected. */
- public void test_QPID_508_MandatoryOkTxP2P()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
- }
-
- /**
- * 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()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_PROPNAME, false);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
-
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(testProps);
-
- // Send one message with no errors.
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
- }
-
- /**
- * 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()
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_PROPNAME, true);
- testProps.setProperty(PUBSUB_PROPNAME, false);
-
- // Disconnect the consumer.
- testProps.setProperty(RECEIVER_CONSUMER_ACTIVE_PROPNAME, false);
-
- CircuitFactory circuitFactory = getCircuitFactory();
- Circuit testCircuit = circuitFactory.createCircuit(testProps);
-
- // Send one message with no errors.
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
- }
-
- /** Check that an mandatory message results in no route code, not using transactions, when no consumer is connected. */
- public void test_QPID_508_MandatoryFailsNoRouteNoTxP2P()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
- }
-
- /** Check that an mandatory message results in no route code, upon transaction commit, when a consumer is connected. */
- public void test_QPID_508_MandatoryFailsNoRouteTxP2P()
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
- }
-
- /** Check that an mandatory message is sent succesfully not using transactions when a consumer is connected. */
- public void test_QPID_508_MandatoryOkNoTxPubSub()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
- }
-
- /** Check that an mandatory message is committed succesfully in a transaction when a consumer is connected. */
- public void test_QPID_508_MandatoryOkTxPubSub()
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
- }
-
- /**
- * 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()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- // Send one message with no errors.
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
- }
-
- /**
- * 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()
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- // Send one message with no errors.
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noExceptionsAssertion())));
- }
-
- /** Check that an mandatory message results in no route code, not using transactions, when no consumer is connected. */
- public void test_QPID_508_MandatoryFailsNoRouteNoTxPubSub()
- {
- // Ensure transactional sessions are off.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
- }
-
- /** Check that an mandatory message results in no route code, upon transaction commit, when a consumer is connected. */
- public void test_QPID_508_MandatoryFailsNoRouteTxPubSub()
- {
- // Ensure transactional sessions are on.
- testProps.setProperty(TRANSACTED_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(testProps);
-
- assertNoFailures(testCircuit.test(1, assertionList(testCircuit.getPublisher().noRouteAssertion())));
- }
-
- 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/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java
deleted file mode 100644
index ebbffd8a71..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/exchange/ReturnUnroutableMandatoryMessageTest.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.transport.TransportConnection;
-import org.apache.qpid.url.AMQBindingURL;
-import org.apache.qpid.url.BindingURL;
-import org.apache.qpid.exchange.ExchangeDefaults;
-import org.apache.qpid.framing.FieldTable;
-
-import javax.jms.*;
-import java.util.List;
-import java.util.Collections;
-import java.util.ArrayList;
-
-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();
- }
-
- /**
- * Tests that mandatory message which are not routable are returned to the producer
- *
- * @throws Exception
- */
- public void testReturnUnroutableMandatoryMessage_HEADERS() throws Exception
- {
- _bouncedMessageList.clear();
- Connection con = new AMQConnection(BROKER, "guest", "guest", "consumer1", VIRTUALHOST);
-
-
- 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, AMQSession.DEFAULT_PREFETCH_LOW_MARK, AMQSession.DEFAULT_PREFETCH_HIGH_MARK, 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 = 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(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 receivers", tm != null);
- assertTrue("Wrong message routed to receivers: " + 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"));
-
-
- 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 receivers", tm != null);
- assertTrue("Wrong message routed to receivers: " + 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 receivers", tm != null);
- assertTrue("Wrong message routed to receivers: " + 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 = jmsException.getLinkedException();
- 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/Final/java/systests/src/main/java/org/apache/qpid/server/failure/DeadlockTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/failure/DeadlockTest.java
deleted file mode 100644
index a25af30008..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/failure/DeadlockTest.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.failure;
-
-import junit.framework.TestCase;
-import org.apache.qpid.client.AMQConnectionFactory;
-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.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.Topic;
-import java.util.Random;
-import java.util.concurrent.Semaphore;
-import java.util.concurrent.TimeUnit;
-
-/**
- * DeadlockTestCase:
- * From a client requirement.
- *
- * The JMS Spec specifies that a Session has a single thread of control. And as such setting message listeners from a
- * second thread is not allowed.
- * Section 4.4.6 of the Spec states:
- <quote>Another consequence is that a connection must be in stopped mode to set up a
-session with more than one message listener. The reason is that when a
-connection is actively delivering messages, once the first message listener for a
-session has been registered, the session is now controlled by the thread of
-control that delivers messages to it. At this point a client thread of control
-cannot be used to further configure the session.</quote>
- *
- * It, however, does not specified what we should do in the case. it only states:
- <quote>Once a connection has been started, all its sessions with a registered message
-listener are dedicated to the thread of control that delivers messages to them. It
-is erroneous for client code to use such a session from another thread of
-control. The only exception to this is the use of the session or connection close
-method.</quote>
- *
- * While it may be erroneous the causing a Deadlock is not a very satisfactory solution. This test ensures that we do
- * no do this. There is no technical reason we cannot currently allow the setting of a messageListener on a new consumer.
- * The only caveate is due to QPID-577 there is likely to be temporary message 'loss'. As they are stuck on the internal
- * _synchronousQueue pending a synchronous receive.
- *
- */
-public class DeadlockTest extends TestCase
-{
- private static final Logger _logger = LoggerFactory.getLogger(DeadlockTest.class);
-
-
- public static final String QPID_BROKER_CONNECTION_PROPERTY = "QPIDBROKER";
-
- private String topic1 = "TEST.DeadLock1.TMP";
- private String topic2 = "TEST.DeadLock2.TMP";
-
- private Session sess;
-
- private Semaphore s = new Semaphore(0);
- private final String LOCAL = "tcp://localhost:5670";
- private final String VM = "vm://:1";
-
- private String BROKER = VM;
-
- String connectionString = System.getProperty(QPID_BROKER_CONNECTION_PROPERTY,
- "amqp://guest:guest@/test?brokerlist='" + BROKER + "'");
-
-
- public void setUp() throws AMQVMBrokerCreationException
- {
- if (BROKER.equals("vm://:1"))
- {
- TransportConnection.createVMBroker(1);
- }
- }
-
- public void tearDown() throws AMQVMBrokerCreationException
- {
- if (BROKER.equals("vm://:1"))
- {
- TransportConnection.killAllVMBrokers();
- }
- }
-
- public class EmptyMessageListener implements javax.jms.MessageListener
- {
- public void onMessage(Message message)
- {
- // do nothing
- }
- }
-
- public void setSessionListener(String topic, javax.jms.MessageListener listener)
- {
- try
- {
- Topic jmsTopic = sess.createTopic(topic);
- MessageConsumer subscriber = sess.createConsumer(jmsTopic);
- subscriber.setMessageListener(listener);
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail("Caught JMSException");
- }
- }
-
- public class TestMessageListener implements javax.jms.MessageListener
- {
- public Random r = new Random();
-
- public void onMessage(Message message)
- {
- if (r.nextBoolean())
- {
- setSessionListener(topic2, new EmptyMessageListener());
- }
- }
-
- }
-
- public void testDeadlock() throws InterruptedException, URLSyntaxException, JMSException
- {
- // in order to trigger the deadlock we need to
- // set a message listener from one thread
- // whilst receiving a message on another thread and on that thread also setting (the same?) message listener
- AMQConnectionFactory acf = new AMQConnectionFactory(connectionString);
- Connection conn = acf.createConnection();
- conn.start();
- sess = conn.createSession(false, org.apache.qpid.jms.Session.NO_ACKNOWLEDGE);
- setSessionListener(topic1, new TestMessageListener());
-
-
- Thread th = new Thread()
- {
- public void run()
- {
- try
- {
- Topic jmsTopic = sess.createTopic(topic1);
- MessageProducer producer = sess.createProducer(jmsTopic);
- producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
- Random r = new Random();
- long end = System.currentTimeMillis() + 2000;
- while (end - System.currentTimeMillis() > 0)
- {
- if (r.nextBoolean())
- {
- _logger.info("***************** send message");
- Message jmsMessage = sess.createTextMessage("");
- producer.send(jmsMessage);
- }
- else
- {
- _logger.info("***************** set session listener");
- setSessionListener(topic2, new EmptyMessageListener());
- }
- Thread.yield();
- }
- _logger.info("done sends");
- s.release();
- }
- catch (JMSException e)
- {
- e.printStackTrace();
- fail("Caught JMSException");
- }
- }
- };
- th.setDaemon(true);
- th.setName("testDeadlock");
- th.start();
-
- boolean success = s.tryAcquire(1, 4, TimeUnit.SECONDS);
-
- // if we failed, closing the connection will just hang the test case.
- if (success)
- {
- conn.close();
- }
-
- if (!success)
- {
- fail("Deadlock ocurred");
- }
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java b/Final/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.java
deleted file mode 100644
index 4117fe6720..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/failure/HeapExhaustion.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.server.failure;
-
-import junit.framework.TestCase;
-import org.apache.qpid.testutil.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);
-
- conn.connect();
- // 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/Final/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.java
deleted file mode 100644
index 04376a3067..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/protocol/AMQProtocolSessionMBeanTest.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.protocol;
-
-import junit.framework.TestCase;
-import org.apache.mina.common.IoSession;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.server.AMQChannel;
-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.exchange.ExchangeRegistry;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.SkeletonMessageStore;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-
-import javax.management.JMException;
-
-/**
- * Test class to test MBean operations for AMQMinaProtocolSession.
- */
-public class AMQProtocolSessionMBeanTest extends TestCase
-{
- 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 = new org.apache.qpid.server.queue.AMQQueue(new AMQShortString("testQueue_" + System.currentTimeMillis()),
- false,
- new AMQShortString("test"),
- true,
- _protocolSession.getVirtualHost());
- AMQChannel channel = new AMQChannel(_protocolSession,2, _messageStore, null);
- 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, null);
- 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)
- {
- System.out.println("expected exception is thrown :" + ex.getMessage());
- }
-
- // check if closing of session works
- _protocolSession.addChannel(new AMQChannel(_protocolSession,5, _messageStore, null));
- _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, null));
- fail();
- }
- catch(AMQException ex)
- {
- System.out.println("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, null);
- _protocolSession.addChannel(_channel);
- _mbean = (AMQProtocolSessionMBean)_protocolSession.getManagedObject();
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/protocol/MaxChannelsTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/protocol/MaxChannelsTest.java
deleted file mode 100644
index ae02c1c28c..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/protocol/MaxChannelsTest.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.protocol;
-
-import junit.framework.TestCase;
-import org.apache.mina.common.IoSession;
-import org.apache.qpid.codec.AMQCodecFactory;
-import org.apache.qpid.server.AMQChannel;
-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.exchange.ExchangeRegistry;
-import org.apache.qpid.server.queue.QueueRegistry;
-import org.apache.qpid.server.queue.AMQQueue;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.SkeletonMessageStore;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.protocol.AMQConstant;
-import org.apache.qpid.framing.AMQShortString;
-
-import javax.management.JMException;
-
-/** 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, 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/Final/java/systests/src/main/java/org/apache/qpid/server/protocol/MockIoSession.java b/Final/java/systests/src/main/java/org/apache/qpid/server/protocol/MockIoSession.java
deleted file mode 100644
index cf6366b513..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java
deleted file mode 100644
index 29952a6d9b..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/AckTest.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-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.BasicPublishBody;
-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.ack.UnacknowledgedMessage;
-import org.apache.qpid.server.ack.UnacknowledgedMessageMap;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
-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.TestApplicationRegistry;
-import org.apache.qpid.server.util.NullApplicationRegistry;
-
-import java.util.LinkedList;
-import java.util.Set;
-import java.util.HashSet;
-
-/**
- * Tests that acknowledgements are handled correctly.
- */
-public class AckTest extends TestCase
-{
- private static final Logger _log = Logger.getLogger(AckTest.class);
-
- private SubscriptionImpl _subscription;
-
- private MockProtocolSession _protocolSession;
-
- private TestableMemoryMessageStore _messageStore;
-
- private StoreContext _storeContext = new StoreContext();
-
- private AMQChannel _channel;
-
- private SubscriptionSet _subscriptionManager;
-
- private AMQQueue _queue;
-
- private static final AMQShortString DEFAULT_CONSUMER_TAG = new AMQShortString("conTag");
-
- public AckTest() throws Exception
- {
- ApplicationRegistry.initialise(new NullApplicationRegistry());
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- _messageStore = new TestableMemoryMessageStore();
- _protocolSession = new MockProtocolSession(_messageStore);
- _channel = new AMQChannel(_protocolSession,5, _messageStore, null/*dont need exchange registry*/);
-
- _protocolSession.addChannel(_channel);
- _subscriptionManager = new SubscriptionSet();
- _queue = new AMQQueue(new AMQShortString("myQ"), false, new AMQShortString("guest"), true, ApplicationRegistry.getInstance().getVirtualHostRegistry().getVirtualHost("test"), _subscriptionManager);
- }
-
- 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>(),
- new HashSet<Long>());
- 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 boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return new AMQShortString("rk");
- }
- };
- AMQMessage msg = new AMQMessage(_messageStore.getNewMessageId(), publishBody, txnContext);
- 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
- msg.incrementReference();
- msg.routingComplete(_messageStore, _storeContext, factory);
- // we manually send the message to the subscription
- _subscription.send(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 = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, true);
- 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++;
- UnacknowledgedMessage unackedMsg = map.get(deliveryTag);
- assertTrue(unackedMsg.queue == _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 = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, false);
- 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 = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, false);
- 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 = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, true);
- 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);
- UnacknowledgedMessage unackedMsg = map.get(deliveryTag);
- assertTrue(unackedMsg.queue == _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 = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, true);
- 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);
- UnacknowledgedMessage unackedMsg = map.get(deliveryTag);
- assertTrue(unackedMsg.queue == _queue);
- ++i;
- }
- }
-
- /**
- * Tests that a multiple acknowledgement is handled correctly. When ack'ing all pending msgs.
- */
- public void testMultiAckAllReceivedTest() throws AMQException
- {
- _subscription = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, true);
- 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);
- UnacknowledgedMessage unackedMsg = map.get(deliveryTag);
- assertTrue(unackedMsg.queue == _queue);
- ++i;
- }
- }
-
- public void testPrefetchHighLow() throws AMQException
- {
- int lowMark = 5;
- int highMark = 10;
-
- _subscription = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, true);
- _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 = new SubscriptionImpl(5, _protocolSession, DEFAULT_CONSUMER_TAG, true);
- _channel.setPrefetchCount(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/Final/java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrencyTestDisabled.java b/Final/java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrencyTestDisabled.java
deleted file mode 100644
index 068f37574d..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/ConcurrencyTestDisabled.java
+++ /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.
- *
- */
-package org.apache.qpid.server.queue;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.server.handler.OnCurrentThreadExecutor;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import java.util.*;
-import java.util.concurrent.Executor;
-
-/**
- * Tests delivery in the face of concurrent incoming _messages, subscription alterations
- * and attempts to asynchronously process queued _messages.
- */
-public class ConcurrencyTestDisabled extends MessageTestHelper
-{
- private final Random random = new Random();
-
- private final int numMessages = 1000;
-
- private final List<SubscriptionTestHelper> _subscribers = new ArrayList<SubscriptionTestHelper>();
- private final Set<Subscription> _active = new HashSet<Subscription>();
- private final List<AMQMessage> _messages = new ArrayList<AMQMessage>();
- private int next = 0;//index to next message to send
- private final List<AMQMessage> _received = Collections.synchronizedList(new ArrayList<AMQMessage>());
- private final Executor _executor = new OnCurrentThreadExecutor();
- private final List<Thread> _threads = new ArrayList<Thread>();
-
- private final SubscriptionSet _subscriptionMgr = new SubscriptionSet();
- private final DeliveryManager _deliveryMgr;
-
- private boolean isComplete;
- private boolean failed;
- private VirtualHost _virtualHost;
-
- public ConcurrencyTestDisabled() throws Exception
- {
-
- IApplicationRegistry applicationRegistry = ApplicationRegistry.getInstance();
- _virtualHost = applicationRegistry.getVirtualHostRegistry().getVirtualHost("test");
- _deliveryMgr = new ConcurrentSelectorDeliveryManager(_subscriptionMgr, new AMQQueue(new AMQShortString("myQ"), false, new AMQShortString("guest"), false,
- _virtualHost));
- }
-
- public void testConcurrent1() throws InterruptedException, AMQException
- {
- initSubscriptions(10);
- initMessages(numMessages);
- initThreads(1, 4, 4, 4);
- doRun();
- check();
- }
-
- public void testConcurrent2() throws InterruptedException, AMQException
- {
- initSubscriptions(10);
- initMessages(numMessages);
- initThreads(4, 2, 2, 2);
- doRun();
- check();
- }
-
- void check()
- {
- assertFalse("Failed", failed);
-
- _deliveryMgr.processAsync(_executor);
-
- assertEquals("Did not recieve the correct number of messages", _messages.size(), _received.size());
- for(int i = 0; i < _messages.size(); i++)
- {
- assertEquals("Wrong message at " + i, _messages.get(i), _received.get(i));
- }
- }
-
- void initSubscriptions(int subscriptions)
- {
- for(int i = 0; i < subscriptions; i++)
- {
- _subscribers.add(new SubscriptionTestHelper("Subscriber" + i, _received));
- }
- }
-
- void initMessages(int messages) throws AMQException
- {
- for(int i = 0; i < messages; i++)
- {
- _messages.add(message());
- }
- }
-
- void initThreads(int senders, int subscribers, int suspenders, int processors)
- {
- addThreads(senders, senders == 1 ? new Sender() : new OrderedSender());
- addThreads(subscribers, new Subscriber());
- addThreads(suspenders, new Suspender());
- addThreads(processors, new Processor());
- }
-
- void addThreads(int count, Runnable runner)
- {
- for(int i = 0; i < count; i++)
- {
- _threads.add(new Thread(runner, runner.toString()));
- }
- }
-
- void doRun() throws InterruptedException
- {
- for(Thread t : _threads)
- {
- t.start();
- }
-
- for(Thread t : _threads)
- {
- t.join();
- }
- }
-
- private void toggle(Subscription s)
- {
- synchronized (_active)
- {
- if (_active.contains(s))
- {
- _active.remove(s);
- Subscription result = _subscriptionMgr.removeSubscriber(s);
- assertTrue("Removed subscription " + result + " but trying to remove subscription " + s,
- result != null && result.equals(s));
- }
- else
- {
- _active.add(s);
- _subscriptionMgr.addSubscriber(s);
- }
- }
- }
-
- private AMQMessage nextMessage()
- {
- synchronized (_messages)
- {
- if (next < _messages.size())
- {
- return _messages.get(next++);
- }
- else
- {
- if (!_deliveryMgr.hasQueuedMessages()) {
- isComplete = true;
- }
- return null;
- }
- }
- }
-
- private boolean randomBoolean()
- {
- return random.nextBoolean();
- }
-
- private SubscriptionTestHelper randomSubscriber()
- {
- return _subscribers.get(random.nextInt(_subscribers.size()));
- }
-
- private class Sender extends Runner
- {
- void doRun() throws Throwable
- {
- AMQMessage msg = nextMessage();
- if (msg != null)
- {
- _deliveryMgr.deliver(null, new AMQShortString(toString()), msg, false);
- }
- }
- }
-
- private class OrderedSender extends Sender
- {
- synchronized void doRun() throws Throwable
- {
- super.doRun();
- }
- }
-
- private class Suspender extends Runner
- {
- void doRun() throws Throwable
- {
- randomSubscriber().setSuspended(randomBoolean());
- }
- }
-
- private class Subscriber extends Runner
- {
- void doRun() throws Throwable
- {
- toggle(randomSubscriber());
- }
- }
-
- private class Processor extends Runner
- {
- void doRun() throws Throwable
- {
- _deliveryMgr.processAsync(_executor);
- }
- }
-
- private abstract class Runner implements Runnable
- {
- public void run()
- {
- try
- {
- while (!stop())
- {
- doRun();
- }
- }
- catch (Throwable t)
- {
- failed = true;
- t.printStackTrace();
- }
- }
-
- abstract void doRun() throws Throwable;
-
- boolean stop()
- {
- return isComplete || failed;
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(ConcurrencyTestDisabled.class);
- }
-
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/DeliveryManagerTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/queue/DeliveryManagerTest.java
deleted file mode 100644
index dc5a6d3cf6..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/DeliveryManagerTest.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.server.queue;
-
-import org.apache.qpid.server.handler.OnCurrentThreadExecutor;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQShortString;
-
-import junit.framework.TestSuite;
-
-abstract public class DeliveryManagerTest extends MessageTestHelper
-{
- protected final SubscriptionSet _subscriptions = new SubscriptionSet();
- protected DeliveryManager _mgr;
- protected StoreContext _storeContext = new StoreContext();
- private static final AMQShortString DEFAULT_QUEUE_NAME = new AMQShortString("Me");
-
- public DeliveryManagerTest() throws Exception
- {
- }
-
- public void testStartInQueueingMode() throws AMQException
- {
- AMQMessage[] messages = new AMQMessage[10];
- for (int i = 0; i < messages.length; i++)
- {
- messages[i] = message();
- }
- int batch = messages.length / 2;
-
- for (int i = 0; i < batch; i++)
- {
- _mgr.deliver(_storeContext, DEFAULT_QUEUE_NAME, messages[i], false);
- }
-
- SubscriptionTestHelper s1 = new SubscriptionTestHelper("1");
- SubscriptionTestHelper s2 = new SubscriptionTestHelper("2");
- _subscriptions.addSubscriber(s1);
- _subscriptions.addSubscriber(s2);
-
- for (int i = batch; i < messages.length; i++)
- {
- _mgr.deliver(_storeContext, DEFAULT_QUEUE_NAME, messages[i], false);
- }
-
- assertTrue(s1.getMessages().isEmpty());
- assertTrue(s2.getMessages().isEmpty());
-
- _mgr.processAsync(new OnCurrentThreadExecutor());
-
- assertEquals(messages.length / 2, s1.getMessages().size());
- assertEquals(messages.length / 2, s2.getMessages().size());
-
- for (int i = 0; i < messages.length; i++)
- {
- if (i % 2 == 0)
- {
- assertTrue(s1.getMessages().get(i / 2) == messages[i]);
- }
- else
- {
- assertTrue(s2.getMessages().get(i / 2) == messages[i]);
- }
- }
- }
-
- public void testStartInDirectMode() throws AMQException
- {
- AMQMessage[] messages = new AMQMessage[10];
- for (int i = 0; i < messages.length; i++)
- {
- messages[i] = message();
- }
- int batch = messages.length / 2;
-
- SubscriptionTestHelper s1 = new SubscriptionTestHelper("1");
- _subscriptions.addSubscriber(s1);
-
- for (int i = 0; i < batch; i++)
- {
- _mgr.deliver(_storeContext, DEFAULT_QUEUE_NAME, messages[i], false);
- }
-
- assertEquals(batch, s1.getMessages().size());
- for (int i = 0; i < batch; i++)
- {
- assertTrue(messages[i] == s1.getMessages().get(i));
- }
- s1.getMessages().clear();
- assertEquals(0, s1.getMessages().size());
-
- s1.setSuspended(true);
- for (int i = batch; i < messages.length; i++)
- {
- _mgr.deliver(_storeContext, DEFAULT_QUEUE_NAME, messages[i], false);
- }
-
- _mgr.processAsync(new OnCurrentThreadExecutor());
- assertEquals(0, s1.getMessages().size());
- s1.setSuspended(false);
-
- _mgr.processAsync(new OnCurrentThreadExecutor());
- assertEquals(messages.length - batch, s1.getMessages().size());
-
- for (int i = batch; i < messages.length; i++)
- {
- assertTrue(messages[i] == s1.getMessages().get(i - batch));
- }
-
- }
-
- public void testNoConsumers() throws AMQException
- {
- try
- {
- AMQMessage msg = message(true);
- _mgr.deliver(_storeContext, DEFAULT_QUEUE_NAME, msg, false);
- msg.checkDeliveredToConsumer();
- fail("expected exception did not occur");
- }
- catch (NoConsumersException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected NoConsumersException, got " + e);
- }
- }
-
- public void testNoActiveConsumers() throws AMQException
- {
- try
- {
- SubscriptionTestHelper s = new SubscriptionTestHelper("A");
- _subscriptions.addSubscriber(s);
- s.setSuspended(true);
- AMQMessage msg = message(true);
- _mgr.deliver(_storeContext, DEFAULT_QUEUE_NAME, msg, false);
- msg.checkDeliveredToConsumer();
- fail("expected exception did not occur");
- }
- catch (NoConsumersException m)
- {
- // ok
- }
- catch (Exception e)
- {
- fail("expected NoConsumersException, got " + e);
- }
- }
-
- public static junit.framework.Test suite()
- {
- TestSuite suite = new TestSuite();
- return suite;
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/MessageReturnTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/queue/MessageReturnTest.java
deleted file mode 100644
index 45bf73bd9d..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/MessageReturnTest.java
+++ /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.
- *
- */
-
-package org.apache.qpid.server.queue;
-
-import junit.framework.TestCase;
-import org.apache.log4j.Logger;
-import org.apache.qpid.client.AMQNoRouteException;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.store.MemoryMessageStore;
-import org.apache.qpid.server.store.TestableMemoryMessageStore;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-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;
-import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
-
-
-/**
- * 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 MessageReturnTest extends TestCase implements ExceptionListener
-{
- private static final Logger _logger = Logger.getLogger(MessageReturnTest.class);
-
-
- protected final String BROKER = "vm://:1";
- protected final String VHOST = "test";
- protected final String QUEUE = "MessageReturnTest";
- protected final String BADQUEUE = "MessageReturnTest-bad-to-force-returns";
-
-
- private Context _context;
-
- private Connection _producerConnection;
-
- private MessageProducer _producer;
- private Session _clientSession, _producerSession;
- private static final int MSG_COUNT = 50;
-
- private Message[] _messages = new Message[MSG_COUNT];
-
- private CountDownLatch _returns = new CountDownLatch(1);
- private int _receivedCount = 0;
- private int _initialContentBodyMapSize;
- private int _initilaMessageMetaDataMapSize;
-
- protected void setUp() throws Exception
- {
- 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);
- env.put("queue.badQueue", QUEUE);
-
- _context = factory.getInitialContext(env);
-
- getBrokerInitialState();
- }
-
- protected void tearDown() throws Exception
- {
- super.tearDown();
-
- if (_producerConnection != null)
- {
- _producerConnection.close();
- }
-
- if (BROKER.startsWith("vm://"))
- {
- TransportConnection.killAllVMBrokers();
- }
- }
-
- public void test() throws Exception
- {
- init();
- //Send Msgs
- for (int msg = 0; msg < MSG_COUNT; msg++)
- {
- _producer.send(nextMessage(msg));
- }
-
- try
- {
- // Wait for all returns to arrive any longer than 5secs and something has gone wrong.
- _returns.await(5, TimeUnit.SECONDS);
- }
- catch (InterruptedException e)
- {
-
- }
-
- //Close the connection.. .giving the broker time to clean up its state.
- _producerConnection.close();
-
- //Verify we get all the messages.
- verifyAllMessagesRecevied();
- //Verify Broker state
- verifyBrokerState();
- }
-
- private void init() throws NamingException, JMSException
- {
- _receivedCount = 0;
- _messages = new Message[MSG_COUNT];
- _returns = new CountDownLatch(1);
-
- //Create Producer
- _producerConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
-
- _producerConnection.setExceptionListener(this);
-
- _producerConnection.start();
-
- _producerSession = _producerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- _producer = _producerSession.createProducer((Queue) _context.lookup("badQueue"));
- }
-
- // todo: collect to a general testing class - duplicated in AMQQueueMBeanTest
- private void getBrokerInitialState()
- {
- IApplicationRegistry registry = ApplicationRegistry.getInstance();
-
- VirtualHost testVhost = registry.getVirtualHostRegistry().getVirtualHost(VHOST);
-
- assertNotNull("Unable to get test Vhost", testVhost.getMessageStore());
-
- TestableMemoryMessageStore store = new TestableMemoryMessageStore((MemoryMessageStore) testVhost.getMessageStore());
-
- _initialContentBodyMapSize = store.getContentBodyMap() == null ? 0 : store.getContentBodyMap().size();
- _initilaMessageMetaDataMapSize = store.getMessageMetaDataMap() == null ? 0 : store.getMessageMetaDataMap().size();
-
- if (_initialContentBodyMapSize != 0)
- {
- _logger.warn("Store is dirty: ContentBodyMap has Size:" + _initialContentBodyMapSize);
- System.out.println("Store is dirty: ContentBodyMap has Size:" + _initialContentBodyMapSize);
- }
-
- if (_initilaMessageMetaDataMapSize != 0)
- {
- _logger.warn("Store is dirty: MessageMetaDataMap has Size:" + _initilaMessageMetaDataMapSize);
- System.out.println("Store is dirty: MessageMetaDataMap has Size:" + _initilaMessageMetaDataMapSize);
- }
-
- }
-
- private void verifyBrokerState()
- {
- IApplicationRegistry registry = ApplicationRegistry.getInstance();
-
- VirtualHost testVhost = registry.getVirtualHostRegistry().getVirtualHost(VHOST);
-
- assertNotNull("Unable to get test Vhost", testVhost.getMessageStore());
-
- TestableMemoryMessageStore store = new TestableMemoryMessageStore((MemoryMessageStore) testVhost.getMessageStore());
-
-
- assertNotNull("ContentBodyMap should not be null", store.getContentBodyMap());
-
- // If the CBM has content it may be due to the broker not yet purging.
- // Closing the producer connection before testing should give the store time to clean up.
- // Perform a quick sleep just in case
- while (store.getContentBodyMap().size() > _initialContentBodyMapSize)
- {
- try
- {
- Thread.sleep(500);
- }
- catch (InterruptedException e)
- {
- }
- }
- assertTrue("Expected the store content size not reached at test start it was :" + _initialContentBodyMapSize + " Now it is :" + store.getContentBodyMap().size(), _initialContentBodyMapSize >= store.getContentBodyMap().size());
- assertNotNull("MessageMetaDataMap should not be null", store.getMessageMetaDataMap());
- assertTrue("Expected the store MessageMetaData size not reached at test start it was :" + _initilaMessageMetaDataMapSize + " Now it is :" + store.getMessageMetaDataMap().size(), _initialContentBodyMapSize >= store.getMessageMetaDataMap().size());
- }
-
- private void verifyAllMessagesRecevied()
- {
-
- boolean[] msgIdRecevied = new boolean[MSG_COUNT];
-
- int msgId = 0;
-
- //Check received messages
- for (Message msg : _messages)
- {
- assertNotNull("Missing message:" + msgId, msg);
- assertFalse("Already received msg id " + msgId, msgIdRecevied[msgId]);
- msgIdRecevied[msgId] = true;
- msgId++;
- }
-
- //Check all recevied
- for (msgId = 0; msgId < MSG_COUNT; msgId++)
- {
- assertTrue("Message " + msgId + " not received.", msgIdRecevied[msgId]);
- }
- }
-
- /**
- * We can't verify messageOrder here as the return threads are not synchronized so we have no way of
- * guarranting the order.
- */
- private void verifyMessageOrder()
- {
- int msgId = 0;
- for (Message msg : _messages)
- {
- assertNotNull("Missing message:" + msgId, msg);
- try
- {
- assertEquals("Message not received in correct order", msgId, msg.getIntProperty("ID"));
- }
- catch (JMSException e)
- {
- fail("Unable to get messageID for msg:" + msg);
- }
-
- 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);
- return send;
- }
-
-
- public void onException(JMSException jmsException)
- {
- // NOTE:
- // This method MUST be thread-safe. Mulitple threads can call this at once.
- synchronized (this)
- {
- if (jmsException.getLinkedException() instanceof AMQNoRouteException)
- {
- AMQNoRouteException amq = (AMQNoRouteException) jmsException.getLinkedException();
-
- Message msg = (Message) amq.getUndeliveredMessage();
-
- if (_receivedCount < MSG_COUNT)
- {
- assertNotNull("Reeceived Null message:" + _receivedCount, msg);
- _messages[_receivedCount] = msg;
- _receivedCount++;
- }
- else
- {
- fail("Received to many messages expected :" + MSG_COUNT + " received: " + _receivedCount + 1);
- }
-
- if (_receivedCount == MSG_COUNT)
- {
- _returns.countDown();
- }
- }
- }
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java b/Final/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.java
deleted file mode 100644
index 88272023e8..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/MessageTestHelper.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.server.queue;
-
-import org.apache.qpid.framing.BasicPublishBody;
-import org.apache.qpid.framing.ContentHeaderBody;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.abstraction.MessagePublishInfo;
-import org.apache.qpid.server.store.MessageStore;
-import org.apache.qpid.server.store.SkeletonMessageStore;
-import org.apache.qpid.server.store.StoreContext;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.util.TestApplicationRegistry;
-import org.apache.qpid.server.util.NullApplicationRegistry;
-import org.apache.qpid.server.txn.TransactionalContext;
-import org.apache.qpid.server.txn.NonTransactionalContext;
-import org.apache.qpid.server.RequiredDeliveryException;
-import org.apache.qpid.AMQException;
-
-import junit.framework.TestCase;
-
-import java.util.LinkedList;
-import java.util.HashSet;
-
-class MessageTestHelper extends TestCase
-{
- private final MessageStore _messageStore = new SkeletonMessageStore();
-
- private final StoreContext _storeContext = new StoreContext();
-
- private final TransactionalContext _txnContext = new NonTransactionalContext(_messageStore, _storeContext, null,
- new LinkedList<RequiredDeliveryException>(),
- new HashSet<Long>());
-
- MessageTestHelper() throws Exception
- {
- ApplicationRegistry.initialise(new NullApplicationRegistry());
- }
-
- AMQMessage message() throws AMQException
- {
- return message(false);
- }
-
- AMQMessage message(final boolean immediate) throws AMQException
- {
- MessagePublishInfo publish = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- public boolean isImmediate()
- {
- return immediate;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return null;
- }
- };
-
- return new AMQMessage(_messageStore.getNewMessageId(), publish, _txnContext,
- new ContentHeaderBody());
- }
-
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java b/Final/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.java
deleted file mode 100644
index 0ad6502755..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/MockProtocolSession.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.server.queue;
-
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.FieldTable;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.framing.VersionSpecificRegistry;
-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 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 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 byte getProtocolMajorVersion()
- {
- return 8; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public byte getProtocolMinorVersion()
- {
- return 0; //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.
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java b/Final/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.java
deleted file mode 100644
index d01284cb8a..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/PersistentTestManual.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.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/Final/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.java
deleted file mode 100644
index 7bbfdb5543..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/QueueDepthWithSelectorTest.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.server.queue;
-
-import java.util.Hashtable;
-
-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 junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.framing.AMQShortString;
-import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.server.registry.IApplicationRegistry;
-import org.apache.qpid.server.virtualhost.VirtualHost;
-
-
-/**
- * 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
- {
- 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()
- {
- IApplicationRegistry registry = ApplicationRegistry.getInstance();
-
- VirtualHost testVhost = registry.getVirtualHostRegistry().getVirtualHost(VHOST);
- assertNotNull("Unable to get test Vhost", testVhost);
- assertNotNull("Unable to get test queue registry", testVhost.getQueueRegistry());
- AMQQueue q = testVhost.getQueueRegistry().getQueue(new AMQShortString(QUEUE));
- assertNotNull("Unable to get test queue", q);
- assertEquals("Queue count too big", 0, q.getMessageCount());
- }
-
- private void verifyAllMessagesRecevied() throws JMSException
- {
-
- 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]);
- }
-
- //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/Final/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionManagerTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionManagerTest.java
deleted file mode 100644
index d3ec3c11d4..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionManagerTest.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.server.queue;
-
-import junit.framework.TestCase;
-
-public class SubscriptionManagerTest extends TestCase
-{
- private final SubscriptionSet mgr = new SubscriptionSet();
-
- public void testBasicSubscriptionManagement()
- {
- assertTrue(mgr.isEmpty());
- assertFalse(mgr.hasActiveSubscribers());
- SubscriptionTestHelper s1 = new SubscriptionTestHelper("S1");
- mgr.addSubscriber(s1);
- assertFalse(mgr.isEmpty());
- assertTrue(mgr.hasActiveSubscribers());
-
- SubscriptionTestHelper s2 = new SubscriptionTestHelper("S2");
- mgr.addSubscriber(s2);
-
- s2.setSuspended(true);
- assertFalse(mgr.isEmpty());
- assertTrue(mgr.hasActiveSubscribers());
- assertTrue(s2.isSuspended());
- assertFalse(s1.isSuspended());
-
- s1.setSuspended(true);
- assertFalse(mgr.hasActiveSubscribers());
-
- mgr.removeSubscriber(new SubscriptionTestHelper("S1"));
- assertFalse(mgr.isEmpty());
- mgr.removeSubscriber(new SubscriptionTestHelper("S2"));
- assertTrue(mgr.isEmpty());
- }
-
- public void testRoundRobin()
- {
- SubscriptionTestHelper a = new SubscriptionTestHelper("A");
- SubscriptionTestHelper b = new SubscriptionTestHelper("B");
- SubscriptionTestHelper c = new SubscriptionTestHelper("C");
- SubscriptionTestHelper d = new SubscriptionTestHelper("D");
- mgr.addSubscriber(a);
- mgr.addSubscriber(b);
- mgr.addSubscriber(c);
- mgr.addSubscriber(d);
-
- for (int i = 0; i < 3; i++)
- {
- assertEquals(a, mgr.nextSubscriber(null));
- assertEquals(b, mgr.nextSubscriber(null));
- assertEquals(c, mgr.nextSubscriber(null));
- assertEquals(d, mgr.nextSubscriber(null));
- }
-
- c.setSuspended(true);
-
- for (int i = 0; i < 3; i++)
- {
- assertEquals(a, mgr.nextSubscriber(null));
- assertEquals(b, mgr.nextSubscriber(null));
- assertEquals(d, mgr.nextSubscriber(null));
- }
-
- mgr.removeSubscriber(a);
- d.setSuspended(true);
- c.setSuspended(false);
- Subscription e = new SubscriptionTestHelper("D");
- mgr.addSubscriber(e);
-
- for (int i = 0; i < 3; i++)
- {
- assertEquals(b, mgr.nextSubscriber(null));
- assertEquals(c, mgr.nextSubscriber(null));
- assertEquals(e, mgr.nextSubscriber(null));
- }
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(SubscriptionManagerTest.class);
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionSetTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionSetTest.java
deleted file mode 100644
index bcf54693d3..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionSetTest.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.server.queue;
-
-import junit.framework.TestCase;
-
-public class SubscriptionSetTest extends TestCase
-{
- /**
- * A SubscriptionSet that counts the number of items scanned.
- */
- static class TestSubscriptionSet extends SubscriptionSet
- {
- private int scanned = 0;
-
- void resetScanned()
- {
- scanned = 0;
- }
-
- protected void subscriberScanned()
- {
- ++scanned;
- }
-
- int getScanned()
- {
- return scanned;
- }
- }
-
- final SubscriptionTestHelper sub1 = new SubscriptionTestHelper("1");
- final SubscriptionTestHelper sub2 = new SubscriptionTestHelper("2");
- final SubscriptionTestHelper sub3 = new SubscriptionTestHelper("3");
-
- final SubscriptionTestHelper suspendedSub1 = new SubscriptionTestHelper("sus1", true);
- final SubscriptionTestHelper suspendedSub2 = new SubscriptionTestHelper("sus2", true);
- final SubscriptionTestHelper suspendedSub3 = new SubscriptionTestHelper("sus3", true);
-
- public void testNextMessage()
- {
- SubscriptionSet ss = new SubscriptionSet();
- assertNull(ss.nextSubscriber(null));
- assertEquals(0, ss.getCurrentSubscriber());
-
- ss.addSubscriber(sub1);
- assertEquals(sub1, ss.nextSubscriber(null));
- assertEquals(1, ss.getCurrentSubscriber());
- assertEquals(sub1, ss.nextSubscriber(null));
- assertEquals(1, ss.getCurrentSubscriber());
-
- ss.addSubscriber(sub2);
- ss.addSubscriber(sub3);
-
- assertEquals(sub2, ss.nextSubscriber(null));
- assertEquals(2, ss.getCurrentSubscriber());
-
- assertEquals(sub3, ss.nextSubscriber(null));
- assertEquals(3, ss.getCurrentSubscriber());
- }
-
- public void testNextMessageWhenAllSuspended()
- {
- SubscriptionSet ss = createAllSuspendedSubscriptionSet();
- assertNull(ss.nextSubscriber(null));
- assertEquals(3, ss.getCurrentSubscriber());
-
- assertNull(ss.nextSubscriber(null));
- assertEquals(3, ss.getCurrentSubscriber());
- }
-
- private TestSubscriptionSet createAllSuspendedSubscriptionSet()
- {
- TestSubscriptionSet ss = new TestSubscriptionSet();
- ss.addSubscriber(suspendedSub1);
- ss.addSubscriber(suspendedSub2);
- ss.addSubscriber(suspendedSub3);
- return ss;
- }
-
- public void testNextMessageAfterRemove()
- {
- SubscriptionSet ss = new SubscriptionSet();
- ss.addSubscriber(suspendedSub1);
- ss.addSubscriber(suspendedSub2);
- ss.addSubscriber(sub3);
- assertEquals(sub3, ss.nextSubscriber(null));
- assertEquals(3, ss.getCurrentSubscriber());
-
- assertEquals(suspendedSub1, ss.removeSubscriber(suspendedSub1));
-
- assertEquals(sub3, ss.nextSubscriber(null)); // Current implementation handles OutOfBoundsException here.
- assertEquals(2, ss.getCurrentSubscriber());
- }
-
- public void testNextMessageOverScanning()
- {
- TestSubscriptionSet ss = new TestSubscriptionSet();
- SubscriptionTestHelper sub = new SubscriptionTestHelper("test");
- ss.addSubscriber(suspendedSub1);
- ss.addSubscriber(sub);
- ss.addSubscriber(suspendedSub3);
- assertEquals(sub, ss.nextSubscriber(null));
- assertEquals(2, ss.getCurrentSubscriber());
- assertEquals(2, ss.getScanned());
-
- ss.resetScanned();
- sub.setSuspended(true);
- assertNull(ss.nextSubscriber(null));
- assertEquals(3, ss.getCurrentSubscriber());
- // Current implementation overscans by one item here.
- assertEquals(ss.size() + 1, ss.getScanned());
- }
-
- public void testNextMessageOverscanWorstCase() {
- TestSubscriptionSet ss = createAllSuspendedSubscriptionSet();
- ss.nextSubscriber(null);
- // Scans the subscriptions twice.
- assertEquals(ss.size() * 2, ss.getScanned());
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(SubscriptionSetTest.class);
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java b/Final/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.java
deleted file mode 100644
index fe947ef3bc..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/SubscriptionTestHelper.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.server.queue;
-
-import org.apache.qpid.server.AMQChannel;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Queue;
-
-public class SubscriptionTestHelper implements Subscription
-{
- private final List<AMQMessage> messages;
- private final Object key;
- private boolean isSuspended;
-
- public SubscriptionTestHelper(Object key)
- {
- this(key, new ArrayList<AMQMessage>());
- }
-
- public SubscriptionTestHelper(final Object key, final boolean isSuspended)
- {
- this(key);
- setSuspended(isSuspended);
- }
-
- SubscriptionTestHelper(Object key, List<AMQMessage> messages)
- {
- this.key = key;
- this.messages = messages;
- }
-
- List<AMQMessage> getMessages()
- {
- return messages;
- }
-
- public void send(AMQMessage msg, AMQQueue queue)
- {
- messages.add(msg);
- }
-
- public void setSuspended(boolean suspended)
- {
- isSuspended = suspended;
- }
-
- public boolean isSuspended()
- {
- return isSuspended;
- }
-
- public boolean wouldSuspend(AMQMessage msg)
- {
- return isSuspended;
- }
-
- public void addToResendQueue(AMQMessage msg)
- {
- //no-op
- }
-
- public Object getSendLock()
- {
- return new Object();
- }
-
- public AMQChannel getChannel()
- {
- return null;
- }
-
- public void queueDeleted(AMQQueue queue)
- {
- }
-
- public boolean filtersMessages()
- {
- return false;
- }
-
- public boolean hasInterest(AMQMessage msg)
- {
- return true;
- }
-
- public Queue<AMQMessage> getPreDeliveryQueue()
- {
- return null;
- }
-
- public Queue<AMQMessage> getResendQueue()
- {
- return null;
- }
-
- public Queue<AMQMessage> getNextQueue(Queue<AMQMessage> messages)
- {
- return messages;
- }
-
- public void enqueueForPreDelivery(AMQMessage msg, boolean deliverFirst)
- {
- //no-op
- }
-
- public boolean isAutoClose()
- {
- return false;
- }
-
- 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/Final/java/systests/src/main/java/org/apache/qpid/server/queue/TimeToLiveTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/queue/TimeToLiveTest.java
deleted file mode 100644
index 06956ba52f..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/queue/TimeToLiveTest.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.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.jndi.PropertiesFileInitialContextFactory;
-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 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;
-
- Context _context;
-
- private Connection _clientConnection, _producerConnection;
-
- private MessageConsumer _consumer;
- MessageProducer _producer;
- Session _clientSession, _producerSession;
- private static final int MSG_COUNT = 50;
-
- protected void setUp() throws Exception
- {
- 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);
-
- 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);
- }
-
- protected void tearDown() throws Exception
- {
- _clientConnection.close();
-
- _producerConnection.close();
- super.tearDown();
-
- if (BROKER.startsWith("vm://"))
- {
- TransportConnection.killAllVMBrokers();
- }
- }
-
- public void test() throws JMSException
- {
- //Set TTL
- int msg = 0;
- _producer.send(nextMessage(String.valueOf(msg), true));
-
- _producer.setTimeToLive(TIME_TO_LIVE);
-
- for (; msg < MSG_COUNT - 2; msg++)
- {
- _producer.send(nextMessage(String.valueOf(msg), false));
- }
-
- //Reset TTL
- _producer.setTimeToLive(0L);
- _producer.send(nextMessage(String.valueOf(msg), false));
-
- try
- {
- // Sleep to ensure TTL reached
- Thread.sleep(2000);
- }
- catch (InterruptedException e)
- {
-
- }
-
- _clientConnection.start();
-
- //Receive Message 0
- Message received = _consumer.receive(100);
- 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(100);
- 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(100);
- Assert.assertNull("More messages received", received);
- }
-
- private Message nextMessage(String msg, boolean first) throws JMSException
- {
- Message send = _producerSession.createTextMessage("Message " + msg);
- send.setBooleanProperty("first", first);
- send.setLongProperty("TTL", _producer.getTimeToLive());
- return send;
- }
-
-
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java b/Final/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.java
deleted file mode 100644
index 6ffa3e0e02..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/store/SkeletonMessageStore.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.server.store;
-
-import org.apache.commons.configuration.Configuration;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.ContentBody;
-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.AMQQueue;
-import org.apache.qpid.server.queue.MessageMetaData;
-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 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 void removeQueue(AMQShortString name) throws AMQException
- {
-
- }
-
- public void enqueueMessage(StoreContext context, AMQShortString name, Long messageId) throws AMQException
- {
-
- }
-
- public void dequeueMessage(StoreContext context, AMQShortString name, Long messageId) throws AMQException
- {
-
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java b/Final/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.java
deleted file mode 100644
index ab6d9742e4..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/store/TestReferenceCounting.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.server.store;
-
-import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.BasicContentHeaderProperties;
-import org.apache.qpid.framing.BasicPublishBody;
-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.txn.NonTransactionalContext;
-
-/**
- * Tests that reference counting works correctly with AMQMessage and the message store
- */
-public class TestReferenceCounting extends TestCase
-{
- private TestableMemoryMessageStore _store;
-
- private StoreContext _storeContext = new StoreContext();
-
- protected void setUp() throws Exception
- {
- super.setUp();
- _store = new TestableMemoryMessageStore();
- }
-
- /**
- * Check that when the reference count is decremented the message removes itself from the store
- */
- public void testMessageGetsRemoved() throws AMQException
- {
- createPersistentContentHeader();
-
- MessagePublishInfo info = new MessagePublishInfo()
- {
-
- public AMQShortString getExchange()
- {
- return null;
- }
-
- public boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return null;
- }
- };
-
- AMQMessage message = new AMQMessage(_store.getNewMessageId(), info,
- new NonTransactionalContext(_store, _storeContext, null, null, null),
- createPersistentContentHeader());
- message = message.takeReference();
-
- // we call routing complete to set up the handle
- message.routingComplete(_store, _storeContext, new MessageHandleFactory());
- assertTrue(_store.getMessageMetaDataMap().size() == 1);
- message.decrementReference(_storeContext);
- assertTrue(_store.getMessageMetaDataMap().size() == 0);
- }
-
- 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 boolean isImmediate()
- {
- return false;
- }
-
- public boolean isMandatory()
- {
- return false;
- }
-
- public AMQShortString getRoutingKey()
- {
- return null;
- }
- };
-
- AMQMessage message = new AMQMessage(_store.getNewMessageId(),
- info,
- new NonTransactionalContext(_store, _storeContext, null, null, null),
- createPersistentContentHeader());
-
- message = message.takeReference();
- // we call routing complete to set up the handle
- message.routingComplete(_store, _storeContext, new MessageHandleFactory());
- assertTrue(_store.getMessageMetaDataMap().size() == 1);
- message = message.takeReference();
- message.decrementReference(_storeContext);
- assertTrue(_store.getMessageMetaDataMap().size() == 1);
- }
-
- public static junit.framework.Test suite()
- {
- return new junit.framework.TestSuite(TestReferenceCounting.class);
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java b/Final/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.java
deleted file mode 100644
index 48d808142c..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/store/TestableMemoryMessageStore.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.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 TestableMemoryMessageStore extends MemoryMessageStore
-{
-
- MemoryMessageStore _mms = null;
-
- 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;
- }
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java
deleted file mode 100644
index 025f8d89f6..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/txn/TxnBufferTest.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * 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.TestableMemoryMessageStore;
-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 TestableMemoryMessageStore
- {
- 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("Fail!");
- }
- }
-
- 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/Final/java/systests/src/main/java/org/apache/qpid/server/txn/TxnTest.java b/Final/java/systests/src/main/java/org/apache/qpid/server/txn/TxnTest.java
deleted file mode 100644
index 2957dda869..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/txn/TxnTest.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.server.txn;
-
-import junit.framework.TestCase;
-import junit.framework.Assert;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
-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.jms.TextMessage;
-import javax.jms.MessageListener;
-import javax.naming.spi.InitialContextFactory;
-import javax.naming.Context;
-import java.util.Hashtable;
-import java.util.concurrent.CountDownLatch;
-
-
-/** Test Case Qpid-617 */
-public class TxnTest extends TestCase implements MessageListener
-{
- private static final Logger _logger = Logger.getLogger(TxnTest.class);
-
-
- protected final String BROKER = "vm://:1";//"localhost";
- protected final String VHOST = "/test";
- protected final String QUEUE = "TxnTestQueue";
-
-
- Context _context;
- Queue _queue;
-
- private Connection _clientConnection, _producerConnection;
-
- private MessageConsumer _consumer;
- MessageProducer _producer;
- Session _clientSession, _producerSession;
- private CountDownLatch commit = new CountDownLatch(1);
-
- protected void setUp() throws Exception
- {
- 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);
-
- _queue = (Queue) _context.lookup("queue");
-
- //Create Client 1
- _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
-
- _clientSession = _clientConnection.createSession(true, 0);
-
- _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);
- }
-
- protected void tearDown() throws Exception
- {
- if (_clientConnection != null)
- {
- _clientConnection.close();
- }
-
- if (_producerConnection != null)
- {
- _producerConnection.close();
- }
-
- super.tearDown();
-
- if (BROKER.startsWith("vm://"))
- {
- TransportConnection.killAllVMBrokers();
- }
- }
-
-
- public void testMessageListener() throws JMSException
- {
- _consumer.setMessageListener(this);
- _clientConnection.start();
-
- //Set TTL
- _producer.send(_producerSession.createTextMessage("TxtTestML"));
-
-
- try
- {
- //Wait for message to arrive
- commit.await();
- }
- catch (InterruptedException e)
- {
-
- }
- _consumer.close();
-
- _consumer = _clientSession.createConsumer(_queue);
-
- //Receive Message
- Message received = _consumer.receive(1000);
- assertNull("More messages received", received);
-
- _consumer.close();
- }
-
- public void onMessage(Message message)
- {
-
- try
- {
- assertEquals("Incorrect Message Received.", "TxtTestML", ((TextMessage) message).getText());
-
- _clientSession.commit();
- }
- catch (JMSException e)
- {
- fail("Failed to commit");
- }
-
- commit.countDown();
- }
-
-
- public void testReceive() throws JMSException
- {
- _clientConnection.start();
-
- //Set TTL
- _producer.send(_producerSession.createTextMessage("TxtTestReceive"));
-
- //Receive Message
- Message received = _consumer.receive(1000);
-
- assertEquals("Incorrect Message Received.", "TxtTestReceive", ((TextMessage) received).getText());
- //Receive Message
-
- received = _consumer.receive(1000);
-
- assertNull("More messages received", received);
-
- _consumer.close();
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/util/AveragedRun.java b/Final/java/systests/src/main/java/org/apache/qpid/server/util/AveragedRun.java
deleted file mode 100644
index 1d17985ab5..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/server/util/RunStats.java b/Final/java/systests/src/main/java/org/apache/qpid/server/util/RunStats.java
deleted file mode 100644
index ec67fc68b3..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/server/util/TestApplicationRegistry.java b/Final/java/systests/src/main/java/org/apache/qpid/server/util/TestApplicationRegistry.java
deleted file mode 100644
index bd7ed60d1d..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/server/util/TestApplicationRegistry.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.server.util;
-
-import org.apache.qpid.server.exchange.ExchangeFactory;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.server.management.ManagedObjectRegistry;
-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.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.AccessManager;
-import org.apache.qpid.server.security.access.AllowAll;
-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 org.apache.commons.configuration.Configuration;
-import org.apache.commons.configuration.MapConfiguration;
-
-import java.util.HashMap;
-import java.util.Collection;
-import java.util.Properties;
-
-public class TestApplicationRegistry extends ApplicationRegistry
-{
- private QueueRegistry _queueRegistry;
-
- private ExchangeRegistry _exchangeRegistry;
-
- private ExchangeFactory _exchangeFactory;
-
- private ManagedObjectRegistry _managedObjectRegistry;
-
- private AccessManager _accessManager;
-
- private PrincipalDatabaseManager _databaseManager;
-
- private AuthenticationManager _authenticationManager;
-
- 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);
-
- IApplicationRegistry appRegistry = ApplicationRegistry.getInstance();
- _managedObjectRegistry = appRegistry.getManagedObjectRegistry();
- _vHost = appRegistry.getVirtualHostRegistry().getVirtualHost("test");
- _queueRegistry = _vHost.getQueueRegistry();
- _exchangeFactory = _vHost.getExchangeFactory();
- _exchangeRegistry = _vHost.getExchangeRegistry();
-
- _messageStore = new TestableMemoryMessageStore();
-
- _configuration.addProperty("heartbeat.delay", 10 * 60); // 10 minutes
- }
-
- public Configuration getConfiguration()
- {
- return _configuration;
- }
-
- public QueueRegistry getQueueRegistry()
- {
- return _queueRegistry;
- }
-
- public ExchangeRegistry getExchangeRegistry()
- {
- return _exchangeRegistry;
- }
-
- public ExchangeFactory getExchangeFactory()
- {
- return _exchangeFactory;
- }
-
- public ManagedObjectRegistry getManagedObjectRegistry()
- {
- return _managedObjectRegistry;
- }
-
- public PrincipalDatabaseManager getDatabaseManager()
- {
- return _databaseManager;
- }
-
- public AuthenticationManager getAuthenticationManager()
- {
- return _authenticationManager;
- }
-
- public Collection<String> getVirtualHostNames()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public VirtualHostRegistry getVirtualHostRegistry()
- {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-
- public AccessManager getAccessManager()
- {
- return _accessManager;
- }
-
- public MessageStore getMessageStore()
- {
- return _messageStore;
- }
-}
-
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/server/util/TimedRun.java b/Final/java/systests/src/main/java/org/apache/qpid/server/util/TimedRun.java
deleted file mode 100644
index 1291380311..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/test/VMBrokerSetup.java b/Final/java/systests/src/main/java/org/apache/qpid/test/VMBrokerSetup.java
deleted file mode 100644
index e859fac4af..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/VMBrokerSetup.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.test;
-
-import junit.extensions.TestSetup;
-import junit.framework.Test;
-
-import org.apache.qpid.client.transport.TransportConnection;
-
-public class VMBrokerSetup extends TestSetup
-{
- public VMBrokerSetup(Test t)
- {
- super(t);
- }
-
- protected void setUp() throws Exception
- {
- super.setUp();
- try
- {
- TransportConnection.createVMBroker(1);
- }
- catch (Exception e)
- {
- fail("Unable to create broker: " + e);
- }
- }
-
- protected void tearDown() throws Exception
- {
- TransportConnection.killVMBroker(1);
- super.tearDown();
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java b/Final/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.java
deleted file mode 100644
index 9629f87d46..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/VMTestCase.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.test;
-
-import junit.extensions.TestSetup;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.jndi.PropertiesFileInitialContextFactory;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-
-import javax.jms.Connection;
-import javax.jms.ConnectionFactory;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.Session;
-import javax.naming.Context;
-import javax.naming.spi.InitialContextFactory;
-
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-public class VMTestCase extends TestCase
-{
- protected long RECEIVE_TIMEOUT = 1000L; // 1 sec
- protected long CLOSE_TIMEOUT = 10000L; // 10 secs
-
- protected Context _context;
- protected String _clientID;
- protected String _virtualhost;
- protected String _brokerlist;
-
- protected final Map<String, String> _connections = new HashMap<String, String>();
- protected final Map<String, String> _queues = new HashMap<String, String>();
- protected final Map<String, String> _topics = new HashMap<String, String>();
-
- protected void setUp() throws Exception
- {
- super.setUp();
- try
- {
- TransportConnection.createVMBroker(1);
- }
- catch (Exception e)
- {
- fail("Unable to create broker: " + e);
- }
-
- InitialContextFactory factory = new PropertiesFileInitialContextFactory();
-
- Hashtable<String, String> env = new Hashtable<String, String>();
-
- if (_clientID == null)
- {
- _clientID = this.getClass().getName();
- }
-
- if (_virtualhost == null)
- {
- _virtualhost = "/test";
- }
-
- if (_brokerlist == null)
- {
- _brokerlist = "vm://:1";
- }
-
- env.put("connectionfactory.connection", "amqp://guest:guest@" + _clientID + _virtualhost + "?brokerlist='"
- + _brokerlist + "'");
-
- for (Map.Entry<String, String> c : _connections.entrySet())
- {
- env.put("connectionfactory." + c.getKey(), c.getValue());
- }
-
- env.put("queue.queue", "queue");
-
- for (Map.Entry<String, String> q : _queues.entrySet())
- {
- env.put("queue." + q.getKey(), q.getValue());
- }
-
- env.put("topic.topic", "topic");
-
- for (Map.Entry<String, String> t : _topics.entrySet())
- {
- env.put("topic." + t.getKey(), t.getValue());
- }
-
- _context = factory.getInitialContext(env);
- }
-
- protected void tearDown() throws Exception
- {
- TransportConnection.killVMBroker(1);
- ApplicationRegistry.remove(1);
-
- super.tearDown();
- }
-
- public void testDummyinVMTestCase()
- {
- // keep maven happy
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTest.java b/Final/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTest.java
deleted file mode 100644
index ec9df8f1b3..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/client/QueueBrowserTest.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.client;
-
-import org.apache.log4j.Logger;
-import org.apache.qpid.test.VMTestCase;
-
-import javax.jms.Queue;
-import javax.jms.ConnectionFactory;
-import javax.jms.Session;
-import javax.jms.Connection;
-import javax.jms.MessageProducer;
-import javax.jms.MessageConsumer;
-import javax.jms.QueueBrowser;
-import javax.jms.TextMessage;
-import javax.jms.JMSException;
-import javax.jms.QueueReceiver;
-import javax.jms.Message;
-import java.util.Enumeration;
-
-import junit.framework.TestCase;
-
-public class QueueBrowserTest extends VMTestCase
-{
- private static final Logger _logger = Logger.getLogger(QueueBrowserTest.class);
-
- private static final int MSG_COUNT = 10;
-
- private Connection _clientConnection;
- private Session _clientSession;
- private Queue _queue;
-
- public void setUp() throws Exception
- {
-
- super.setUp();
-
- _queue = (Queue) _context.lookup("queue");
-
- //Create Client
- _clientConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
-
- _clientConnection.start();
-
- _clientSession = _clientConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- //Ensure _queue is created
- _clientSession.createConsumer(_queue).close();
-
- //Create Producer put some messages on the queue
- Connection producerConnection = ((ConnectionFactory) _context.lookup("connection")).createConnection();
-
- 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();
-
- }
-
- /*
- * 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 JMSException
- {
-
- // create QueueBrowser
- _logger.info("Creating Queue Browser");
-
- QueueBrowser queueBrowser = _clientSession.createBrowser(_queue);
-
- // check for messages
- if (_logger.isDebugEnabled())
- {
- _logger.debug("Checking for " + MSG_COUNT + " messages with QueueBrowser");
- }
-
- 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", MSG_COUNT, msgCount);
- if (msgCount != MSG_COUNT)
- {
- _logger.warn(msgCount + "/" + MSG_COUNT + " messages received.");
- }
-
- //Close browser
- queueBrowser.close();
-
- // VERIFY
-
- // continue and try to receive all messages
- MessageConsumer consumer = _clientSession.createConsumer(_queue);
-
- _logger.info("Verify messages are still on the queue");
-
- Message tempMsg;
-
- for (msgCount = 0; msgCount < MSG_COUNT; msgCount++)
- {
- tempMsg = (TextMessage) consumer.receive(RECEIVE_TIMEOUT);
- if (tempMsg == null)
- {
- fail("Message " + msgCount + " not retrieved from queue");
- }
- }
-
- _logger.info("All messages recevied from queue");
- }
-
-
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/Assertion.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/Assertion.java
deleted file mode 100644
index 75c1c97999..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/AssertionBase.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/AssertionBase.java
deleted file mode 100644
index 3d83224513..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/Circuit.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/Circuit.java
deleted file mode 100644
index d665acb62c..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEnd.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEnd.java
deleted file mode 100644
index e557620cf5..0000000000
--- a/Final/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.util.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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEndBase.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEndBase.java
deleted file mode 100644
index 251b216c45..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/CircuitEndBase.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.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.
- *
- * @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.
- */
- 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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/DropInTest.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/DropInTest.java
deleted file mode 100644
index 12cf0d79d5..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.java
deleted file mode 100644
index 9f1207202e..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/ExceptionMonitor.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.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. <td> {@link ExceptionListener}
- * </table>
- */
-public class ExceptionMonitor implements ExceptionListener
-{
- /** Used for debugging. */
- private final Logger log = Logger.getLogger(ExceptionMonitor.class);
-
- /** Holds the received exceptions. */
- List<JMSException> exceptions = new ArrayList<JMSException>();
-
- /**
- * 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.
- *
- * @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)
- {
- JMSException e = exceptions.get(0);
-
- Exception linkedCause = e.getLinkedException();
-
- if ((linkedCause != null) && aClass.isInstance(linkedCause))
- {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * 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<JMSException>();
- }
-
- /**
- * 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 (JMSException 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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.java
deleted file mode 100644
index 77bb7a5c52..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkBaseCase.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.test.framework;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.NDC;
-
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.server.registry.ApplicationRegistry;
-import org.apache.qpid.test.framework.localcircuit.LocalCircuitImpl;
-import org.apache.qpid.test.framework.sequencers.CircuitFactory;
-import org.apache.qpid.util.ConversationFactory;
-
-import uk.co.thebadgerset.junit.extensions.AsymptoticTestCase;
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * 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 AsymptoticTestCase
-{
- /** 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 DefaultCircuitFactory();
-
- /**
- * 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;
- }
-
- /**
- * 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 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 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());
-
- // Ensure that the in-vm broker is created.
- TransportConnection.createVMBroker(1);
- }
-
- /**
- * Ensures that the in-vm broker is cleaned up after each test run.
- */
- protected void tearDown()
- {
- try
- {
- // Ensure that the in-vm broker is cleaned up so that the next test starts afresh.
- TransportConnection.killVMBroker(1);
- ApplicationRegistry.remove(1);
- }
- finally
- {
- NDC.pop();
- }
- }
-
- /**
- * 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;
- }
-
- /**
- * DefaultCircuitFactory is a test sequencer that creates test circuits with publishing and receiving ends rooted
- * on the same JVM.
- */
- public class DefaultCircuitFactory implements CircuitFactory
- {
- /**
- * 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)
- {
- 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(ParsedProperties testProperties)
- {
- return LocalCircuitImpl.createCircuit(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)
- {
- 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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkClientBaseCase.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkClientBaseCase.java
deleted file mode 100644
index 2456ba1709..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/FrameworkClientBaseCase.java
+++ /dev/null
@@ -1,11 +0,0 @@
-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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/MessageMonitor.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/MessageMonitor.java
deleted file mode 100644
index a2dba45616..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/MessagingTestConfigProperties.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/MessagingTestConfigProperties.java
deleted file mode 100644
index f6664a78d9..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/MessagingTestConfigProperties.java
+++ /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.
- *
- */
-package org.apache.qpid.test.framework;
-
-import org.apache.qpid.jms.Session;
-
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-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_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 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 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(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(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(PREFETCH_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);
- }
-
- /**
- * 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);
- }
-
- public int getMessageSize()
- {
- return getPropertyAsInteger(MESSAGE_SIZE_PROPNAME);
- }
-
- public boolean getPublisherProducerBind()
- {
- return getPropertyAsBoolean(PUBLISHER_PRODUCER_BIND_PROPNAME);
- }
-
- public boolean getPublisherConsumerBind()
- {
- return getPropertyAsBoolean(PUBLISHER_CONSUMER_BIND_PROPNAME);
- }
-
- public boolean getReceiverProducerBind()
- {
- return getPropertyAsBoolean(RECEIVER_PRODUCER_BIND_PROPNAME);
- }
-
- public boolean getReceiverConsumerBind()
- {
- return getPropertyAsBoolean(RECEIVER_CONSUMER_BIND_PROPNAME);
- }
-
- public boolean getPublisherConsumerActive()
- {
- return getPropertyAsBoolean(PUBLISHER_CONSUMER_ACTIVE_PROPNAME);
- }
-
- public boolean getReceiverConsumerActive()
- {
- return getPropertyAsBoolean(RECEIVER_CONSUMER_ACTIVE_PROPNAME);
- }
-
- public String getSendDestinationNameRoot()
- {
- return getProperty(SEND_DESTINATION_NAME_ROOT_PROPNAME);
- }
-
- public String getReceiveDestinationNameRoot()
- {
- return getProperty(RECEIVE_DESTINATION_NAME_ROOT_PROPNAME);
- }
-
- public boolean getPersistentMode()
- {
- return getPropertyAsBoolean(PERSISTENT_MODE_PROPNAME);
- }
-
- public boolean getTransacted()
- {
- return getPropertyAsBoolean(TRANSACTED_PROPNAME);
- }
-
- public String getBroker()
- {
- return getProperty(BROKER_PROPNAME);
- }
-
- public String getVirtualHost()
- {
- return getProperty(VIRTUAL_HOST_PROPNAME);
- }
-
- public String getRate()
- {
- return getProperty(RATE_PROPNAME);
- }
-
- public boolean getPubsub()
- {
- return getPropertyAsBoolean(PUBSUB_PROPNAME);
- }
-
- public String getUsername()
- {
- return getProperty(USERNAME_PROPNAME);
- }
-
- public String getPassword()
- {
- return getProperty(PASSWORD_PROPNAME);
- }
-
- public int getDestinationCount()
- {
- return getPropertyAsInteger(DESTINATION_COUNT_PROPNAME);
- }
-
- public long getTimeout()
- {
- return getPropertyAsLong(TIMEOUT_PROPNAME);
- }
-
- public int getTxBatchSize()
- {
- return getPropertyAsInteger(TX_BATCH_SIZE_PROPNAME);
- }
-
- public boolean getDurableDests()
- {
- return getPropertyAsBoolean(DURABLE_DESTS_PROPNAME);
- }
-
- public int getAckMode()
- {
- return getPropertyAsInteger(ACK_MODE_PROPNAME);
- }
-
- public boolean getDurableSubscription()
- {
- return getPropertyAsBoolean(DURABLE_SUBSCRIPTION_PROPNAME);
- }
-
- public int getMaxPending()
- {
- return getPropertyAsInteger(MAX_PENDING_PROPNAME);
- }
-
- public int getPrefecth()
- {
- return getPropertyAsInteger(PREFETCH_PROPNAME);
- }
-
- public boolean getNoLocal()
- {
- return getPropertyAsBoolean(NO_LOCAL_PROPNAME);
- }
-
- public boolean getExclusive()
- {
- return getPropertyAsBoolean(EXCLUSIVE_PROPNAME);
- }
-
- public boolean getImmediate()
- {
- return getPropertyAsBoolean(IMMEDIATE_PROPNAME);
- }
-
- public boolean getMandatory()
- {
- return getPropertyAsBoolean(MANDATORY_PROPNAME);
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/Publisher.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/Publisher.java
deleted file mode 100644
index df35579533..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/Publisher.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.test.framework;
-
-/**
- * A Publisher is a {@link CircuitEnd} that 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.
- * <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 Publisher
-{
- /**
- * Provides an assertion that the publisher encountered no exceptions.
- *
- * @return An assertion that the publisher encountered no exceptions.
- */
- public Assertion noExceptionsAssertion();
-
- /**
- * 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();
-
- /**
- * 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();
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/Receiver.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/Receiver.java
deleted file mode 100644
index e01b272d5a..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/Receiver.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 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>
- */
-public interface Receiver
-{
- /**
- * Provides an assertion that the receivers encountered no exceptions.
- *
- * @return An assertion that the receivers encountered no exceptions.
- */
- public Assertion noExceptionsAssertion();
-
- /**
- * 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.
- */
- public Assertion allMessagesAssertion();
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/TestClientDetails.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/TestClientDetails.java
deleted file mode 100644
index 1e5807cba8..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/TestUtils.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/TestUtils.java
deleted file mode 100644
index 569eac425c..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/TestUtils.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.test.framework;
-
-import org.apache.log4j.Logger;
-
-import static org.apache.qpid.test.framework.MessagingTestConfigProperties.*;
-
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-import javax.jms.*;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * 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> Inject a short pause in a test.
- * </table>
- */
-public class TestUtils
-{
- /** Used for debugging. */
- private static Logger log = Logger.getLogger(TestUtils.class);
-
- private static 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.
- *
- *
- */
- 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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchFailureException.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchFailureException.java
deleted file mode 100644
index b04ab0f9b0..0000000000
--- a/Final/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. This could
- * be because a reference signal is not available, or because a desired accurracy cannot be attained, for example.
- *
- * <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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchThread.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchThread.java
deleted file mode 100644
index 3a2655340e..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchThread.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.test.framework.clocksynch;
-
-import org.apache.log4j.Logger;
-
-import uk.co.thebadgerset.junit.extensions.ShutdownHookable;
-import uk.co.thebadgerset.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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchronizer.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/ClockSynchronizer.java
deleted file mode 100644
index d0fd16d715..0000000000
--- a/Final/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 synchronziation.
- * <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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/LocalClockSynchronizer.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/LocalClockSynchronizer.java
deleted file mode 100644
index 4f34e1c047..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockReference.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockReference.java
deleted file mode 100644
index f6195aa553..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockReference.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.clocksynch;
-
-import org.apache.log4j.Logger;
-
-import java.io.IOException;
-import java.net.*;
-import java.nio.ByteBuffer;
-
-import uk.co.thebadgerset.junit.extensions.ShutdownHookable;
-
-/**
- * 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 = 4445;
-
- /** 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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockSynchronizer.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockSynchronizer.java
deleted file mode 100644
index 78f05767d3..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/clocksynch/UDPClockSynchronizer.java
+++ /dev/null
@@ -1,464 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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 uk.co.thebadgerset.junit.extensions.util.CommandLineParser;
-import uk.co.thebadgerset.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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedCircuitImpl.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedCircuitImpl.java
deleted file mode 100644
index 628729cb51..0000000000
--- a/Final/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.util.ConversationFactory;
-
-import uk.co.thebadgerset.junit.extensions.TimingController;
-import uk.co.thebadgerset.junit.extensions.TimingControllerAware;
-import uk.co.thebadgerset.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 uk.co.thebadgerset.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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedPublisherImpl.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedPublisherImpl.java
deleted file mode 100644
index 9e3054964c..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedPublisherImpl.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.test.framework.distributedcircuit;
-
-import org.apache.qpid.test.framework.Assertion;
-import org.apache.qpid.test.framework.Publisher;
-
-/**
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </table>
- */
-public class DistributedPublisherImpl implements Publisher
-{
- /**
- * Provides an assertion that the publisher encountered no exceptions.
- *
- * @return An assertion that the publisher encountered no exceptions.
- */
- public Assertion noExceptionsAssertion()
- {
- 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.");
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedReceiverImpl.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedReceiverImpl.java
deleted file mode 100644
index 4a77906448..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/DistributedReceiverImpl.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.test.framework.distributedcircuit;
-
-import org.apache.qpid.test.framework.Assertion;
-import org.apache.qpid.test.framework.Receiver;
-
-/**
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </table>
- */
-public class DistributedReceiverImpl implements Receiver
-{
- /**
- * Provides an assertion that the receivers encountered no exceptions.
- *
- * @return An assertion that the receivers encountered no exceptions.
- */
- public Assertion noExceptionsAssertion()
- {
- 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.
- */
- public Assertion allMessagesAssertion()
- {
- throw new RuntimeException("Not implemented.");
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/TestClientCircuitEnd.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/TestClientCircuitEnd.java
deleted file mode 100644
index 621d16ec9b..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedcircuit/TestClientCircuitEnd.java
+++ /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.
- *
- */
-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.test.framework.localcircuit.LocalCircuitImpl;
-
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-import uk.co.thebadgerset.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>
- * </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.
- 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 = LocalCircuitImpl.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 = LocalCircuitImpl.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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.java
deleted file mode 100644
index 90a44e3b6b..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/Coordinator.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.framework.distributedtesting;
-
-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.util.ConversationFactory;
-import org.apache.qpid.util.PrettyPrintingUtils;
-
-import uk.co.thebadgerset.junit.extensions.TKTestRunner;
-import uk.co.thebadgerset.junit.extensions.WrappedSuiteTestDecorator;
-import uk.co.thebadgerset.junit.extensions.util.CommandLineParser;
-import uk.co.thebadgerset.junit.extensions.util.MathUtils;
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-import uk.co.thebadgerset.junit.extensions.util.TestContextProperties;
-
-import javax.jms.*;
-
-import java.net.InetAddress;
-import java.util.*;
-import java.util.concurrent.LinkedBlockingQueue;
-
-/**
- * <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 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.
- *
- * @todo Remove hard coding of test cases and put on command line instead.
- */
-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.
- */
- 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)
- {
- super(repetitions, duration, threads, delay, params, testCaseName, reportDir, runName, csv, xml, verbose);
-
- 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" }
- }), 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");
-
- 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>>();
-
- // 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);
-
- 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());
- 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 = " + PrettyPrintingUtils.printArray(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.");
- }
-
- // 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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestDecorator.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/DistributedTestDecorator.java
deleted file mode 100644
index c2f34b44fc..0000000000
--- a/Final/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.util.ConversationFactory;
-
-import uk.co.thebadgerset.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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.java
deleted file mode 100644
index 995aa5e71d..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/FanOutTestDecorator.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.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.util.ConversationFactory;
-
-import uk.co.thebadgerset.junit.extensions.WrappedSuiteTestDecorator;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageListener;
-
-import java.util.Collection;
-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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.java
deleted file mode 100644
index 918f0f9177..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/InteropTestDecorator.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.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.util.ConversationFactory;
-
-import uk.co.thebadgerset.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.util.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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/OptOutTestCase.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/OptOutTestCase.java
deleted file mode 100644
index fcdac20ca2..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClientControlledTest.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/distributedtesting/TestClientControlledTest.java
deleted file mode 100644
index 893a022b97..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/listeners/XMLTestListener.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/listeners/XMLTestListener.java
deleted file mode 100644
index 014dd21292..0000000000
--- a/Final/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 uk.co.thebadgerset.junit.extensions.ShutdownHookable;
-import uk.co.thebadgerset.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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalCircuitImpl.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalCircuitImpl.java
deleted file mode 100644
index 010669a7c2..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalCircuitImpl.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.test.framework.localcircuit;
-
-import org.apache.log4j.Logger;
-
-import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.test.framework.*;
-
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-import javax.jms.*;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.atomic.AtomicLong;
-
-/**
- * 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);
-
- /** Used to create unique destination names for each test. */
- private static AtomicLong uniqueDestsId = new AtomicLong();
-
- /** 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.
- */
- protected 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);
- }
-
- /**
- * Creates a local test circuit from the specified test parameters.
- *
- * @param testProps The test parameters.
- *
- * @return A connected and ready to start, test circuit.
- */
- public static Circuit createCircuit(ParsedProperties testProps)
- {
- // Create a standard publisher/receivers test client pair on a shared connection, individual sessions.
- try
- {
- // Cast the test properties into a typed interface for convenience.
- MessagingTestConfigProperties props = new MessagingTestConfigProperties(testProps);
-
- // 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(testProps);
-
- // 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 = new LocalPublisherImpl(publisherEnd);
- LocalReceiverImpl receiver = new LocalReceiverImpl(receiverEnd);
-
- return new LocalCircuitImpl(testProps, publisher, receiver, connection, publisher.getExceptionMonitor());
- }
- catch (JMSException e)
- {
- throw new RuntimeException("Could not create publisher/receivers pair due to a JMSException.", e);
- }
- }
-
- /**
- * 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 static CircuitEndBase createPublisherCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId)
- throws JMSException
- {
- log.debug(
- "public static 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.getTransacted(), 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 static CircuitEndBase createReceiverCircuitEnd(Connection connection, ParsedProperties testProps, long uniqueId)
- throws JMSException
- {
- log.debug(
- "public static 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.getTransacted(), 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);
- }
-
- /**
- * 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()
- {
- boolean transactional = testProps.getPropertyAsBoolean(MessagingTestConfigProperties.TRANSACTED_PROPNAME);
-
- // Send an immediate message through the publisher and ensure that it results in a JMSException.
- try
- {
- CircuitEnd end = getLocalPublisherCircuitEnd();
-
- end.send(createTestMessage(end));
-
- 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
- {
- return client.getSession().createTextMessage("Hello");
- }
-
- /**
- * 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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalPublisherImpl.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalPublisherImpl.java
deleted file mode 100644
index 93a137dffa..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalPublisherImpl.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.test.framework.localcircuit;
-
-import org.apache.qpid.client.AMQNoConsumersException;
-import org.apache.qpid.client.AMQNoRouteException;
-import org.apache.qpid.test.framework.*;
-
-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. */
- private LocalCircuitImpl circuit;
-
- /**
- * Creates a circuit end point on the specified producer, consumer and controlSession.
- *
- * @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.
- */
- 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.
- *
- * @return An assertion that the publisher encountered no exceptions.
- */
- public Assertion noExceptionsAssertion()
- {
- 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 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()
- {
- 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.
- *
- * @return An assertion that the publisher got a no rout exception on every message.
- */
- public Assertion noRouteAssertion()
- {
- 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;
- }
- };
- }
-
- /**
- * Sets the contianing circuit.
- *
- * @param circuit The containing circuit.
- */
- public void setCircuit(LocalCircuitImpl circuit)
- {
- this.circuit = circuit;
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalReceiverImpl.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalReceiverImpl.java
deleted file mode 100644
index 1b5acf92de..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/localcircuit/LocalReceiverImpl.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.test.framework.localcircuit;
-
-import org.apache.qpid.test.framework.*;
-
-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.
- *
- * @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.
- */
- 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.
- *
- * @return An assertion that the receivers encountered no exceptions.
- */
- public Assertion noExceptionsAssertion()
- {
- return null;
- }
-
- /**
- * 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.
- */
- public Assertion allMessagesAssertion()
- {
- return null;
- }
-
- /**
- * Sets the contianing circuit.
- *
- * @param circuit The containing circuit.
- */
- public void setCircuit(LocalCircuitImpl circuit)
- {
- this.circuit = circuit;
- }
-}
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/package.html b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/package.html
deleted file mode 100644
index f07a5118e7..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/package.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<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> \ No newline at end of file
diff --git a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.java
deleted file mode 100644
index 555071760e..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/BaseCircuitFactory.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.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.util.ConversationFactory;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.java
deleted file mode 100644
index 82caa20d79..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/CircuitFactory.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.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.util.ConversationFactory;
-
-import uk.co.thebadgerset.junit.extensions.util.ParsedProperties;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-/**
- * A TestCaseSequence 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>
- *
- * @todo The sequence test method is deprecated, in favour of using test circuits instead. This interface might be
- * better renamed to somethign like CircuitFactory, also the split between this interface and
- * DistributedTestSequencer could be removed and DistributedTestCase functionality merged into FrameworkBaseCase.
- * This is so that any test case written on top of the framework base case can be distributed, without having
- * to extend a different base test class.
- */
-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(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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.java
deleted file mode 100644
index 673b47df03..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/FanOutCircuitFactory.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.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.util.ConversationFactory;
-
-import uk.co.thebadgerset.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;
-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>
- * </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 functionaility 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(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/Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.java b/Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.java
deleted file mode 100644
index 35bcf78b72..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/test/framework/sequencers/InteropCircuitFactory.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.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.util.ConversationFactory;
-
-import uk.co.thebadgerset.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;
-import java.util.Properties;
-
-/**
- * <p/><table id="crc"><caption>CRC Card</caption>
- * <tr><th> Responsibilities <th> Collaborations
- * <tr><td>
- * </table>
- */
-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(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/Final/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnectionHelper.java b/Final/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnectionHelper.java
deleted file mode 100644
index 398e3e7800..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/testutil/QpidClientConnectionHelper.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.testutil;
-
-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.DeliveryMode;
-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/Final/java/systests/src/main/java/org/apache/qpid/util/ClasspathScanner.java b/Final/java/systests/src/main/java/org/apache/qpid/util/ClasspathScanner.java
deleted file mode 100644
index bad49060ca..0000000000
--- a/Final/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/Final/java/systests/src/main/java/org/apache/qpid/util/ConversationFactory.java b/Final/java/systests/src/main/java/org/apache/qpid/util/ConversationFactory.java
deleted file mode 100644
index a325e7025e..0000000000
--- a/Final/java/systests/src/main/java/org/apache/qpid/util/ConversationFactory.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.util;
-
-import org.apache.log4j.Logger;
-
-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><th> 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/Final/java/systests/src/main/java/systests.log4j b/Final/java/systests/src/main/java/systests.log4j
deleted file mode 100644
index 6d596d1d19..0000000000
--- a/Final/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/Final/java/systests/src/old_test/java/org/apache/qpid/server/exchange/HeadersExchangePerformanceTest.java b/Final/java/systests/src/old_test/java/org/apache/qpid/server/exchange/HeadersExchangePerformanceTest.java
deleted file mode 100644
index ff0d58ad69..0000000000
--- a/Final/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/Final/java/systests/src/old_test/java/org/apache/qpid/server/protocol/TestProtocolInitiation.java b/Final/java/systests/src/old_test/java/org/apache/qpid/server/protocol/TestProtocolInitiation.java
deleted file mode 100644
index e76c164f64..0000000000
--- a/Final/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/Final/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueueConcurrentPerfTest.java b/Final/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueueConcurrentPerfTest.java
deleted file mode 100644
index 11c0026455..0000000000
--- a/Final/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/Final/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueuePerfTest.java b/Final/java/systests/src/old_test/java/org/apache/qpid/server/queue/QueuePerfTest.java
deleted file mode 100644
index 5b3857396d..0000000000
--- a/Final/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/Final/java/systests/src/old_test/java/org/apache/qpid/server/queue/SendPerfTest.java b/Final/java/systests/src/old_test/java/org/apache/qpid/server/queue/SendPerfTest.java
deleted file mode 100644
index 2c5712fd35..0000000000
--- a/Final/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/Final/java/systests/src/old_test/java/org/apache/qpid/server/util/ConcurrentTest.java b/Final/java/systests/src/old_test/java/org/apache/qpid/server/util/ConcurrentTest.java
deleted file mode 100644
index 1ae8d3205d..0000000000
--- a/Final/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/Final/java/systests/src/old_test/java/org/apache/qpid/test/unit/ack/DisconnectAndRedeliverTest.java b/Final/java/systests/src/old_test/java/org/apache/qpid/test/unit/ack/DisconnectAndRedeliverTest.java
deleted file mode 100644
index 3e35e3c85b..0000000000
--- a/Final/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/Final/python/LICENSE.txt b/Final/python/LICENSE.txt
deleted file mode 100755
index 6b0b1270ff..0000000000
--- a/Final/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/Final/python/NOTICE.txt b/Final/python/NOTICE.txt
deleted file mode 100644
index 32ccdb70c4..0000000000
--- a/Final/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/Final/python/README.txt b/Final/python/README.txt
deleted file mode 100644
index 0a64f0e2f2..0000000000
--- a/Final/python/README.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-= RUNNING THE PYTHON TESTS =
-
-The tests/ directory contains a collection of python unit tests to
-exercise functions of a broker.
-
-Simplest way to run the tests:
-
- * Run a broker on the default port
-
- * ./run_tests
-
-For additional options: ./run_tests --help
-
-
-== Expected failures ==
-
-Until we complete functionality, tests may fail because the tested
-functionality is missing in the broker. To skip expected failures
-in the C++ or Java brokers:
-
- ./run_tests -I cpp_failing.txt
- ./run_tests -I java_failing.txt
-
-If you fix a failure, please remove it from the corresponding list.
diff --git a/Final/python/RELEASE_NOTES b/Final/python/RELEASE_NOTES
deleted file mode 100644
index 7005aa83cb..0000000000
--- a/Final/python/RELEASE_NOTES
+++ /dev/null
@@ -1,25 +0,0 @@
-Apache Incubator Qpid Python M2 Release Notes
--------------------------------------------
-
-The Qpid M2 release contains support the for AMQP 0-8 specification.
-You can access the 0-8 specification using the following link.
-http://www.amqp.org/tikiwiki/tiki-index.php?page=Download
-
-For full details of Qpid capabilities, as they currently stand, see our
-detailed 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.
-
-
-Known Issues/Outstanding Work
------------------------------
-
-There are no known issues for the Phyton client.
-
-
-M2 Tasks Completed
--------------------
-
-Bug QPID-467 Complete Interop Testing
diff --git a/Final/python/amqp-doc b/Final/python/amqp-doc
deleted file mode 100755
index 0e7f9e862a..0000000000
--- a/Final/python/amqp-doc
+++ /dev/null
@@ -1,78 +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:e", ["regexp", "spec="])
-except GetoptError, e:
- die(str(e))
-
-regexp = False
-spec = "../specs/amqp.0-8.xml"
-for k, v in opts:
- if k == "-e" or k == "--regexp": regexp = True
- if k == "-s" or k == "--spec": spec = 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)
-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/Final/python/cpp_failing.txt b/Final/python/cpp_failing.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/Final/python/cpp_failing.txt
+++ /dev/null
diff --git a/Final/python/doc/test-requirements.txt b/Final/python/doc/test-requirements.txt
deleted file mode 100644
index a1ba414eb2..0000000000
--- a/Final/python/doc/test-requirements.txt
+++ /dev/null
@@ -1,10 +0,0 @@
- * 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/Final/python/java_failing.txt b/Final/python/java_failing.txt
deleted file mode 100644
index e69de29bb2..0000000000
--- a/Final/python/java_failing.txt
+++ /dev/null
diff --git a/Final/python/pal2py b/Final/python/pal2py
deleted file mode 100755
index 544151bf76..0000000000
--- a/Final/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/Final/python/qpid/__init__.py b/Final/python/qpid/__init__.py
deleted file mode 100644
index 4363f175fb..0000000000
--- a/Final/python/qpid/__init__.py
+++ /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.
-#
-
-import spec, codec, connection, content, peer, delegate, client
diff --git a/Final/python/qpid/client.py b/Final/python/qpid/client.py
deleted file mode 100644
index b4a282f251..0000000000
--- a/Final/python/qpid/client.py
+++ /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.
-#
-
-"""
-An AQMP client implementation that uses a custom delegate for
-interacting with the server.
-"""
-
-import threading
-from peer import Peer, Closed
-from delegate import Delegate
-from connection import Connection, Frame
-from spec import load
-from queue import Queue
-
-
-class Client:
-
- def __init__(self, host, port, spec, vhost = None):
- self.host = host
- self.port = port
- self.spec = spec
-
- self.mechanism = None
- self.response = None
- self.locale = None
-
- self.vhost = vhost
- if self.vhost == None:
- self.vhost = self.host
-
- self.queues = {}
- self.lock = threading.Lock()
-
- self.closed = False
- self.started = threading.Event()
-
- self.conn = Connection(self.host, self.port, self.spec)
- self.peer = Peer(self.conn, ClientDelegate(self))
-
- def wait(self):
- self.started.wait()
- if self.closed:
- raise EOFError()
-
- 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"):
- self.mechanism = mechanism
- self.response = response
- self.locale = locale
-
- self.conn.connect()
- self.conn.init()
- self.peer.start()
- self.wait()
- self.channel(0).connection_open(self.vhost)
-
- def channel(self, id):
- return self.peer.channel(id)
-
-class ClientDelegate(Delegate):
-
- def __init__(self, client):
- Delegate.__init__(self)
- self.client = client
-
- def connection_start(self, ch, msg):
- ch.connection_start_ok(mechanism=self.client.mechanism,
- response=self.client.response,
- locale=self.client.locale)
-
- def connection_tune(self, ch, msg):
- ch.connection_tune_ok(*msg.fields)
- self.client.started.set()
-
- def basic_deliver(self, ch, msg):
- self.client.queue(msg.consumer_tag).put(msg)
-
- def channel_close(self, ch, msg):
- ch.close(msg)
-
- def connection_close(self, ch, msg):
- self.client.peer.close(msg)
-
- def close(self, reason):
- self.client.closed = True
- self.client.started.set()
diff --git a/Final/python/qpid/codec.py b/Final/python/qpid/codec.py
deleted file mode 100644
index 69c7ca8afa..0000000000
--- a/Final/python/qpid/codec.py
+++ /dev/null
@@ -1,224 +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.
-"""
-
-from cStringIO import StringIO
-from struct import *
-
-class EOF(Exception):
- pass
-
-class Codec:
-
- def __init__(self, stream):
- self.stream = stream
- self.nwrote = 0
- self.nread = 0
- self.incoming_bits = []
- self.outgoing_bits = []
-
- def read(self, n):
- data = self.stream.read(n)
- if n > 0 and len(data) == 0:
- raise EOF()
- self.nread += len(data)
- return data
-
- def write(self, s):
- self.flushbits()
- self.stream.write(s)
- self.nwrote += len(s)
-
- def flush(self):
- self.flushbits()
- self.stream.flush()
-
- def flushbits(self):
- 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 pack(self, fmt, *args):
- self.write(pack(fmt, *args))
-
- def unpack(self, 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):
- getattr(self, "encode_" + type)(value)
-
- def decode(self, type):
- return getattr(self, "decode_" + type)()
-
- # bit
- def encode_bit(self, o):
- if o:
- self.outgoing_bits.append(True)
- else:
- self.outgoing_bits.append(False)
-
- def decode_bit(self):
- 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)
-
- # octet
- def encode_octet(self, o):
- self.pack("!B", o)
-
- def decode_octet(self):
- return self.unpack("!B")
-
- # short
- def encode_short(self, o):
- self.pack("!H", o)
-
- def decode_short(self):
- return self.unpack("!H")
-
- # long
- def encode_long(self, o):
- self.pack("!L", o)
-
- def decode_long(self):
- return self.unpack("!L")
-
- # longlong
- def encode_longlong(self, o):
- self.pack("!Q", o)
-
- def decode_longlong(self):
- return self.unpack("!Q")
-
- def enc_str(self, fmt, s):
- size = len(s)
- self.pack(fmt, size)
- self.write(s)
-
- def dec_str(self, fmt):
- size = self.unpack(fmt)
- return self.read(size)
-
- # shortstr
- def encode_shortstr(self, s):
- self.enc_str("!B", s)
-
- def decode_shortstr(self):
- return self.dec_str("!B")
-
- # longstr
- def encode_longstr(self, s):
- if isinstance(s, dict):
- self.encode_table(s)
- else:
- self.enc_str("!L", s)
-
- def decode_longstr(self):
- return self.dec_str("!L")
-
- # table
- def encode_table(self, tbl):
- enc = StringIO()
- codec = Codec(enc)
- for key, value in tbl.items():
- codec.encode_shortstr(key)
- if isinstance(value, basestring):
- codec.write("S")
- codec.encode_longstr(value)
- else:
- codec.write("I")
- codec.encode_long(value)
- s = enc.getvalue()
- self.encode_long(len(s))
- self.write(s)
-
- def decode_table(self):
- size = self.decode_long()
- start = self.nread
- result = {}
- while self.nread - start < size:
- key = self.decode_shortstr()
- type = self.read(1)
- if type == "S":
- value = self.decode_longstr()
- elif type == "I":
- value = self.decode_long()
- else:
- raise ValueError(repr(type))
- result[key] = value
- return result
-
-def test(type, value):
- if isinstance(value, (list, tuple)):
- values = value
- else:
- values = [value]
- stream = StringIO()
- codec = Codec(stream)
- 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))
-
-if __name__ == "__main__":
- def dotest(type, value):
- args = (type, value)
- test(*args)
-
- 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)
diff --git a/Final/python/qpid/connection.py b/Final/python/qpid/connection.py
deleted file mode 100644
index 0b788e091b..0000000000
--- a/Final/python/qpid/connection.py
+++ /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.
-#
-
-"""
-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
-from cStringIO import StringIO
-from spec import load, pythonize
-from codec import EOF
-
-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
-
-class Connection:
-
- def __init__(self, host, port, spec):
- self.host = host
- self.port = port
- self.spec = spec
- self.FRAME_END = self.spec.constants.bypyname["frame_end"].id
-
- def connect(self):
- sock = socket.socket()
- sock.connect((self.host, self.port))
- sock.setblocking(1)
- self.codec = codec.Codec(SockIO(sock))
-
- 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 write(self, frame):
- c = self.codec
- c.encode_octet(self.spec.constants.bypyname[frame.payload.type].id)
- c.encode_short(frame.channel)
- frame.payload.encode(c)
- c.encode_octet(self.FRAME_END)
-
- def read(self):
- c = self.codec
- type = pythonize(self.spec.constants.byid[c.decode_octet()].name)
- channel = c.decode_short()
- payload = Frame.DECODERS[type].decode(self.spec, c)
- end = c.decode_octet()
- if end != self.FRAME_END:
- raise "frame error: expected %r, got %r" % (self.FRAME_END, end)
- frame = Frame(channel, payload)
- return frame
-
-class Frame:
-
- METHOD = "frame_method"
- HEADER = "frame_header"
- BODY = "frame_body"
- OOB_METHOD = "frame_oob_method"
- OOB_HEADER = "frame_oob_header"
- OOB_BODY = "frame_oob_body"
- TRACE = "frame_trace"
- HEARTBEAT = "frame_heartbeat"
-
- DECODERS = {}
-
- def __init__(self, channel, payload):
- self.channel = channel
- self.payload = payload
-
- def __str__(self):
- return "[%d] %s" % (self.channel, self.payload)
-
-class Payload:
-
- class __metaclass__(type):
-
- def __new__(cls, name, bases, dict):
- for req in ("encode", "decode", "type"):
- if not dict.has_key(req):
- raise TypeError("%s must define %s" % (name, req))
- dict["decode"] = staticmethod(dict["decode"])
- t = type.__new__(cls, name, bases, dict)
- if t.type != None:
- Frame.DECODERS[t.type] = t
- return t
-
- type = None
-
- def encode(self, enc): abstract
-
- def decode(spec, dec): abstract
-
-class Method(Payload):
-
- type = Frame.METHOD
-
- def __init__(self, method, *args):
- if len(args) != len(method.fields):
- argspec = ["%s: %s" % (pythonize(f.name), f.type)
- for f in method.fields]
- raise TypeError("%s.%s expecting (%s), got %s" %
- (pythonize(method.klass.name),
- pythonize(method.name), ", ".join(argspec), args))
- self.method = method
- self.args = args
-
- def encode(self, enc):
- buf = StringIO()
- c = codec.Codec(buf)
- 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)
- c.flush()
- enc.encode_longstr(buf.getvalue())
-
- def decode(spec, dec):
- enc = dec.decode_longstr()
- c = codec.Codec(StringIO(enc))
- 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" % (self.method, ", ".join([str(a) for a in self.args]))
-
-class Header(Payload):
-
- type = Frame.HEADER
-
- def __init__(self, klass, weight, size, **properties):
- self.klass = klass
- self.weight = weight
- self.size = size
- self.properties = properties
-
- 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, enc):
- buf = StringIO()
- c = codec.Codec(buf)
- 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)
- c.flush()
- enc.encode_longstr(buf.getvalue())
-
- def decode(spec, dec):
- c = codec.Codec(StringIO(dec.decode_longstr()))
- 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)
-
- def __str__(self):
- return "%s %s %s %s" % (self.klass, self.weight, self.size,
- self.properties)
-
-class Body(Payload):
-
- type = Frame.BODY
-
- def __init__(self, content):
- self.content = content
-
- def encode(self, enc):
- enc.encode_longstr(self.content)
-
- def decode(spec, dec):
- return Body(dec.decode_longstr())
-
- def __str__(self):
- return "Body(%r)" % self.content
diff --git a/Final/python/qpid/content.py b/Final/python/qpid/content.py
deleted file mode 100644
index bcbea1697c..0000000000
--- a/Final/python/qpid/content.py
+++ /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.
-#
-
-"""
-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]
diff --git a/Final/python/qpid/delegate.py b/Final/python/qpid/delegate.py
deleted file mode 100644
index 035bb3c476..0000000000
--- a/Final/python/qpid/delegate.py
+++ /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.
-#
-
-"""
-Delegate implementation intended for use with the peer module.
-"""
-
-import threading, inspect
-from spec import pythonize
-
-class Delegate:
-
- def __init__(self):
- self.handlers = {}
- self.invokers = {}
- # initialize all the mixins
- self.invoke_all("init")
-
- def invoke_all(self, meth, *args, **kwargs):
- for cls in inspect.getmro(self.__class__):
- if hasattr(cls, meth):
- getattr(cls, meth)(self, *args, **kwargs)
-
- def dispatch(self, channel, message):
- method = message.method
-
- try:
- handler = self.handlers[method]
- except KeyError:
- name = "%s_%s" % (pythonize(method.klass.name),
- pythonize(method.name))
- handler = getattr(self, name)
- self.handlers[method] = handler
-
- return handler(channel, message)
-
- def close(self, reason):
- self.invoke_all("close", reason)
diff --git a/Final/python/qpid/message.py b/Final/python/qpid/message.py
deleted file mode 100644
index 914b878147..0000000000
--- a/Final/python/qpid/message.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.
-#
-from sets import Set
-
-class Message:
-
- COMMON_FIELDS = Set(("content", "method", "fields"))
-
- def __init__(self, method, fields, content = None):
- self.method = method
- self.fields = fields
- self.content = content
-
- def __len__(self):
- l = len(self.fields)
- if self.method.content:
- l += 1
- return len(self.fields)
-
- 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):
- idx = self._idx(idx)
- if idx == len(self.fields):
- return self.content
- else:
- return self.fields[idx]
-
- def __setitem__(self, idx, value):
- idx = self._idx(idx)
- if idx == len(self.fields):
- self.content = value
- else:
- self.fields[idx] = value
-
- def _slot(self, attr):
- if attr in Message.COMMON_FIELDS:
- env = self.__dict__
- key = attr
- else:
- env = self.fields
- try:
- field = self.method.fields.bypyname[attr]
- key = self.method.fields.index(field)
- except KeyError:
- raise AttributeError(attr)
- return env, key
-
- def __getattr__(self, attr):
- env, key = self._slot(attr)
- return env[key]
-
- def __setattr__(self, attr, value):
- env, key = self._slot(attr)
- env[attr] = value
-
- STR = "%s %s content = %s"
- REPR = STR.replace("%s", "%r")
-
- def __str__(self):
- return Message.STR % (self.method, self.fields, self.content)
-
- def __repr__(self):
- return Message.REPR % (self.method, self.fields, self.content)
diff --git a/Final/python/qpid/peer.py b/Final/python/qpid/peer.py
deleted file mode 100644
index 7c6cf91dea..0000000000
--- a/Final/python/qpid/peer.py
+++ /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.
-#
-
-"""
-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, traceback, socket, sys, logging
-from connection import Frame, EOF, Method, Header, Body
-from message import Message
-from queue import Queue, Closed as QueueClosed
-from content import Content
-from cStringIO import StringIO
-
-class Peer:
-
- def __init__(self, conn, delegate):
- self.conn = conn
- self.delegate = delegate
- self.outgoing = Queue(0)
- self.work = Queue(0)
- self.channels = {}
- self.Channel = type("Channel%s" % conn.spec.klass.__name__,
- (Channel, conn.spec.klass), {})
- self.lock = thread.allocate_lock()
-
- def channel(self, id):
- self.lock.acquire()
- try:
- try:
- ch = self.channels[id]
- except KeyError:
- ch = self.Channel(id, self.outgoing)
- 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.close("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.dispatch(frame, self.work)
- except:
- self.fatal()
-
- def close(self, reason):
- for ch in self.channels.values():
- ch.close(reason)
- self.delegate.close(reason)
-
- def writer(self):
- try:
- while True:
- try:
- message = self.outgoing.get()
- self.conn.write(message)
- except socket.error, e:
- self.close(e)
- break
- self.conn.flush()
- except:
- self.fatal()
-
- def worker(self):
- try:
- while True:
- self.dispatch(self.work.get())
- except QueueClosed, e:
- self.close(e)
- except:
- self.fatal()
-
- def dispatch(self, queue):
- frame = queue.get()
- channel = self.channel(frame.channel)
- payload = frame.payload
- if payload.method.content:
- content = read_content(queue)
- else:
- content = None
- # Let the caller deal with exceptions thrown here.
- message = Message(payload.method, payload.args, content)
- self.delegate.dispatch(channel, message)
-
-class Closed(Exception): pass
-
-class Channel:
-
- def __init__(self, id, outgoing):
- self.id = id
- self.outgoing = outgoing
- self.incoming = Queue(0)
- self.responses = Queue(0)
- self.queue = None
- self.closed = False
- self.reason = None
-
- def close(self, reason):
- if self.closed:
- return
- self.closed = True
- self.reason = reason
- self.incoming.close()
- self.responses.close()
-
- def dispatch(self, frame, work):
- payload = frame.payload
- if isinstance(payload, Method):
- if payload.method.response:
- self.queue = self.responses
- else:
- self.queue = self.incoming
- work.put(self.incoming)
- self.queue.put(frame)
-
- def invoke(self, method, args, content = None):
- if self.closed:
- raise Closed(self.reason)
- frame = Frame(self.id, Method(method, *args))
- self.outgoing.put(frame)
-
- if method.content:
- if content == None:
- content = Content()
- self.write_content(method.klass, content, self.outgoing)
-
- try:
- # here we depend on all nowait fields being named nowait
- f = method.fields.byname["nowait"]
- nowait = args[method.fields.index(f)]
- except KeyError:
- nowait = False
-
- try:
- if not nowait and method.responses:
- resp = self.responses.get().payload
- if resp.method.content:
- content = read_content(self.responses)
- else:
- content = None
- if resp.method in method.responses:
- return Message(resp.method, resp.args, content)
- else:
- raise ValueError(resp)
- except QueueClosed, e:
- if self.closed:
- raise Closed(self.reason)
- else:
- raise e
-
- def write_content(self, klass, content, queue):
- size = content.size()
- header = Frame(self.id, Header(klass, content.weight(), size, **content.properties))
- queue.put(header)
- for child in content.children:
- self.write_content(klass, child, queue)
- # should split up if content.body exceeds max frame size
- if size > 0:
- queue.put(Frame(self.id, Body(content.body)))
-
-def read_content(queue):
- frame = queue.get()
- header = frame.payload
- children = []
- for i in range(header.weight):
- children.append(read_content(queue))
- size = header.size
- read = 0
- buf = StringIO()
- while read < size:
- body = queue.get()
- content = body.payload.content
- buf.write(content)
- read += len(content)
- return Content(buf.getvalue(), children, header.properties.copy())
diff --git a/Final/python/qpid/queue.py b/Final/python/qpid/queue.py
deleted file mode 100644
index 5438b328ab..0000000000
--- a/Final/python/qpid/queue.py
+++ /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 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
-
-class Closed(Exception): pass
-
-class Queue(BaseQueue):
-
- END = object()
-
- def close(self):
- self.put(Queue.END)
-
- 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()
- else:
- return result
diff --git a/Final/python/qpid/spec.py b/Final/python/qpid/spec.py
deleted file mode 100644
index 0e3a477066..0000000000
--- a/Final/python/qpid/spec.py
+++ /dev/null
@@ -1,358 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT 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, textwrap, new, xmlutil
-
-class SpecContainer:
-
- def __init__(self):
- self.items = []
- self.byname = {}
- self.byid = {}
- self.indexes = {}
- self.bypyname = {}
-
- def add(self, item):
- if self.byname.has_key(item.name):
- raise ValueError("duplicate name: %s" % item)
- if self.byid.has_key(item.id):
- raise ValueError("duplicate id: %s" % item)
- pyname = pythonize(item.name)
- if self.bypyname.has_key(pyname):
- raise ValueError("duplicate pyname: %s" % item)
- self.indexes[item] = len(self.items)
- self.items.append(item)
- self.byname[item.name] = item
- self.byid[item.id] = item
- self.bypyname[pyname] = 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.classes = SpecContainer()
-
- 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 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 define_module(self, name, doc = None):
- module = new.module(name, doc)
- module.__file__ = self.file
- for c in self.classes:
- classname = pythonize(c.name)
- cls = c.define_class(classname)
- cls.__module__ = module.__name__
- setattr(module, classname, cls)
- return module
-
- def define_class(self, name):
- methods = {}
- for c in self.classes:
- for m in c.methods:
- meth = pythonize(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 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:
- meth = pythonize(m.name)
- methods[meth] = m.define_method(meth)
- return type(name, (), methods)
-
-class Method(Metadata):
-
- PRINT=["name", "id"]
-
- def __init__(self, klass, name, id, content, responses, synchronous,
- description, docs):
- Metadata.__init__(self)
- self.klass = klass
- self.name = name
- self.id = id
- self.content = content
- self.responses = responses
- self.synchronous = synchronous
- self.fields = SpecContainer()
- self.description = description
- self.docs = docs
- self.response = False
-
- 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, pythonize(f.name))] +
- [fill(d, 4) for d in f.docs[1:]])
- return s
-
- METHOD = "__method__"
- DEFAULTS = {"bit": False,
- "shortstr": "",
- "longstr": "",
- "table": {},
- "octet": 0,
- "short": 0,
- "long": 0,
- "longlong": 0,
- "timestamp": 0,
- "content": None}
-
- def define_method(self, name):
- g = {Method.METHOD: self}
- l = {}
- args = [(pythonize(f.name), Method.DEFAULTS[f.type]) for f in self.fields]
- 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()
- if self.content:
- methargs = args[:-1]
- else:
- methargs = args
- 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, docs):
- Metadata.__init__(self)
- self.name = name
- self.id = id
- self.type = type
- self.docs = docs
-
-def get_docs(nd):
- return [n.text for n in nd["doc"]]
-
-def load_fields(nd, l, domains):
- for f_nd in nd["field"]:
- try:
- type = f_nd["@domain"]
- except KeyError:
- type = f_nd["@type"]
- while domains.has_key(type) and domains[type] != type:
- type = domains[type]
- l.add(Field(f_nd["@name"], f_nd.index(), type, get_docs(f_nd)))
-
-def load(specfile):
- doc = xmlutil.parse(specfile)
- root = doc["amqp"][0]
- spec = Spec(int(root["@major"]), int(root["@minor"]), specfile)
-
- # constants
- for nd in root["constant"]:
- const = Constant(spec, nd["@name"], int(nd["@value"]), nd.get("@class"),
- get_docs(nd))
- spec.constants.add(const)
-
- # domains are typedefs
- domains = {}
- for nd in root["domain"]:
- domains[nd["@name"]] = nd["@type"]
-
- # classes
- for c_nd in root["class"]:
- klass = Class(spec, c_nd["@name"], int(c_nd["@index"]), c_nd["@handler"],
- get_docs(c_nd))
- load_fields(c_nd, klass.fields, domains)
- for m_nd in c_nd["method"]:
- meth = Method(klass, m_nd["@name"],
- int(m_nd["@index"]),
- m_nd.get_bool("@content", False),
- [nd["@name"] for nd in m_nd["response"]],
- m_nd.get_bool("@synchronous", False),
- m_nd.text,
- get_docs(m_nd))
- load_fields(m_nd, meth.fields, domains)
- klass.methods.add(meth)
- # resolve the responses
- for m in klass.methods:
- m.responses = [klass.methods.byname[r] for r in m.responses]
- for resp in m.responses:
- resp.response = True
- spec.classes.add(klass)
- 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
-
-def fill(text, indent, heading = None):
- sub = indent * " "
- if heading:
- init = (indent - 2) * " " + heading + " -- "
- else:
- init = sub
- w = textwrap.TextWrapper(initial_indent = init, subsequent_indent = sub)
- return w.fill(" ".join(text.split()))
-
-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/Final/python/qpid/testlib.py b/Final/python/qpid/testlib.py
deleted file mode 100644
index 39bad75b86..0000000000
--- a/Final/python/qpid/testlib.py
+++ /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.
-#
-
-#
-# Support library for qpid python tests.
-#
-
-import sys, re, unittest, os, random, logging
-import qpid.client, qpid.spec
-import Queue
-from getopt import getopt, GetoptError
-from qpid.content import Content
-
-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:
- """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> : file containing amqp XML spec
- -b/--broker [<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.
- """
- sys.exit(1)
-
- def setBroker(self, broker):
- rex = re.compile(r"""
- # [ <user> [ / <password> ] @] <host> [ :<port> ]
- ^ (?: ([^/]*) (?: / ([^@]*) )? @)? ([^:]+) (?: :([0-9]+))?$""", re.X)
- match = rex.match(broker)
- if not match: self._die("'%s' is not a valid broker" % (broker))
- self.user, self.password, self.host, self.port = match.groups()
- self.port = int(default(self.port, 5672))
- self.user = default(self.user, "guest")
- self.password = default(self.password, "guest")
-
- def __init__(self):
- # Defaults
- self.setBroker("localhost")
- self.spec = "../specs/amqp.0-8.xml"
- self.verbose = 1
- self.ignore = []
-
- def ignoreFile(self, filename):
- f = file(filename)
- for line in f.readlines(): self.ignore.append(line.strip())
- f.close()
-
- def _parseargs(self, args):
- try:
- opts, self.tests = getopt(args, "s:b:h?dvi:I:", ["help", "spec", "server", "verbose", "ignore", "ignore-file"])
- 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.spec = 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 len(self.tests) == 0: self.tests=findmodules("tests")
-
- def testSuite(self):
- class IgnoringTestSuite(unittest.TestSuite):
- def addTest(self, test):
- if isinstance(test, unittest.TestCase) and test.id() in testrunner.ignore:
- 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):
- """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, qpid.spec.load(spec))
- client.start({"LOGIN": user, "PASSWORD": password})
- return client
-
-
-# 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.channel.channel_open()
-
- def tearDown(self):
- for ch, q in self.queues:
- ch.queue_delete(queue=q)
- for ch, ex in self.exchanges:
- ch.exchange_delete(exchange=ex)
-
- 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, reply.queue))
- return reply
-
- def exchange_declare(self, channel=None, ticket=0, exchange='',
- type='', passive=False, durable=False,
- auto_delete=False, internal=False, nowait=False,
- arguments={}):
- channel = channel or self.channel
- reply = channel.exchange_declare(ticket, exchange, type, passive, durable, auto_delete, internal, nowait, 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."""
- reply = self.channel.basic_consume(queue=queueName, no_ack=True)
- return self.client.queue(reply.consumer_tag)
-
- 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()
- self.channel.basic_publish(exchange=exchange,
- content=Content(body, properties=properties),
- routing_key=routing_key)
- msg = queue.get(timeout=1)
- self.assertEqual(body, msg.content.body)
- if (properties): self.assertEqual(properties, msg.content.properties)
-
- 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):
- self.assertEqual("channel", message.method.klass.name)
- self.assertEqual("close", message.method.name)
- self.assertEqual(expectedCode, message.reply_code)
-
-
- def assertConnectionException(self, expectedCode, message):
- self.assertEqual("connection", message.method.klass.name)
- self.assertEqual("close", message.method.name)
- self.assertEqual(expectedCode, message.reply_code)
-
diff --git a/Final/python/qpid/xmlutil.py b/Final/python/qpid/xmlutil.py
deleted file mode 100644
index 585516b44f..0000000000
--- a/Final/python/qpid/xmlutil.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.
-#
-
-"""
-XML utilities used by spec.py
-"""
-
-import xml.sax
-from xml.sax.handler import ContentHandler
-
-def parse(file):
- doc = Node("root")
- xml.sax.parse(file, Builder(doc))
- return doc
-
-class Node:
-
- def __init__(self, name, attrs = None, text = None, parent = None):
- self.name = name
- self.attrs = attrs
- self.text = text
- self.parent = parent
- self.children = []
- if parent != None:
- parent.children.append(self)
-
- def get_bool(self, key, default = False):
- v = self.get(key)
- if v == None:
- return default
- else:
- return bool(int(v))
-
- def index(self):
- if self.parent:
- return self.parent.children.index(self)
- else:
- return 0
-
- def has(self, key):
- try:
- result = self[key]
- return True
- except KeyError:
- return False
- except IndexError:
- return False
-
- def get(self, key, default = None):
- if self.has(key):
- return self[key]
- else:
- return default
-
- def __getitem__(self, key):
- if callable(key):
- return filter(key, self.children)
- else:
- t = key.__class__
- meth = "__get%s__" % t.__name__
- if hasattr(self, meth):
- return getattr(self, meth)(key)
- else:
- raise KeyError(key)
-
- def __getstr__(self, name):
- if name[:1] == "@":
- return self.attrs[name[1:]]
- else:
- return self[lambda nd: nd.name == name]
-
- def __getint__(self, index):
- return self.children[index]
-
- def __iter__(self):
- return iter(self.children)
-
- def path(self):
- if self.parent == None:
- return "/%s" % self.name
- else:
- return "%s/%s" % (self.parent.path(), self.name)
-
-class Builder(ContentHandler):
-
- def __init__(self, start = None):
- self.node = start
-
- def __setitem__(self, element, type):
- self.types[element] = type
-
- def startElement(self, name, attrs):
- self.node = Node(name, attrs, None, self.node)
-
- def endElement(self, name):
- self.node = self.node.parent
-
- def characters(self, content):
- if self.node.text == None:
- self.node.text = content
- else:
- self.node.text += content
-
diff --git a/Final/python/rule2test b/Final/python/rule2test
deleted file mode 100755
index 10f151366e..0000000000
--- a/Final/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/Final/python/run-tests b/Final/python/run-tests
deleted file mode 100755
index 90c0200d01..0000000000
--- a/Final/python/run-tests
+++ /dev/null
@@ -1,27 +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 testrunner
-
-if not testrunner.run(): sys.exit(1)
-
-
-
diff --git a/Final/python/setup.py b/Final/python/setup.py
deleted file mode 100644
index a49fa6ca51..0000000000
--- a/Final/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/Final/python/tests/__init__.py b/Final/python/tests/__init__.py
deleted file mode 100644
index 9a09d2d04f..0000000000
--- a/Final/python/tests/__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/Final/python/tests/basic.py b/Final/python/tests/basic.py
deleted file mode 100644
index bbbfa8ebf9..0000000000
--- a/Final/python/tests/basic.py
+++ /dev/null
@@ -1,431 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT 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"))
-
- #cancel should stop messages being delivered
- channel.basic_cancel(consumer_tag="my-consumer")
- channel.basic_publish(routing_key="test-queue-4", content=Content("Two"))
- myqueue = self.client.queue("my-consumer")
- msg = myqueue.get(timeout=1)
- self.assertEqual("One", msg.content.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.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) with persistent messaging
- for i in range(1, 11):
- msg=Content("Message %d" % i)
- msg["delivery mode"] = 2
- channel.basic_publish(routing_key="test-get",content=msg )
-
- #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")
-
-
- #publish some messages (no_ack=True) transient messaging
- for i in range(11, 21):
- 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(11, 21):
- 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
-
- #publish some messages (no_ack=False) with persistent messaging
- for i in range(21, 31):
- msg=Content("Message %d" % i)
- msg["delivery mode"] = 2
- channel.basic_publish(routing_key="test-get",content=msg )
-
- #use basic_get to read back the messages, and check that we get an empty at the end
- for i in range(21, 31):
- 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)
-
- reply = channel.basic_get(no_ack=True)
- self.assertEqual(reply.method.klass.name, "basic")
- self.assertEqual(reply.method.name, "get-empty")
-
- #public some messages (no_ack=False) with transient messaging
- for i in range(31, 41):
- channel.basic_publish(routing_key="test-get", content=Content("Message %d" % i))
-
- for i in range(31, 41):
- 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 == 33):
- channel.basic_ack(delivery_tag=reply.delivery_tag, multiple=True)
- if(i in [35, 37, 39]):
- 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 (34, 36, 38, 40)
- for i in [34, 36, 38, 40]:
- 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/Final/python/tests/broker.py b/Final/python/tests/broker.py
deleted file mode 100644
index 90009b6847..0000000000
--- a/Final/python/tests/broker.py
+++ /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.
-#
-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])
-
- def test_channel_flow(self):
- channel = self.channel
- channel.queue_declare(queue="flow_test_queue", exclusive=True)
- channel.basic_consume(consumer_tag="my-tag", queue="flow_test_queue")
- incoming = self.client.queue("my-tag")
-
- channel.channel_flow(active=False)
- channel.basic_publish(routing_key="flow_test_queue", content=Content("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.content.body)
-
-
diff --git a/Final/python/tests/example.py b/Final/python/tests/example.py
deleted file mode 100644
index bc84f002e0..0000000000
--- a/Final/python/tests/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/Final/python/tests/exchange.py b/Final/python/tests/exchange.py
deleted file mode 100644
index 56d6fa82e4..0000000000
--- a/Final/python/tests/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/Final/python/tests/queue.py b/Final/python/tests/queue.py
deleted file mode 100644
index 60ac4c3dfb..0000000000
--- a/Final/python/tests/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/Final/python/tests/testlib.py b/Final/python/tests/testlib.py
deleted file mode 100644
index cab07cc4ac..0000000000
--- a/Final/python/tests/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/Final/python/tests/tx.py b/Final/python/tests/tx.py
deleted file mode 100644
index 054fb8d8b7..0000000000
--- a/Final/python/tests/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/Final/ruby/LICENSE.txt b/Final/ruby/LICENSE.txt
deleted file mode 100755
index 6b0b1270ff..0000000000
--- a/Final/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/Final/ruby/NOTICE.txt b/Final/ruby/NOTICE.txt
deleted file mode 100644
index fff2bca45c..0000000000
--- a/Final/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/Final/ruby/RELEASE_NOTES b/Final/ruby/RELEASE_NOTES
deleted file mode 100644
index 5ea0bd8eec..0000000000
--- a/Final/ruby/RELEASE_NOTES
+++ /dev/null
@@ -1,19 +0,0 @@
-Apache Incubator Qpid Ruby M2 Release Notes
----------------------------------------------
-
-The Qpid M2 release contains support the for AMQP 0-8 specification.
-You can access the 0-8 specification using the following link.
-http://www.amqp.org/tikiwiki/tiki-index.php?page=Download
-
-For full details of Qpid capabilities, as they currently stand, see our
-detailed 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.
-
-
-Known Issues/Outstanding Work
------------------------------
-
-Bug QPID-467 Complete Interop Testing
diff --git a/Final/ruby/qpid.rb b/Final/ruby/qpid.rb
deleted file mode 100644
index 25cd26f362..0000000000
--- a/Final/ruby/qpid.rb
+++ /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.
-#
-
-require "qpid/client"
-require "qpid/queue"
-require "qpid/codec"
-require "qpid/connection"
-require "qpid/peer"
-require "qpid/spec"
diff --git a/Final/ruby/qpid/client.rb b/Final/ruby/qpid/client.rb
deleted file mode 100644
index f10f2e564b..0000000000
--- a/Final/ruby/qpid/client.rb
+++ /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.
-#
-
-require "thread"
-require "qpid/peer"
-require "qpid/queue"
-
-module Qpid
-
- 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/Final/ruby/qpid/codec.rb b/Final/ruby/qpid/codec.rb
deleted file mode 100644
index 8d80e10aee..0000000000
--- a/Final/ruby/qpid/codec.rb
+++ /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.
-#
-
-module Codec
- # 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 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 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/Final/ruby/qpid/connection.rb b/Final/ruby/qpid/connection.rb
deleted file mode 100644
index f6ee9cf1e4..0000000000
--- a/Final/ruby/qpid/connection.rb
+++ /dev/null
@@ -1,254 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT 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/codec"
-
-include Codec
-
-module Qpid
-
- 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/Final/ruby/qpid/fields.rb b/Final/ruby/qpid/fields.rb
deleted file mode 100644
index 91484af850..0000000000
--- a/Final/ruby/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 ArgumentException.new("extra arguments: #{args}")
- 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/Final/ruby/qpid/peer.rb b/Final/ruby/qpid/peer.rb
deleted file mode 100644
index 320808fdc6..0000000000
--- a/Final/ruby/qpid/peer.rb
+++ /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.
-#
-
-require "thread"
-require "qpid/queue"
-require "qpid/connection"
-require "qpid/fields"
-
-module Qpid
-
- 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()
- @outgoing.close()
- @work.close()
- end
- 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.pop())
- end
- end
-
- def worker()
- while true
- dispatch(@work.pop())
- end
- end
-
- def dispatch(queue)
- frame = queue.pop()
- ch = channel(frame.channel)
- payload = frame.payload
- if payload.method.content?
- content = Qpid::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.pop().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 Qpid.read_content(queue)
- frame = queue.pop()
- header = frame.payload
- children = []
- 1.upto(header.weight) { children << read_content(queue) }
- size = header.size
- read = 0
- buf = ""
- while read < size
- body = queue.pop()
- 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/Final/ruby/qpid/queue.rb b/Final/ruby/qpid/queue.rb
deleted file mode 100644
index 350310882f..0000000000
--- a/Final/ruby/qpid/queue.rb
+++ /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.
-#
-
-require "thread"
-
-module Qpid
-
- class Closed < Exception; end
-
- class Queue < Queue
-
- @@END = Object.new()
-
- def close()
- # sentinal to indicate the end of the queue
- self << @@END
- end
-
- def pop(*args)
- result = super(*args)
- if @@END.equal? result
- # we put another sentinal on the end in case there are
- # subsequent calls to pop by this or other threads
- self << @@END
- raise Closed.new()
- else
- return result
- end
- end
-
- alias shift pop
- alias deq pop
-
- end
-
-end
diff --git a/Final/ruby/qpid/spec.rb b/Final/ruby/qpid/spec.rb
deleted file mode 100644
index 9a04f584d0..0000000000
--- a/Final/ruby/qpid/spec.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 "set"
-require "rexml/document"
-require "qpid/fields"
-require "qpid/traverse"
-
-module Spec
-
- include REXML
-
- class Container < Array
-
- def initialize()
- @cache = {}
- end
-
- def [](key)
- return @cache[key] if @cache.include?(key)
-
- case key
- when String
- value = find {|x| x.name == key.intern()}
- when Symbol
- value = find {|x| x.name == key}
- when Integer
- value = find {|x| x.id == key}
- else
- raise Exception.new("invalid key: #{key}")
- end
-
- @cache[key] = value
- return value
- end
-
- end
-
- 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 Reference
-
- fields(:name)
-
- def init(&block)
- @resolver = block
- end
-
- def resolve(spec, klass)
- @resolver.call(spec, klass)
- end
-
- end
-
- class Loader
-
- def initialize()
- @stack = []
- end
-
- def load(obj)
- case obj
- when String
- elem = @stack[-1]
- result = Container.new()
- 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)
- value = element.attributes[name]
- value = value.strip() unless value.nil?
- value = nil unless value.nil? or value.any?
- if value.nil? and not default.nil? then
- default
- else
- send(:"parse_#{type}", value)
- end
- end
-
- def parse_int(value)
- value.to_i
- 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
-
- def parse_name(value)
- value.gsub(/[\s-]/, '_').intern() unless value.nil?
- 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 Spec.load(spec)
- case spec
- when String
- spec = File.new(spec)
- end
- doc = Document.new(spec)
- spec = Loader.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
- spec
- end
-
-end
diff --git a/Final/ruby/qpid/test.rb b/Final/ruby/qpid/test.rb
deleted file mode 100644
index f8107143ab..0000000000
--- a/Final/ruby/qpid/test.rb
+++ /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.
-#
-#/
-
-require "qpid/spec"
-require "qpid/client"
-
-module Qpid
-
- 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/Final/ruby/qpid/traverse.rb b/Final/ruby/qpid/traverse.rb
deleted file mode 100644
index 67358a7eb1..0000000000
--- a/Final/ruby/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/Final/ruby/run-tests b/Final/ruby/run-tests
deleted file mode 100755
index b4c51a75ed..0000000000
--- a/Final/ruby/run-tests
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/ruby
-
-require "tests/channel"
-require "tests/basic"
diff --git a/Final/ruby/tests/basic.rb b/Final/ruby/tests/basic.rb
deleted file mode 100644
index 0018050fe2..0000000000
--- a/Final/ruby/tests/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 Qpid::Test
-
- def publish(body, headers = {})
- cli = connect()
- ch = cli.channel(1)
- ch.channel_open()
- content = Qpid::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 = Qpid::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/Final/ruby/tests/channel.rb b/Final/ruby/tests/channel.rb
deleted file mode 100644
index 31c5f19d92..0000000000
--- a/Final/ruby/tests/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 Qpid::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/Final/specs/amqp.0-8.xml b/Final/specs/amqp.0-8.xml
deleted file mode 100644
index bfb9ee4658..0000000000
--- a/Final/specs/amqp.0-8.xml
+++ /dev/null
@@ -1,3996 +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="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>
-
- <method name="bound" synchronous="1" index="22">
- <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"/>
- </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/Final/specs/amqp.0-9.xml b/Final/specs/amqp.0-9.xml
deleted file mode 100644
index 9d1b488c03..0000000000
--- a/Final/specs/amqp.0-9.xml
+++ /dev/null
@@ -1,5185 +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>
- </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>
-
- <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>
- 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>
- </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/Final/specs/cluster.0-8.xml b/Final/specs/cluster.0-8.xml
deleted file mode 100644
index 09e8ca0787..0000000000
--- a/Final/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="8" minor="0" 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/Final/specs/cluster.0-9.xml b/Final/specs/cluster.0-9.xml
deleted file mode 100644
index 142e6c9380..0000000000
--- a/Final/specs/cluster.0-9.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>