From: Michael Barker Date: Wed, 23 Jun 2010 21:39:05 +0000 (-0000) Subject: 2010-06-23: Michael Barker X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=48eb257d5c0dd1156831056ba71de5a1caebf6c5;p=mono.git 2010-06-23: Michael Barker * Upgrade to RabbitMQ.Client 1.8. svn path=/trunk/mcs/; revision=159465 --- diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/ChangeLog b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/ChangeLog index c55a640041a..d977d8de291 100644 --- a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/ChangeLog +++ b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/ChangeLog @@ -1,3 +1,8 @@ +2010-06-23 Michael Barker + + * RabbitMQMessageQueue.cs: Modified to support RabbitMQ 1.8 + * RabbitMQMessageEnumerator.cs: Modified to support RabbitMQ 1.8 + 2009-07-14 Michael Barker * RabbitMQMessageQueue.cs: Refactored, removed dead code and renamed methods. diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessageEnumerator.cs b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessageEnumerator.cs index 1a05d371465..c96c62f82fa 100644 --- a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessageEnumerator.cs +++ b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessageEnumerator.cs @@ -105,7 +105,8 @@ namespace Mono.Messaging.RabbitMQ { get { if (cn == null) { ConnectionFactory cf = new ConnectionFactory (); - cn = cf.CreateConnection (qRef.Host); + cf.Address = qRef.Host; + cn = cf.CreateConnection (); } if (model == null) { diff --git a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessageQueue.cs b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessageQueue.cs index b2d1f2fc9b0..588ceca263b 100644 --- a/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessageQueue.cs +++ b/mcs/class/Mono.Messaging.RabbitMQ/Mono.Messaging.RabbitMQ/RabbitMQMessageQueue.cs @@ -196,9 +196,7 @@ namespace Mono.Messaging.RabbitMQ { public static void Delete (QueueReference qRef) { - ConnectionFactory cf = new ConnectionFactory (); - - using (IConnection cn = cf.CreateConnection (qRef.Host)) { + using (IConnection cn = CreateConnection (qRef)) { using (IModel model = cn.CreateModel ()) { model.QueueDelete (qRef.Queue, false, false, false); } @@ -213,10 +211,8 @@ namespace Mono.Messaging.RabbitMQ { if (msg.BodyStream == null) throw new ArgumentException ("Message is not serialized properly"); - ConnectionFactory cf = new ConnectionFactory (); - try { - using (IConnection cn = cf.CreateConnection (QRef.Host)) { + using (IConnection cn = CreateConnection (QRef)) { SetDeliveryInfo (msg, GetVersion (cn), null); using (IModel ch = cn.CreateModel ()) { Send (ch, msg); @@ -272,10 +268,8 @@ namespace Mono.Messaging.RabbitMQ { else if (host != QRef.Host) throw new MonoMessagingException ("Transactions can not span multiple hosts"); - if (cn == null) { - ConnectionFactory cf = new ConnectionFactory (); - cn = cf.CreateConnection (host); - } + if (cn == null) + cn = CreateConnection (QRef); if (model == null) { model = cn.CreateModel (); @@ -298,9 +292,7 @@ namespace Mono.Messaging.RabbitMQ { public void Purge () { - ConnectionFactory cf = new ConnectionFactory (); - - using (IConnection cn = cf.CreateConnection (QRef.Host)) { + using (IConnection cn = CreateConnection (QRef)) { using (IModel model = cn.CreateModel ()) { model.QueuePurge (QRef.Queue, false); } @@ -309,9 +301,7 @@ namespace Mono.Messaging.RabbitMQ { public IMessage Peek () { - ConnectionFactory cf = new ConnectionFactory (); - - using (IConnection cn = cf.CreateConnection (QRef.Host)) { + using (IConnection cn = CreateConnection (QRef)) { using (IModel ch = cn.CreateModel ()) { return Receive (ch, -1, false); } @@ -488,8 +478,7 @@ namespace Mono.Messaging.RabbitMQ { private IMessage Run (RecieveDelegate r) { - ConnectionFactory cf = new ConnectionFactory (); - using (IConnection cn = cf.CreateConnection (QRef.Host)) { + using (IConnection cn = CreateConnection (QRef)) { using (IModel model = cn.CreateModel ()) { return r (this, model); } @@ -514,10 +503,8 @@ namespace Mono.Messaging.RabbitMQ { else if (host != q.QRef.Host) throw new MonoMessagingException ("Transactions can not span multiple hosts"); - if (cn == null) { - ConnectionFactory cf = new ConnectionFactory (); - cn = cf.CreateConnection (host); - } + if (cn == null) + cn = CreateConnection (q.QRef); if (model == null) { model = cn.CreateModel (); @@ -679,6 +666,13 @@ namespace Mono.Messaging.RabbitMQ { private RabbitMQMessageQueueTransaction GetTx () { return (RabbitMQMessageQueueTransaction) provider.CreateMessageQueueTransaction (); + } + + private static IConnection CreateConnection (QueueReference qRef) + { + ConnectionFactory cf = new ConnectionFactory (); + cf.Address = qRef.Host; + return cf.CreateConnection (); } } } diff --git a/mcs/class/RabbitMQ.Client/ChangeLog b/mcs/class/RabbitMQ.Client/ChangeLog index 38b25b8f6b5..beade138412 100644 --- a/mcs/class/RabbitMQ.Client/ChangeLog +++ b/mcs/class/RabbitMQ.Client/ChangeLog @@ -1,3 +1,7 @@ +2010-06-23 Michael Barker + + * Updated to version 1.8 of the RabbitMQ libraries + 2009-12-23 Jo Shields * docs/specs/Makefile: Use compiled Mono, not system Mono (fixes diff --git a/mcs/class/RabbitMQ.Client/src/apigen/AmqpClass.cs b/mcs/class/RabbitMQ.Client/src/apigen/AmqpClass.cs index 0e1c454af0d..369994400c2 100644 --- a/mcs/class/RabbitMQ.Client/src/apigen/AmqpClass.cs +++ b/mcs/class/RabbitMQ.Client/src/apigen/AmqpClass.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/apigen/AmqpEntity.cs b/mcs/class/RabbitMQ.Client/src/apigen/AmqpEntity.cs index b71c13cde21..f46f31eaebd 100644 --- a/mcs/class/RabbitMQ.Client/src/apigen/AmqpEntity.cs +++ b/mcs/class/RabbitMQ.Client/src/apigen/AmqpEntity.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/apigen/AmqpField.cs b/mcs/class/RabbitMQ.Client/src/apigen/AmqpField.cs index b69aef194c5..414c821a996 100644 --- a/mcs/class/RabbitMQ.Client/src/apigen/AmqpField.cs +++ b/mcs/class/RabbitMQ.Client/src/apigen/AmqpField.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/apigen/AmqpMethod.cs b/mcs/class/RabbitMQ.Client/src/apigen/AmqpMethod.cs index c21aecc8536..29b872a7281 100644 --- a/mcs/class/RabbitMQ.Client/src/apigen/AmqpMethod.cs +++ b/mcs/class/RabbitMQ.Client/src/apigen/AmqpMethod.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/apigen/Apigen.cs b/mcs/class/RabbitMQ.Client/src/apigen/Apigen.cs index bf0fbb45c6f..5539fea5854 100644 --- a/mcs/class/RabbitMQ.Client/src/apigen/Apigen.cs +++ b/mcs/class/RabbitMQ.Client/src/apigen/Apigen.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -347,6 +347,63 @@ namespace RabbitMQ.Client.Apigen { public void EmitPrelude() { EmitLine("// Autogenerated code. Do not edit."); EmitLine(""); + EmitLine("// This source code is dual-licensed under the Apache License, version"); + EmitLine("// 2.0, and the Mozilla Public License, version 1.1."); + EmitLine("//"); + EmitLine("// The APL v2.0:"); + EmitLine("//"); + EmitLine("//---------------------------------------------------------------------------"); + EmitLine("// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial"); + EmitLine("// Technologies LLC., and Rabbit Technologies Ltd."); + EmitLine("//"); + EmitLine("// Licensed under the Apache License, Version 2.0 (the \"License\");"); + EmitLine("// you may not use this file except in compliance with the License."); + EmitLine("// You may obtain a copy of the License at"); + EmitLine("//"); + EmitLine("// http://www.apache.org/licenses/LICENSE-2.0"); + EmitLine("//"); + EmitLine("// Unless required by applicable law or agreed to in writing, software"); + EmitLine("// distributed under the License is distributed on an \"AS IS\" BASIS,"); + EmitLine("// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied."); + EmitLine("// See the License for the specific language governing permissions and"); + EmitLine("// limitations under the License."); + EmitLine("//---------------------------------------------------------------------------"); + EmitLine("//"); + EmitLine("// The MPL v1.1:"); + EmitLine("//"); + EmitLine("//---------------------------------------------------------------------------"); + EmitLine("// The contents of this file are subject to the Mozilla Public License"); + EmitLine("// Version 1.1 (the \"License\"); you may not use this file except in"); + EmitLine("// compliance with the License. You may obtain a copy of the License at"); + EmitLine("// http://www.rabbitmq.com/mpl.html"); + EmitLine("//"); + EmitLine("// Software distributed under the License is distributed on an \"AS IS\""); + EmitLine("// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the"); + EmitLine("// License for the specific language governing rights and limitations"); + EmitLine("// under the License."); + EmitLine("//"); + EmitLine("// The Original Code is The RabbitMQ .NET Client."); + EmitLine("//"); + EmitLine("// The Initial Developers of the Original Code are LShift Ltd,"); + EmitLine("// Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd."); + EmitLine("//"); + EmitLine("// Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,"); + EmitLine("// Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd"); + EmitLine("// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial"); + EmitLine("// Technologies LLC, and Rabbit Technologies Ltd."); + EmitLine("//"); + EmitLine("// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift"); + EmitLine("// Ltd. Portions created by Cohesive Financial Technologies LLC are"); + EmitLine("// Copyright (C) 2007-2010 Cohesive Financial Technologies"); + EmitLine("// LLC. Portions created by Rabbit Technologies Ltd are Copyright"); + EmitLine("// (C) 2007-2010 Rabbit Technologies Ltd."); + EmitLine("//"); + EmitLine("// All Rights Reserved."); + EmitLine("//"); + EmitLine("// Contributor(s): ______________________________________."); + EmitLine("//"); + EmitLine("//---------------------------------------------------------------------------"); + EmitLine(""); EmitLine("using RabbitMQ.Client;"); EmitLine("using RabbitMQ.Client.Exceptions;"); EmitLine(""); @@ -482,6 +539,14 @@ namespace RabbitMQ.Client.Apigen { EmitLine(" public "+maybeOverride+"void Clear"+MangleClass(f.Name)+"() { m_"+MangleMethod(f.Name)+"_present = false; }"); } } + + EmitLine(""); + foreach (AmqpField f in c.m_Fields) + { + if (!IsBoolean(f)) + EmitLine(" public " + maybeOverride + "bool Is" + MangleClass(f.Name) + "Present() { return m_" + MangleMethod(f.Name) + "_present; }"); + } + EmitLine(""); EmitLine(" public "+MangleClass(c.Name)+"Properties() {}"); EmitLine(" public override int ProtocolClassId { get { return "+c.Index+"; } }"); diff --git a/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client.dll.sources b/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client.dll.sources index 2f4ed36868d..cb3fe2d42fb 100644 --- a/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client.dll.sources +++ b/mcs/class/RabbitMQ.Client/src/client/RabbitMQ.Client.dll.sources @@ -1,118 +1,119 @@ ./AssemblyInfo.cs ../../../../build/common/Consts.cs -./messagepatterns/SimpleRpcServer.cs -./messagepatterns/SimpleRpcClient.cs -./messagepatterns/Subscription.cs -./exceptions/AlreadyClosedException.cs +./events/EventingBasicConsumer.cs +./events/BasicDeliverEventHandler.cs +./events/CallbackExceptionEventHandler.cs +./events/BasicReturnEventHandler.cs +./events/ModelShutdownEventHandler.cs +./events/ConsumerEventHandler.cs +./events/CallbackExceptionEventArgs.cs +./events/BasicReturnEventArgs.cs +./events/ConsumerEventArgs.cs +./events/BasicDeliverEventArgs.cs +./events/ConnectionShutdownEventHandler.cs +./events/ConsumerShutdownEventHandler.cs +./exceptions/ChannelAllocationException.cs +./exceptions/UnexpectedMethodException.cs ./exceptions/PacketNotRecognizedException.cs -./exceptions/UnsupportedMethodFieldException.cs +./exceptions/PossibleAuthenticationFailureException.cs ./exceptions/WireFormattingException.cs -./exceptions/BrokerUnreachableException.cs +./exceptions/UnsupportedMethodFieldException.cs ./exceptions/ProtocolVersionMismatchException.cs -./exceptions/ChannelAllocationException.cs +./exceptions/AlreadyClosedException.cs +./exceptions/BrokerUnreachableException.cs ./exceptions/UnsupportedMethodException.cs ./exceptions/OperationInterruptedException.cs -./exceptions/UnexpectedMethodException.cs -./content/PrimitiveParser.cs -./content/MapMessageBuilder.cs -./content/IMessageBuilder.cs -./content/IBytesMessageBuilder.cs -./content/BytesMessageBuilder.cs -./content/IMessageReader.cs -./content/BytesMessageReader.cs -./content/BasicMessageReader.cs -./content/IStreamMessageBuilder.cs -./content/IBytesMessageReader.cs -./content/BytesWireFormatting.cs -./content/StreamWireFormatting.cs -./content/StreamMessageBuilder.cs -./content/StreamMessageReader.cs -./content/IStreamMessageReader.cs -./content/BasicMessageBuilder.cs -./content/MapMessageReader.cs -./content/IMapMessageReader.cs -./content/IMapMessageBuilder.cs -./content/MapWireFormatting.cs -./impl/SyntaxError.cs -./impl/MainSession.cs -./impl/ConnectionStartDetails.cs -./impl/RpcContinuationQueue.cs -./impl/MethodArgumentReader.cs -./impl/ShutdownContinuation.cs -./impl/ProtocolException.cs -./impl/ChannelErrorException.cs -./impl/BodyTooLongException.cs -./impl/CommandAssembler.cs -./impl/SimpleBlockingRpcContinuation.cs -./impl/ConnectionBase.cs -./impl/FileProperties.cs -./impl/MethodArgumentWriter.cs -./impl/ModelBase.cs -./impl/StreamProperties.cs -./impl/v0_8qpid/Connection.cs -./impl/v0_8qpid/ProtocolBase.cs +./messagepatterns/SimpleRpcServer.cs +./messagepatterns/Subscription.cs +./messagepatterns/SimpleRpcClient.cs ./impl/SessionBase.cs -./impl/IFrameHandler.cs -./impl/SessionManager.cs -./impl/Command.cs -./impl/UnknownClassOrMethodException.cs -./impl/v0_8/Connection.cs -./impl/v0_8/ProtocolBase.cs ./impl/UnexpectedFrameException.cs +./impl/ContentHeaderPropertyReader.cs +./impl/ConnectionStartDetails.cs +./impl/SessionManager.cs ./impl/AbstractProtocolBase.cs -./impl/SocketFrameHandler_0_9.cs -./impl/WireFormatting.cs -./impl/RedirectException.cs -./impl/ISession.cs +./impl/MalformedFrameException.cs +./impl/ModelBase.cs +./impl/RpcContinuationQueue.cs +./impl/ConnectionBase.cs ./impl/Session.cs +./impl/ContentHeaderBase.cs +./impl/WireFormatting.cs +./impl/MethodArgumentReader.cs +./impl/SimpleBlockingRpcContinuation.cs ./impl/QuiescingSession.cs +./impl/ContentHeaderPropertyWriter.cs +./impl/ChannelErrorException.cs +./impl/SoftProtocolException.cs ./impl/v0_9/Connection.cs ./impl/v0_9/ProtocolBase.cs -./impl/BasicProperties.cs -./impl/Frame.cs -./impl/SoftProtocolException.cs -./impl/MalformedFrameException.cs +./impl/MethodArgumentWriter.cs +./impl/ShutdownContinuation.cs +./impl/SyntaxError.cs ./impl/HardProtocolException.cs +./impl/v0_8/Connection.cs +./impl/v0_8/ProtocolBase.cs +./impl/UnknownClassOrMethodException.cs +./impl/MainSession.cs +./impl/FileProperties.cs +./impl/BasicProperties.cs +./impl/ISession.cs +./impl/Command.cs +./impl/v0_8qpid/Connection.cs +./impl/v0_8qpid/ProtocolBase.cs ./impl/IRpcContinuation.cs -./impl/ContentHeaderBase.cs -./impl/ContentHeaderPropertyWriter.cs +./impl/RedirectException.cs +./impl/SocketFrameHandler_0_9.cs +./impl/ProtocolException.cs +./impl/Frame.cs ./impl/MethodBase.cs -./impl/ContentHeaderPropertyReader.cs -./events/CallbackExceptionEventArgs.cs -./events/ConsumerEventHandler.cs -./events/BasicDeliverEventHandler.cs -./events/BasicReturnEventHandler.cs -./events/ConsumerEventArgs.cs -./events/BasicReturnEventArgs.cs -./events/ModelShutdownEventHandler.cs -./events/ConnectionShutdownEventHandler.cs -./events/EventingBasicConsumer.cs -./events/ConsumerShutdownEventHandler.cs -./events/BasicDeliverEventArgs.cs -./events/CallbackExceptionEventHandler.cs -./api/Protocols.cs -./api/PublicationAddress.cs -./api/ShutdownReportEntry.cs +./impl/IFrameHandler.cs +./impl/CommandAssembler.cs +./impl/StreamProperties.cs +./content/BasicMessageReader.cs +./content/BytesWireFormatting.cs +./content/IMessageBuilder.cs +./content/StreamMessageBuilder.cs +./content/IMessageReader.cs +./content/IMapMessageReader.cs +./content/IBytesMessageBuilder.cs +./content/BasicMessageBuilder.cs +./content/StreamMessageReader.cs +./content/MapMessageReader.cs +./content/StreamWireFormatting.cs +./content/IMapMessageBuilder.cs +./content/PrimitiveParser.cs +./content/MapMessageBuilder.cs +./content/MapWireFormatting.cs +./content/IBytesMessageReader.cs +./content/IStreamMessageReader.cs +./content/IStreamMessageBuilder.cs +./content/BytesMessageBuilder.cs +./content/BytesMessageReader.cs +./api/SslHelper.cs +./api/IConnection.cs +./api/IModel.cs +./api/AmqpTimestamp.cs ./api/IFileProperties.cs +./api/PublicationAddress.cs ./api/QueueingBasicConsumer.cs -./api/AmqpTimestamp.cs -./api/IMethod.cs -./api/ConnectionParameters.cs +./api/AmqpVersion.cs +./api/IProtocol.cs +./api/IBasicConsumer.cs +./api/ExchangeType.cs ./api/AmqpTcpEndpoint.cs +./api/IBasicProperties.cs ./api/IContentHeader.cs +./api/IMethod.cs +./api/ShutdownReportEntry.cs +./api/ShutdownEventArgs.cs +./api/IStreamProperties.cs +./api/Protocols.cs +./api/ShutdownInitiator.cs ./api/DefaultBasicConsumer.cs -./api/ExchangeType.cs -./api/IProtocol.cs +./api/SslOption.cs ./api/BinaryTableValue.cs -./api/AmqpVersion.cs -./api/IBasicConsumer.cs -./api/IConnection.cs -./api/ShutdownInitiator.cs -./api/IModel.cs ./api/ConnectionFactory.cs -./api/IStreamProperties.cs -./api/IBasicProperties.cs -./api/ShutdownEventArgs.cs ../util/DebugUtil.cs ../util/NetworkBinaryReader.cs ../util/NetworkBinaryWriter.cs @@ -121,6 +122,7 @@ ../util/Either.cs ../util/SharedQueue.cs ../util/XmlUtil.cs +../util/IntAllocator.cs ../../docs/specs/autogenerated-api-0-9.cs ../../docs/specs/autogenerated-api-0-8.cs ../../docs/specs/autogenerated-api-qpid-0-8.cs diff --git a/mcs/class/RabbitMQ.Client/src/client/api/AccessRequestConfig.cs b/mcs/class/RabbitMQ.Client/src/client/api/AccessRequestConfig.cs deleted file mode 100644 index c17091d2544..00000000000 --- a/mcs/class/RabbitMQ.Client/src/client/api/AccessRequestConfig.cs +++ /dev/null @@ -1,73 +0,0 @@ -// This source code is dual-licensed under the Apache License, version -// 2.0, and the Mozilla Public License, version 1.1. -// -// The APL v2.0: -// -//--------------------------------------------------------------------------- -// Copyright (C) 2007, 2008 LShift Ltd., Cohesive Financial -// Technologies LLC., and Rabbit Technologies Ltd. -// -// 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. -//--------------------------------------------------------------------------- -// -// The MPL v1.1: -// -//--------------------------------------------------------------------------- -// 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.rabbitmq.com/mpl.html -// -// 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 RabbitMQ .NET Client. -// -// The Initial Developers of the Original Code are LShift Ltd., -// Cohesive Financial Technologies LLC., and Rabbit Technologies Ltd. -// -// Portions created by LShift Ltd., Cohesive Financial Technologies -// LLC., and Rabbit Technologies Ltd. are Copyright (C) 2007, 2008 -// LShift Ltd., Cohesive Financial Technologies LLC., and Rabbit -// Technologies Ltd.; -// -// All Rights Reserved. -// -// Contributor(s): ______________________________________. -// -//--------------------------------------------------------------------------- -namespace RabbitMQ.Client -{ - - ///Used within ConnectionParameters to control - ///suppression of Access.Request calls. - public enum AccessRequestConfig - { - - ///Uses the default for the protocol variant - ///selected. - UseDefault, - - ///Overrides the protocol's default, causing - ///Access.Request methods to be sent to the peer when - ///IModel.AccessRequest is called. - Enable, - - ///Overrides the protocol's default, preventing - ///Access.Request methods from being sent to the - ///peer. - Suppress - }; -} diff --git a/mcs/class/RabbitMQ.Client/src/client/api/AmqpTcpEndpoint.cs b/mcs/class/RabbitMQ.Client/src/client/api/AmqpTcpEndpoint.cs index 197bf686af6..fe30a574e54 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/AmqpTcpEndpoint.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/AmqpTcpEndpoint.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -63,8 +63,19 @@ namespace RabbitMQ.Client ///Represents a TCP-addressable AMQP peer, including the ///protocol variant to use, and a host name and port ///number. + /// + /// Some of the constructors take, as a convenience, a System.Uri + /// instance representing an AMQP server address. The use of Uri + /// here is not standardised - Uri is simply a convenient + /// container for internet-address-like components. In particular, + /// the Uri "Scheme" property is ignored: only the "Host" and + /// "Port" properties are extracted. + /// public class AmqpTcpEndpoint { + ///Indicates that the default port for the protocol should be used + public const int UseDefaultPort = -1; + private IProtocol m_protocol; ///Retrieve or set the IProtocol of this AmqpTcpEndpoint. public IProtocol Protocol @@ -87,19 +98,117 @@ namespace RabbitMQ.Client ///port number for the IProtocol to be used. public int Port { - get { return (m_port == -1) ? m_protocol.DefaultPort : m_port; } + get { return (m_port == UseDefaultPort) ? m_protocol.DefaultPort : m_port; } set { m_port = value; } } + + private SslOption m_ssl; + ///Retrieve the SSL options for this AmqpTcpEndpoint. + ///If not set, null is returned + public SslOption Ssl + { + get { return m_ssl; } + set { m_ssl = value; } + } + + ///Construct an AmqpTcpEndpoint with the given + ///IProtocol, hostname, port number and ssl option. If the port + ///number is -1, the default port number for the IProtocol + ///will be used. + public AmqpTcpEndpoint(IProtocol protocol, string hostName, int portOrMinusOne, SslOption ssl) + { + m_protocol = protocol; + m_hostName = hostName; + m_port = portOrMinusOne; + m_ssl = ssl; + } + ///Construct an AmqpTcpEndpoint with the given ///IProtocol, hostname, and port number. If the port number is ///-1, the default port number for the IProtocol will be ///used. - public AmqpTcpEndpoint(IProtocol protocolVariant, string hostname, int portOrMinusOne) + public AmqpTcpEndpoint(IProtocol protocol, string hostName, int portOrMinusOne) : + this(protocol, hostName, portOrMinusOne, new SslOption()) + { + } + + ///Construct an AmqpTcpEndpoint with the given + ///IProtocol and hostname, using the default port for the + ///IProtocol. + public AmqpTcpEndpoint(IProtocol protocol, string hostName) : + this(protocol, hostName, -1) + { + } + + ///Construct an AmqpTcpEndpoint with the given + ///IProtocol, "localhost" as the hostname, and using the + ///default port for the IProtocol. + public AmqpTcpEndpoint(IProtocol protocol) : + this(protocol, "localhost", -1) + { + } + + ///Construct an AmqpTcpEndpoint with the given + ///hostname and port number, using the IProtocol from + ///Protocols.FromEnvironment(). If the port number is + ///-1, the default port number for the IProtocol will be + ///used. + public AmqpTcpEndpoint(string hostName, int portOrMinusOne) : + this(Protocols.FromEnvironment(), hostName, portOrMinusOne) + { + } + + ///Construct an AmqpTcpEndpoint with the given + ///hostname, using the IProtocol from + ///Protocols.FromEnvironment(), and the default port number of + ///that IProtocol. + public AmqpTcpEndpoint(string hostName) : + this(Protocols.FromEnvironment(), hostName) + { + } + + ///Construct an AmqpTcpEndpoint with a hostname of + ///"localhost", using the IProtocol from + ///Protocols.FromEnvironment(), and the default port number of + ///that IProtocol. + public AmqpTcpEndpoint() : + this(Protocols.FromEnvironment()) + { + } + + ///Construct an AmqpTcpEndpoint with the given + ///IProtocol, Uri and ssl options. + /// + /// Please see the class overview documentation for + /// information about the Uri format in use. + /// + public AmqpTcpEndpoint(IProtocol protocol, Uri uri, SslOption ssl) : + this(protocol, uri.Host, uri.Port, ssl) + { + } + + ///Construct an AmqpTcpEndpoint with the given + ///IProtocol and Uri. + /// + /// Please see the class overview documentation for + /// information about the Uri format in use. + /// + public AmqpTcpEndpoint(IProtocol protocol, Uri uri) : + this(protocol, uri.Host, uri.Port) + { + } + + ///Construct an AmqpTcpEndpoint with the given + ///Uri, using the IProtocol from + ///Protocols.FromEnvironment(). + /// + /// Please see the class overview documentation for + /// information about the Uri format in use. + /// + public AmqpTcpEndpoint(Uri uri) : + this(Protocols.FromEnvironment(), uri) { - m_protocol = protocolVariant; - m_hostName = hostname; - m_port = portOrMinusOne; } ///Returns a URI-like string of the form diff --git a/mcs/class/RabbitMQ.Client/src/client/api/AmqpTimestamp.cs b/mcs/class/RabbitMQ.Client/src/client/api/AmqpTimestamp.cs index 0b930f5aba1..359344a8ea5 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/AmqpTimestamp.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/AmqpTimestamp.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/AmqpVersion.cs b/mcs/class/RabbitMQ.Client/src/client/api/AmqpVersion.cs index 77ae1801be1..3c074f531d4 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/AmqpVersion.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/AmqpVersion.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/BinaryTableValue.cs b/mcs/class/RabbitMQ.Client/src/client/api/BinaryTableValue.cs index 00ff7ff69d8..f6b8250fa89 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/BinaryTableValue.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/BinaryTableValue.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/ConnectionFactory.cs b/mcs/class/RabbitMQ.Client/src/client/api/ConnectionFactory.cs index 1500f8f7c37..309e58fd873 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/ConnectionFactory.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/ConnectionFactory.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -74,20 +74,22 @@ namespace RabbitMQ.Client /// /// ConnectionFactory factory = new ConnectionFactory(); /// // - /// // The next three lines are optional: - /// factory.Parameters.UserName = ConnectionParameters.DefaultUser; - /// factory.Parameters.Password = ConnectionParameters.DefaultPass; - /// factory.Parameters.VirtualHost = ConnectionParameters.DefaultVHost; + /// // The next six lines are optional: + /// factory.UserName = ConnectionFactory.DefaultUser; + /// factory.Password = ConnectionFactory.DefaultPass; + /// factory.VirtualHost = ConnectionFactory.DefaultVHost; + /// factory.Protocol = Protocols.FromEnvironment(); + /// factory.HostName = hostName; + /// factory.PortNumber = AmqpTcpEndpoint.UseDefaultPort; /// // - /// IProtocol protocol = Protocols.DefaultProtocol; - /// IConnection conn = factory.CreateConnection(protocol, hostName, portNumber); + /// IConnection conn = factory.CreateConnection(); /// // /// IModel ch = conn.CreateModel(); /// // /// // ... use ch's IModel methods ... /// // - /// ch.Close(200, "Closing the channel"); - /// conn.Close(200, "Closing the connection"); + /// ch.Close(Constants.ReplySuccess, "Closing the channel"); + /// conn.Close(Constants.ReplySuccess, "Closing the connection"); /// /// /// Please see also the API overview and tutorial in the User Guide. @@ -103,23 +105,97 @@ namespace RabbitMQ.Client /// public class ConnectionFactory { - private ConnectionParameters m_parameters = new ConnectionParameters(); - ///Retrieve the parameters this factory uses to - ///construct IConnection instances. - public ConnectionParameters Parameters - { - get - { - return m_parameters; - } + /// Default user name (value: "guest") + public const string DefaultUser = "guest"; // PLEASE KEEP THIS MATCHING THE DOC ABOVE + + /// Default password (value: "guest") + public const string DefaultPass = "guest"; // PLEASE KEEP THIS MATCHING THE DOC ABOVE + + /// Default virtual host (value: "/") + public const string DefaultVHost = "/"; // PLEASE KEEP THIS MATCHING THE DOC ABOVE + + /// Default value for the desired maximum channel + /// number, with zero meaning unlimited (value: 0) + public const ushort DefaultChannelMax = 0; // PLEASE KEEP THIS MATCHING THE DOC ABOVE + + /// Default value for the desired maximum frame size, + /// with zero meaning unlimited (value: 0) + public const uint DefaultFrameMax = 0; // PLEASE KEEP THIS MATCHING THE DOC ABOVE + + /// Default value for desired heartbeat interval, in + /// seconds, with zero meaning none (value: 0) + public const ushort DefaultHeartbeat = 0; // PLEASE KEEP THIS MATCHING THE DOC ABOVE + + /// Username to use when authenticating to the server + public string UserName = DefaultUser; + + /// Password to use when authenticating to the server + public string Password = DefaultPass; + + /// Virtual host to access during this connection + public string VirtualHost = DefaultVHost; + + /// Maximum channel number to ask for + public ushort RequestedChannelMax = DefaultChannelMax; + + /// Frame-max parameter to ask for (in bytes) + public uint RequestedFrameMax = DefaultFrameMax; + + /// Heartbeat setting to request (in seconds) + public ushort RequestedHeartbeat = DefaultHeartbeat; + + /// Dictionary of client properties to be sent to the + /// server + public IDictionary ClientProperties = ConnectionBase.DefaultClientProperties(); + + ///Ssl options setting + public SslOption Ssl = new SslOption(); + + ///The host to connect to + public String HostName = "localhost"; + + ///The port to connect on. AmqpTcpEndpoint.UseDefaultPort indicates the + /// default for the protocol should be used. + public int Port = AmqpTcpEndpoint.UseDefaultPort; + + ///The AMQP protocol to be used + public IProtocol Protocol = Protocols.FromEnvironment(); + + public AmqpTcpEndpoint Endpoint + { + get + { + return new AmqpTcpEndpoint(Protocol, HostName, Port); + } + set + { + Protocol = value.Protocol; + Port = value.Port; + HostName = value.HostName; + } } - ///Constructs a ConnectionFactory with default values - ///for Parameters. - public ConnectionFactory() + public String Address { + get + { + String result = HostName; + if(Port != AmqpTcpEndpoint.UseDefaultPort) + { + result += (":" + Port); + } + return result; + } + set + { + Endpoint = AmqpTcpEndpoint.Parse(Protocol, value); + } } + ///Construct a fresh instance, with all fields set to + ///their respective defaults. + public ConnectionFactory() { } + protected virtual IConnection FollowRedirectChain (int maxRedirects, IDictionary connectionAttempts, @@ -144,7 +220,7 @@ namespace RabbitMQ.Client // and fully open a successful connection, // in which case we're done, and the // connection should be returned. - return p.CreateConnection(m_parameters, insist, fh); + return p.CreateConnection(this, insist, fh); } catch (RedirectException re) { if (insist) { // We've been redirected, but we insisted that @@ -230,78 +306,25 @@ namespace RabbitMQ.Client ///endpoint in the list provided. Up to a maximum of ///maxRedirects broker-originated redirects are permitted for ///each endpoint tried. - public virtual IConnection CreateConnection(int maxRedirects, - params AmqpTcpEndpoint[] endpoints) + public virtual IConnection CreateConnection(int maxRedirects) { IDictionary connectionAttempts = new Hashtable(); IDictionary connectionErrors = new Hashtable(); IConnection conn = CreateConnection(maxRedirects, connectionAttempts, connectionErrors, - endpoints); + new AmqpTcpEndpoint[]{Endpoint}); if (conn != null) { return conn; } throw new BrokerUnreachableException(connectionAttempts, connectionErrors); } - ///Create a connection to the first available - ///endpoint in the list provided. No broker-originated - ///redirects are permitted. - public virtual IConnection CreateConnection(params AmqpTcpEndpoint[] endpoints) - { - return CreateConnection(0, endpoints); - } - - ///Create a connection to the endpoint specified. - /// - public IConnection CreateConnection(IProtocol version, - string hostName, - int portNumber) - { - return CreateConnection(new AmqpTcpEndpoint[] { - new AmqpTcpEndpoint(version, hostName, portNumber) - }); - } - - ///Create a connection to the endpoint specified. The - ///port used is the default for the protocol. - /// - public IConnection CreateConnection(IProtocol version, string hostName) + ///Create a connection to the specified endpoint + ///No broker-originated redirects are permitted. + public virtual IConnection CreateConnection() { - return CreateConnection(version, hostName, -1); - } - - ///Create a connection to the endpoint specified. - /// - /// Please see the class overview documentation for - /// information about the Uri format in use. - /// - /// - public IConnection CreateConnection(IProtocol version, Uri uri) - { - return CreateConnection(version, uri.Host, uri.Port); - } - - ///Create a connection to the endpoint specified, - ///with the IProtocol from - ///Protocols.FromEnvironment(). - /// - /// Please see the class overview documentation for - /// information about the Uri format in use. - /// - public IConnection CreateConnection(Uri uri) - { - return CreateConnection(Protocols.FromEnvironment(), uri.Host, uri.Port); - } - - ///Create a connection to the host (and optional - ///port) specified, with the IProtocol from - ///Protocols.FromEnvironment(). The format of the address - ///string is the same as that accepted by - ///AmqpTcpEndpoint.Parse(). - public IConnection CreateConnection(string address) { - return CreateConnection(AmqpTcpEndpoint.Parse(Protocols.FromEnvironment(), address)); + return CreateConnection(0); } } } diff --git a/mcs/class/RabbitMQ.Client/src/client/api/ConnectionParameters.cs b/mcs/class/RabbitMQ.Client/src/client/api/ConnectionParameters.cs deleted file mode 100644 index 4c647119447..00000000000 --- a/mcs/class/RabbitMQ.Client/src/client/api/ConnectionParameters.cs +++ /dev/null @@ -1,152 +0,0 @@ -// This source code is dual-licensed under the Apache License, version -// 2.0, and the Mozilla Public License, version 1.1. -// -// The APL v2.0: -// -//--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial -// Technologies LLC., and Rabbit Technologies Ltd. -// -// 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. -//--------------------------------------------------------------------------- -// -// The MPL v1.1: -// -//--------------------------------------------------------------------------- -// 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.rabbitmq.com/mpl.html -// -// 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 RabbitMQ .NET Client. -// -// The Initial Developers of the Original Code are LShift Ltd, -// Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. -// -// Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, -// Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd -// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial -// Technologies LLC, and Rabbit Technologies Ltd. -// -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift -// Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies -// LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. -// -// All Rights Reserved. -// -// Contributor(s): ______________________________________. -// -//--------------------------------------------------------------------------- -using System; - -namespace RabbitMQ.Client -{ - ///Supplies values to ConnectionFactory for use in - ///constructing IConnection instances. - public class ConnectionParameters : ICloneable - { - /// Default user name (value: "guest") - public const string DefaultUser = "guest"; // PLEASE KEEP THIS MATCHING THE DOC ABOVE - - /// Default password (value: "guest") - public const string DefaultPass = "guest"; // PLEASE KEEP THIS MATCHING THE DOC ABOVE - - /// Default virtual host (value: "/") - public const string DefaultVHost = "/"; // PLEASE KEEP THIS MATCHING THE DOC ABOVE - - /// Default value for the desired maximum channel - /// number, with zero meaning unlimited (value: 0) - public const ushort DefaultChannelMax = 0; // PLEASE KEEP THIS MATCHING THE DOC ABOVE - - /// Default value for the desired maximum frame size, - /// with zero meaning unlimited (value: 0) - public const uint DefaultFrameMax = 0; // PLEASE KEEP THIS MATCHING THE DOC ABOVE - - /// Default value for desired heartbeat interval, in - /// seconds, with zero meaning none (value: 3) - public const ushort DefaultHeartbeat = 3; // PLEASE KEEP THIS MATCHING THE DOC ABOVE - - private string m_userName = DefaultUser; - private string m_password = DefaultPass; - private string m_virtualHost = DefaultVHost; - private ushort m_requestedChannelMax = DefaultChannelMax; - private uint m_requestedFrameMax = DefaultFrameMax; - private ushort m_requestedHeartbeat = DefaultHeartbeat; - - ///Construct a fresh instance, with all fields set to - ///their respective defaults. - public ConnectionParameters() { } - - /// Username to use when authenticating to the server - public string UserName - { - get { return m_userName; } - set { m_userName = value; } - } - - /// Password to use when authenticating to the server - public string Password - { - get { return m_password; } - set { m_password = value; } - } - - /// Virtual host to access during this connection - public string VirtualHost - { - get { return m_virtualHost; } - set { m_virtualHost = value; } - } - - /// Maximum channel number to ask for - public ushort RequestedChannelMax - { - get { return m_requestedChannelMax; } - set { m_requestedChannelMax = value; } - } - - /// Frame-max parameter to ask for (in bytes) - public uint RequestedFrameMax - { - get { return m_requestedFrameMax; } - set { m_requestedFrameMax = value; } - } - - /// Heartbeat setting to request (in seconds) - public ushort RequestedHeartbeat - { - get { return m_requestedHeartbeat; } - set { m_requestedHeartbeat = value; } - } - - ///Implement ICloneable.Clone by delegating to our type-safe variant. - object ICloneable.Clone() - { - return ((ConnectionParameters)this).Clone(); - } - - ///Returns a fresh ConnectionParameters with the same values as this. - public ConnectionParameters Clone() - { - ConnectionParameters n = this.MemberwiseClone() as ConnectionParameters; - return n; - } - } -} diff --git a/mcs/class/RabbitMQ.Client/src/client/api/DefaultBasicConsumer.cs b/mcs/class/RabbitMQ.Client/src/client/api/DefaultBasicConsumer.cs index 74ab8ca8a94..7ee981fabb5 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/DefaultBasicConsumer.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/DefaultBasicConsumer.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/ExchangeType.cs b/mcs/class/RabbitMQ.Client/src/client/api/ExchangeType.cs index 4422beaf772..253dd393c37 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/ExchangeType.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/ExchangeType.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/IBasicConsumer.cs b/mcs/class/RabbitMQ.Client/src/client/api/IBasicConsumer.cs index 2be582a6e11..6d8871fb395 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/IBasicConsumer.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/IBasicConsumer.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/IBasicProperties.cs b/mcs/class/RabbitMQ.Client/src/client/api/IBasicProperties.cs index 1784c0f02ed..0f3fbd149e5 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/IBasicProperties.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/IBasicProperties.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -162,6 +162,48 @@ namespace RabbitMQ.Client /// Clear the ClusterId property. void ClearClusterId(); + /// Returns true iff the ContentType property is present. + bool IsContentTypePresent(); + + /// Returns true iff the ContentEncoding property is present. + bool IsContentEncodingPresent(); + + /// Returns true iff the Headers property is present. + bool IsHeadersPresent(); + + /// Returns true iff the DeliveryMode property is present. + bool IsDeliveryModePresent(); + + /// Returns true iff the Priority property is present. + bool IsPriorityPresent(); + + /// Returns true iff the CorrelationId property is present. + bool IsCorrelationIdPresent(); + + /// Returns true iff the ReplyTo property is present. + bool IsReplyToPresent(); + + /// Returns true iff the Expiration property is present. + bool IsExpirationPresent(); + + /// Returns true iff the MessageId property is present. + bool IsMessageIdPresent(); + + /// Returns true iff the Timestamp property is present. + bool IsTimestampPresent(); + + /// Returns true iff the Type property is present. + bool IsTypePresent(); + + /// Returns true iff the UserId property is present. + bool IsUserIdPresent(); + + /// Returns true iff the AppId property is present. + bool IsAppIdPresent(); + + /// Returns true iff the ClusterId property is present. + bool IsClusterIdPresent(); + ///Convenience property; parses ReplyTo property ///using PublicationAddress.Parse, and serializes it using ///PublicationAddress.ToString. Returns null if ReplyTo property diff --git a/mcs/class/RabbitMQ.Client/src/client/api/IConnection.cs b/mcs/class/RabbitMQ.Client/src/client/api/IConnection.cs index 2d1c2c1ef12..013de61dc43 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/IConnection.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/IConnection.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -103,10 +103,6 @@ namespace RabbitMQ.Client ///communicate with its peer. IProtocol Protocol { get; } - ///The connection parameters used during construction - ///of this connection. - ConnectionParameters Parameters { get; } - ///The maximum channel number this connection ///supports (0 if unlimited). Usable channel numbers ///range from 1 to this number, inclusive. @@ -120,6 +116,15 @@ namespace RabbitMQ.Client ///(0 for disabled), in seconds. ushort Heartbeat { get; } + ///A copy of the client properties that has been sent to the + ///server. + IDictionary ClientProperties { get; } + + ///A dictionary of the server properties sent by the server + ///while establishing the connection. This typically includes + ///the product name and version of the server. + IDictionary ServerProperties { get; } + ///Returns the known hosts that came back from the ///broker in the connection.open-ok method at connection ///startup time. Null until the connection is completely open diff --git a/mcs/class/RabbitMQ.Client/src/client/api/IContentHeader.cs b/mcs/class/RabbitMQ.Client/src/client/api/IContentHeader.cs index d301e456e43..a1e0e893695 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/IContentHeader.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/IContentHeader.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,21 +43,23 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // // Contributor(s): ______________________________________. // //--------------------------------------------------------------------------- +using System; + namespace RabbitMQ.Client { ///A decoded AMQP content header frame. - public interface IContentHeader + public interface IContentHeader : ICloneable { ///Retrieve the AMQP class ID of this content header. int ProtocolClassId { get; } diff --git a/mcs/class/RabbitMQ.Client/src/client/api/IFileProperties.cs b/mcs/class/RabbitMQ.Client/src/client/api/IFileProperties.cs index ea7132b6b2f..4404a4667cb 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/IFileProperties.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/IFileProperties.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -131,5 +131,32 @@ namespace RabbitMQ.Client /// Clear the ClusterId property. void ClearClusterId(); + + /// Returns true iff the ContentType property is present. + bool IsContentTypePresent(); + + /// Returns true iff the ContentEncoding property is present. + bool IsContentEncodingPresent(); + + /// Returns true iff the Headers property is present. + bool IsHeadersPresent(); + + /// Returns true iff the Priority property is present. + bool IsPriorityPresent(); + + /// Returns true iff the ReplyTo property is present. + bool IsReplyToPresent(); + + /// Returns true iff the MessageId property is present. + bool IsMessageIdPresent(); + + /// Returns true iff the Filename property is present. + bool IsFilenamePresent(); + + /// Returns true iff the Timestamp property is present. + bool IsTimestampPresent(); + + /// Returns true iff the ClusterId property is present. + bool IsClusterIdPresent(); } } \ No newline at end of file diff --git a/mcs/class/RabbitMQ.Client/src/client/api/IMethod.cs b/mcs/class/RabbitMQ.Client/src/client/api/IMethod.cs index 30d347106cb..9344175ff11 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/IMethod.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/IMethod.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/IModel.cs b/mcs/class/RabbitMQ.Client/src/client/api/IModel.cs index 22080dcae1d..fa7211666b4 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/IModel.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/IModel.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/IProtocol.cs b/mcs/class/RabbitMQ.Client/src/client/api/IProtocol.cs index c1f41a8dfc5..42e13a46b6e 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/IProtocol.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/IProtocol.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -78,7 +78,7 @@ namespace RabbitMQ.Client ///Construct a connection from a given set of ///parameters and a frame handler. The "insist" parameter is ///passed on to the AMQP connection.open method. - IConnection CreateConnection(ConnectionParameters parameters, + IConnection CreateConnection(ConnectionFactory factory, bool insist, IFrameHandler frameHandler); ///Construct a protocol model atop a given session. diff --git a/mcs/class/RabbitMQ.Client/src/client/api/IStreamProperties.cs b/mcs/class/RabbitMQ.Client/src/client/api/IStreamProperties.cs index fd783319e39..23d949dd2f0 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/IStreamProperties.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/IStreamProperties.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -107,5 +107,20 @@ namespace RabbitMQ.Client /// Clear the Timestamp property. void ClearTimestamp(); + + /// Returns true iff the ContentType property is present. + bool IsContentTypePresent(); + + /// Returns true iff the ContentEncoding property is present. + bool IsContentEncodingPresent(); + + /// Returns true iff the Headers property is present. + bool IsHeadersPresent(); + + /// Returns true iff the Priority property is present. + bool IsPriorityPresent(); + + /// Returns true iff the Timestamp property is present. + bool IsTimestampPresent(); } } diff --git a/mcs/class/RabbitMQ.Client/src/client/api/Protocols.cs b/mcs/class/RabbitMQ.Client/src/client/api/Protocols.cs index 69c5f3d741c..ad13b3adcb7 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/Protocols.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/Protocols.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/PublicationAddress.cs b/mcs/class/RabbitMQ.Client/src/client/api/PublicationAddress.cs index f4f3d900418..6b3a91cd890 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/PublicationAddress.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/PublicationAddress.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/QueueingBasicConsumer.cs b/mcs/class/RabbitMQ.Client/src/client/api/QueueingBasicConsumer.cs index a5c03479986..b86003b8bce 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/QueueingBasicConsumer.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/QueueingBasicConsumer.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -76,8 +76,8 @@ namespace RabbitMQ.Client /// When the consumer is closed, through BasicCancel or through /// the shutdown of the underlying IModel or IConnection, the /// SharedQueue's Close() method is called, which causes any - /// threads blocked on the queue's Enqueue() or Dequeue() - /// operations to throw EndOfStreamException (see the comment for + /// Enqueue() operations, and Dequeue() operations when the queue + /// is empty, to throw EndOfStreamException (see the comment for /// SharedQueue.Close()). /// /// diff --git a/mcs/class/RabbitMQ.Client/src/client/api/ShutdownEventArgs.cs b/mcs/class/RabbitMQ.Client/src/client/api/ShutdownEventArgs.cs index f9aec2029c7..7a0e0ace91f 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/ShutdownEventArgs.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/ShutdownEventArgs.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/ShutdownInitiator.cs b/mcs/class/RabbitMQ.Client/src/client/api/ShutdownInitiator.cs index f6c90457320..c925c64e9bf 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/ShutdownInitiator.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/ShutdownInitiator.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/ShutdownReportEntry.cs b/mcs/class/RabbitMQ.Client/src/client/api/ShutdownReportEntry.cs index 420a794fdb3..9641475f72e 100644 --- a/mcs/class/RabbitMQ.Client/src/client/api/ShutdownReportEntry.cs +++ b/mcs/class/RabbitMQ.Client/src/client/api/ShutdownReportEntry.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/api/SslHelper.cs b/mcs/class/RabbitMQ.Client/src/client/api/SslHelper.cs new file mode 100644 index 00000000000..9ec3c32c5a7 --- /dev/null +++ b/mcs/class/RabbitMQ.Client/src/client/api/SslHelper.cs @@ -0,0 +1,128 @@ +// This source code is dual-licensed under the Apache License, version +// 2.0, and the Mozilla Public License, version 1.1. +// +// The APL v2.0: +// +//--------------------------------------------------------------------------- +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial +// Technologies LLC., and Rabbit Technologies Ltd. +// +// 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. +//--------------------------------------------------------------------------- +// +// The MPL v1.1: +// +//--------------------------------------------------------------------------- +// 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.rabbitmq.com/mpl.html +// +// 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 RabbitMQ .NET Client. +// +// The Initial Developers of the Original Code are LShift Ltd, +// Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. +// +// Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, +// Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd +// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial +// Technologies LLC, and Rabbit Technologies Ltd. +// +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift +// Ltd. Portions created by Cohesive Financial Technologies LLC are +// Copyright (C) 2007-2010 Cohesive Financial Technologies +// LLC. Portions created by Rabbit Technologies Ltd are Copyright +// (C) 2007-2010 Rabbit Technologies Ltd. +// +// All Rights Reserved. +// +// Contributor(s): ______________________________________. +// +//--------------------------------------------------------------------------- +using System; +using System.Collections; +using System.IO; +using System.Net.Security; +using System.Security.Authentication; +using System.Security.Cryptography.X509Certificates; +using RabbitMQ.Client.Impl; + +namespace RabbitMQ.Client +{ + + ///Represents an SslHelper which does the actual heavy lifting + ///to set up an SSL connection, using the config options in an SslOption + ///to make things cleaner + public class SslHelper + { + + private SslOption m_sslOption; + + private X509Certificate CertificateSelectionCallback(object sender, + string targetHost, + X509CertificateCollection localCertificates, + X509Certificate remoteCertificate, + string[] acceptableIssuers) + { + if (acceptableIssuers != null && acceptableIssuers.Length > 0 && + localCertificates != null && localCertificates.Count > 0) + { + foreach (X509Certificate certificate in localCertificates) + { + if (Array.IndexOf(acceptableIssuers, certificate.Issuer) != -1) + return certificate; + } + } + if (localCertificates != null && localCertificates.Count > 0) + return localCertificates[0]; + + return null; + } + + private bool CertificateValidationCallback(object sender, + X509Certificate certificate, + X509Chain chain, + SslPolicyErrors sslPolicyErrors) + { + return (sslPolicyErrors & ~m_sslOption.AcceptablePolicyErrors) == SslPolicyErrors.None; + } + + ///Upgrade a Tcp stream to an Ssl stream using the SSL options + ///provided + public static Stream TcpUpgrade(Stream tcpStream, SslOption sslOption) + { + SslHelper helper = new SslHelper(sslOption); + SslStream sslStream = new SslStream(tcpStream, false, + new RemoteCertificateValidationCallback(helper.CertificateValidationCallback), + new LocalCertificateSelectionCallback(helper.CertificateSelectionCallback)); + + sslStream.AuthenticateAsClient(sslOption.ServerName, + sslOption.Certs, + sslOption.Version, + false); + + return sslStream; + } + + private SslHelper(SslOption sslOption) + { + m_sslOption = sslOption; + } + + } +} diff --git a/mcs/class/RabbitMQ.Client/src/client/api/SslOption.cs b/mcs/class/RabbitMQ.Client/src/client/api/SslOption.cs new file mode 100644 index 00000000000..8e2a08cb13d --- /dev/null +++ b/mcs/class/RabbitMQ.Client/src/client/api/SslOption.cs @@ -0,0 +1,172 @@ +// This source code is dual-licensed under the Apache License, version +// 2.0, and the Mozilla Public License, version 1.1. +// +// The APL v2.0: +// +//--------------------------------------------------------------------------- +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial +// Technologies LLC., and Rabbit Technologies Ltd. +// +// 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. +//--------------------------------------------------------------------------- +// +// The MPL v1.1: +// +//--------------------------------------------------------------------------- +// 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.rabbitmq.com/mpl.html +// +// 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 RabbitMQ .NET Client. +// +// The Initial Developers of the Original Code are LShift Ltd, +// Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. +// +// Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, +// Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd +// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial +// Technologies LLC, and Rabbit Technologies Ltd. +// +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift +// Ltd. Portions created by Cohesive Financial Technologies LLC are +// Copyright (C) 2007-2010 Cohesive Financial Technologies +// LLC. Portions created by Rabbit Technologies Ltd are Copyright +// (C) 2007-2010 Rabbit Technologies Ltd. +// +// All Rights Reserved. +// +// Contributor(s): ______________________________________. +// +//--------------------------------------------------------------------------- +using System; +using System.Collections; +using System.Net.Security; +using System.Security.Authentication; +using System.Security.Cryptography.X509Certificates; +using RabbitMQ.Client.Impl; + +namespace RabbitMQ.Client +{ + ///Represents a configurable SSL option, used + ///in setting up an SSL connection. + public class SslOption + { + + private bool m_enabled; + + ///Flag specifying if Ssl should indeed be + ///used + public bool Enabled + { + get { return m_enabled; } + set { m_enabled = value; } + } + + + private SslProtocols m_version = SslProtocols.Ssl3; + + ///Retrieve or set the Ssl protocol version + /// + public SslProtocols Version + { + get { return m_version; } + set { m_version = value; } + } + + private string m_certPath; + + ///Retrieve or set the path to client certificate. + /// + public string CertPath + { + get { return m_certPath; } + set { m_certPath = value; } + } + + private string m_certPass; + + ///Retrieve or set the path to client certificate. + /// + public string CertPassphrase + { + get { return m_certPass; } + set { m_certPass = value; } + } + + + ///Convenience read-only property to retrieve an X509CertificateCollection + ///containing the client certificate + public X509CertificateCollection Certs + { + get { + if(m_certPath == "") { + return null; + } else { + X509CertificateCollection c = new X509CertificateCollection(); + c.Add(new X509Certificate2(m_certPath, m_certPass)); + return c; + } + } + } + + private string m_serverName; + + ///Retrieve or set server's Canonical Name. This MUST match the CN + ///on the Certificate else the SSL connection will fail + public string ServerName + { + get { return m_serverName; } + set { m_serverName = value; } + } + + private SslPolicyErrors m_acceptablePolicyErrors = SslPolicyErrors.None; + + ///Retrieve or set the set of ssl policy errors that + ///are deemed acceptable + public SslPolicyErrors AcceptablePolicyErrors + { + get { return m_acceptablePolicyErrors; } + set { m_acceptablePolicyErrors = value; } + } + + + ///Construct an SslOption specifying both the server cannonical name + ///and the client's certificate path. + /// + public SslOption(string serverName, string certPath, bool enabled) + { + m_serverName= serverName; + m_certPath = certPath; + m_enabled = enabled; + } + + ///Construct an SslOption with just the server cannonical name. + ///The Certificate path is set to an empty string + /// + public SslOption(string serverName): this(serverName, "", false) + { + } + + ///Construct an SslOption with no parameters set + public SslOption(): this("", "", false) + { + } + + } +} diff --git a/mcs/class/RabbitMQ.Client/src/client/content/BasicMessageBuilder.cs b/mcs/class/RabbitMQ.Client/src/client/content/BasicMessageBuilder.cs index 72574172d5d..360c8dd2ecb 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/BasicMessageBuilder.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/BasicMessageBuilder.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/BasicMessageReader.cs b/mcs/class/RabbitMQ.Client/src/client/content/BasicMessageReader.cs index 47496194834..65c13d53289 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/BasicMessageReader.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/BasicMessageReader.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/BytesMessageBuilder.cs b/mcs/class/RabbitMQ.Client/src/client/content/BytesMessageBuilder.cs index 7cd757483ec..dfd6e33529e 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/BytesMessageBuilder.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/BytesMessageBuilder.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/BytesMessageReader.cs b/mcs/class/RabbitMQ.Client/src/client/content/BytesMessageReader.cs index 2ce790fe9fd..b3606dca112 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/BytesMessageReader.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/BytesMessageReader.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/BytesWireFormatting.cs b/mcs/class/RabbitMQ.Client/src/client/content/BytesWireFormatting.cs index 7e051d0fb70..0f9ff83da24 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/BytesWireFormatting.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/BytesWireFormatting.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/IBytesMessageBuilder.cs b/mcs/class/RabbitMQ.Client/src/client/content/IBytesMessageBuilder.cs index fcd62ffb531..ffd2e4c7686 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/IBytesMessageBuilder.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/IBytesMessageBuilder.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/IBytesMessageReader.cs b/mcs/class/RabbitMQ.Client/src/client/content/IBytesMessageReader.cs index 74816f8816d..2acc0abf2ea 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/IBytesMessageReader.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/IBytesMessageReader.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/IMapMessageBuilder.cs b/mcs/class/RabbitMQ.Client/src/client/content/IMapMessageBuilder.cs index 42b7a9b91ee..2988c96685a 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/IMapMessageBuilder.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/IMapMessageBuilder.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/IMapMessageReader.cs b/mcs/class/RabbitMQ.Client/src/client/content/IMapMessageReader.cs index 1dc14ccab7e..5a2fbbd0927 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/IMapMessageReader.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/IMapMessageReader.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/IMessageBuilder.cs b/mcs/class/RabbitMQ.Client/src/client/content/IMessageBuilder.cs index 93a362a0c54..9290113d094 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/IMessageBuilder.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/IMessageBuilder.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/IMessageReader.cs b/mcs/class/RabbitMQ.Client/src/client/content/IMessageReader.cs index cda25b7c3da..d77e4f707bd 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/IMessageReader.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/IMessageReader.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/IStreamMessageBuilder.cs b/mcs/class/RabbitMQ.Client/src/client/content/IStreamMessageBuilder.cs index 509491d4cbb..9ce98227cce 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/IStreamMessageBuilder.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/IStreamMessageBuilder.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/IStreamMessageReader.cs b/mcs/class/RabbitMQ.Client/src/client/content/IStreamMessageReader.cs index 1c71ee983cf..e4b63150a86 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/IStreamMessageReader.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/IStreamMessageReader.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/MapMessageBuilder.cs b/mcs/class/RabbitMQ.Client/src/client/content/MapMessageBuilder.cs index e2243beff75..5577dd666ad 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/MapMessageBuilder.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/MapMessageBuilder.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/MapMessageReader.cs b/mcs/class/RabbitMQ.Client/src/client/content/MapMessageReader.cs index 68cfcaa8f82..2f74a1c9ce6 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/MapMessageReader.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/MapMessageReader.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/MapWireFormatting.cs b/mcs/class/RabbitMQ.Client/src/client/content/MapWireFormatting.cs index 0f04d72acef..e02f0176381 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/MapWireFormatting.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/MapWireFormatting.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/PrimitiveParser.cs b/mcs/class/RabbitMQ.Client/src/client/content/PrimitiveParser.cs index 71df96139d9..84dbecdf7c9 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/PrimitiveParser.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/PrimitiveParser.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/StreamMessageBuilder.cs b/mcs/class/RabbitMQ.Client/src/client/content/StreamMessageBuilder.cs index 7fd985d23a1..df20010217d 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/StreamMessageBuilder.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/StreamMessageBuilder.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/StreamMessageReader.cs b/mcs/class/RabbitMQ.Client/src/client/content/StreamMessageReader.cs index ed16e2af2ad..348812b9ef0 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/StreamMessageReader.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/StreamMessageReader.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/content/StreamWireFormatting.cs b/mcs/class/RabbitMQ.Client/src/client/content/StreamWireFormatting.cs index 824378f65b0..09546db1bf7 100644 --- a/mcs/class/RabbitMQ.Client/src/client/content/StreamWireFormatting.cs +++ b/mcs/class/RabbitMQ.Client/src/client/content/StreamWireFormatting.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/events/BasicDeliverEventArgs.cs b/mcs/class/RabbitMQ.Client/src/client/events/BasicDeliverEventArgs.cs index 13c0215261d..cc1ea2d4580 100644 --- a/mcs/class/RabbitMQ.Client/src/client/events/BasicDeliverEventArgs.cs +++ b/mcs/class/RabbitMQ.Client/src/client/events/BasicDeliverEventArgs.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/events/BasicDeliverEventHandler.cs b/mcs/class/RabbitMQ.Client/src/client/events/BasicDeliverEventHandler.cs index 1af5bfcc4a9..810f17cc512 100644 --- a/mcs/class/RabbitMQ.Client/src/client/events/BasicDeliverEventHandler.cs +++ b/mcs/class/RabbitMQ.Client/src/client/events/BasicDeliverEventHandler.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/events/BasicReturnEventArgs.cs b/mcs/class/RabbitMQ.Client/src/client/events/BasicReturnEventArgs.cs index 531cfc12459..c1ff386b21f 100644 --- a/mcs/class/RabbitMQ.Client/src/client/events/BasicReturnEventArgs.cs +++ b/mcs/class/RabbitMQ.Client/src/client/events/BasicReturnEventArgs.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/events/BasicReturnEventHandler.cs b/mcs/class/RabbitMQ.Client/src/client/events/BasicReturnEventHandler.cs index a9681e9dae5..0b7522cb14e 100644 --- a/mcs/class/RabbitMQ.Client/src/client/events/BasicReturnEventHandler.cs +++ b/mcs/class/RabbitMQ.Client/src/client/events/BasicReturnEventHandler.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/events/CallbackExceptionEventArgs.cs b/mcs/class/RabbitMQ.Client/src/client/events/CallbackExceptionEventArgs.cs index f3b1b614198..462cef255f7 100644 --- a/mcs/class/RabbitMQ.Client/src/client/events/CallbackExceptionEventArgs.cs +++ b/mcs/class/RabbitMQ.Client/src/client/events/CallbackExceptionEventArgs.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/events/CallbackExceptionEventHandler.cs b/mcs/class/RabbitMQ.Client/src/client/events/CallbackExceptionEventHandler.cs index b12acc4c9e2..a3d40fba6cd 100644 --- a/mcs/class/RabbitMQ.Client/src/client/events/CallbackExceptionEventHandler.cs +++ b/mcs/class/RabbitMQ.Client/src/client/events/CallbackExceptionEventHandler.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/events/ConnectionShutdownEventHandler.cs b/mcs/class/RabbitMQ.Client/src/client/events/ConnectionShutdownEventHandler.cs index e20bf90271c..30cec70443e 100644 --- a/mcs/class/RabbitMQ.Client/src/client/events/ConnectionShutdownEventHandler.cs +++ b/mcs/class/RabbitMQ.Client/src/client/events/ConnectionShutdownEventHandler.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/events/ConsumerEventArgs.cs b/mcs/class/RabbitMQ.Client/src/client/events/ConsumerEventArgs.cs index 995fbcd8665..92b5e70c581 100644 --- a/mcs/class/RabbitMQ.Client/src/client/events/ConsumerEventArgs.cs +++ b/mcs/class/RabbitMQ.Client/src/client/events/ConsumerEventArgs.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/events/ConsumerEventHandler.cs b/mcs/class/RabbitMQ.Client/src/client/events/ConsumerEventHandler.cs index c232e8ba235..273e242e82b 100644 --- a/mcs/class/RabbitMQ.Client/src/client/events/ConsumerEventHandler.cs +++ b/mcs/class/RabbitMQ.Client/src/client/events/ConsumerEventHandler.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/events/ConsumerShutdownEventHandler.cs b/mcs/class/RabbitMQ.Client/src/client/events/ConsumerShutdownEventHandler.cs index d4bbce34a25..d7e64bb5e01 100644 --- a/mcs/class/RabbitMQ.Client/src/client/events/ConsumerShutdownEventHandler.cs +++ b/mcs/class/RabbitMQ.Client/src/client/events/ConsumerShutdownEventHandler.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/events/EventingBasicConsumer.cs b/mcs/class/RabbitMQ.Client/src/client/events/EventingBasicConsumer.cs index 8ada4f5a682..d6cf6358abc 100644 --- a/mcs/class/RabbitMQ.Client/src/client/events/EventingBasicConsumer.cs +++ b/mcs/class/RabbitMQ.Client/src/client/events/EventingBasicConsumer.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/events/ModelShutdownEventHandler.cs b/mcs/class/RabbitMQ.Client/src/client/events/ModelShutdownEventHandler.cs index f37c8979975..e0ffb987eba 100644 --- a/mcs/class/RabbitMQ.Client/src/client/events/ModelShutdownEventHandler.cs +++ b/mcs/class/RabbitMQ.Client/src/client/events/ModelShutdownEventHandler.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/exceptions/AlreadyClosedException.cs b/mcs/class/RabbitMQ.Client/src/client/exceptions/AlreadyClosedException.cs index 995506f2fd7..4c3c7f2fcd5 100644 --- a/mcs/class/RabbitMQ.Client/src/client/exceptions/AlreadyClosedException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/exceptions/AlreadyClosedException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/exceptions/BrokerUnreachableException.cs b/mcs/class/RabbitMQ.Client/src/client/exceptions/BrokerUnreachableException.cs index 4b939a9292f..a0f9fc83bc4 100644 --- a/mcs/class/RabbitMQ.Client/src/client/exceptions/BrokerUnreachableException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/exceptions/BrokerUnreachableException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -85,6 +85,9 @@ namespace RabbitMQ.Client.Exceptions { ///each endpoint. public IDictionary ConnectionErrors { get { return m_connectionErrors; } } + ///same as ConnectionErrors property + public override IDictionary Data { get { return m_connectionErrors; } } + ///Construct a BrokerUnreachableException. Expects ///maps as per the description of the ConnectionAttempts and ///ConnectionErrors properties. @@ -103,19 +106,12 @@ namespace RabbitMQ.Client.Exceptions { StringBuilder sb = new StringBuilder(base.Message); sb.Append("\nEndpoints attempted:\n"); foreach (DictionaryEntry entry in m_connectionAttempts) { - sb.Append(" endpoint="); - sb.Append(entry.Key); - sb.Append(", attempts="); - sb.Append(entry.Value); - sb.Append(", outcome="); - Exception e = m_connectionErrors[entry.Key] as Exception; - if (e == null) { - sb.Append("(null)"); - } else { - sb.Append(e.Message); - } - sb.Append("\n"); + sb.Append("------------------------------------------------\n"); + sb.Append("endpoint=").Append(entry.Key); + sb.Append(", attempts=").Append(entry.Value).Append("\n"); + sb.Append(m_connectionErrors[entry.Key] as Exception); } + sb.Append("\n================================================\n"); sb.Append("Stack trace:\n"); sb.Append(base.StackTrace); return sb.ToString(); diff --git a/mcs/class/RabbitMQ.Client/src/client/exceptions/ChannelAllocationException.cs b/mcs/class/RabbitMQ.Client/src/client/exceptions/ChannelAllocationException.cs index a0c32ec9b9e..472d8560ee0 100644 --- a/mcs/class/RabbitMQ.Client/src/client/exceptions/ChannelAllocationException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/exceptions/ChannelAllocationException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/exceptions/OperationInterruptedException.cs b/mcs/class/RabbitMQ.Client/src/client/exceptions/OperationInterruptedException.cs index 11801d57e4a..7ea29fe24d3 100644 --- a/mcs/class/RabbitMQ.Client/src/client/exceptions/OperationInterruptedException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/exceptions/OperationInterruptedException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/exceptions/PacketNotRecognizedException.cs b/mcs/class/RabbitMQ.Client/src/client/exceptions/PacketNotRecognizedException.cs index 6cf85759a7a..61dd60ada3f 100644 --- a/mcs/class/RabbitMQ.Client/src/client/exceptions/PacketNotRecognizedException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/exceptions/PacketNotRecognizedException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/exceptions/PossibleAuthenticationFailureException.cs b/mcs/class/RabbitMQ.Client/src/client/exceptions/PossibleAuthenticationFailureException.cs new file mode 100644 index 00000000000..88b2b086fbe --- /dev/null +++ b/mcs/class/RabbitMQ.Client/src/client/exceptions/PossibleAuthenticationFailureException.cs @@ -0,0 +1,70 @@ +// This source code is dual-licensed under the Apache License, version +// 2.0, and the Mozilla Public License, version 1.1. +// +// The APL v2.0: +// +//--------------------------------------------------------------------------- +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial +// Technologies LLC., and Rabbit Technologies Ltd. +// +// 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. +//--------------------------------------------------------------------------- +// +// The MPL v1.1: +// +//--------------------------------------------------------------------------- +// 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.rabbitmq.com/mpl.html +// +// 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 RabbitMQ .NET Client. +// +// The Initial Developers of the Original Code are LShift Ltd, +// Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. +// +// Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, +// Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd +// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial +// Technologies LLC, and Rabbit Technologies Ltd. +// +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift +// Ltd. Portions created by Cohesive Financial Technologies LLC are +// Copyright (C) 2007-2010 Cohesive Financial Technologies +// LLC. Portions created by Rabbit Technologies Ltd are Copyright +// (C) 2007-2010 Rabbit Technologies Ltd. +// +// All Rights Reserved. +// +// Contributor(s): ______________________________________. +// +//--------------------------------------------------------------------------- +using System; + +namespace RabbitMQ.Client.Exceptions +{ + /// Thrown when the likely cause is an + /// authentication failure. + public class PossibleAuthenticationFailureException : Exception + { + public PossibleAuthenticationFailureException(String msg, Exception inner) + : base(msg, inner) + { + } + } +} diff --git a/mcs/class/RabbitMQ.Client/src/client/exceptions/ProtocolVersionMismatchException.cs b/mcs/class/RabbitMQ.Client/src/client/exceptions/ProtocolVersionMismatchException.cs index 7e60b8d6a3c..d2947913f7a 100644 --- a/mcs/class/RabbitMQ.Client/src/client/exceptions/ProtocolVersionMismatchException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/exceptions/ProtocolVersionMismatchException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/exceptions/UnexpectedMethodException.cs b/mcs/class/RabbitMQ.Client/src/client/exceptions/UnexpectedMethodException.cs index 9799b39bec6..15b67507c00 100644 --- a/mcs/class/RabbitMQ.Client/src/client/exceptions/UnexpectedMethodException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/exceptions/UnexpectedMethodException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/exceptions/UnsupportedMethodException.cs b/mcs/class/RabbitMQ.Client/src/client/exceptions/UnsupportedMethodException.cs index 9d5df4af150..4899805a73d 100644 --- a/mcs/class/RabbitMQ.Client/src/client/exceptions/UnsupportedMethodException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/exceptions/UnsupportedMethodException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/exceptions/UnsupportedMethodFieldException.cs b/mcs/class/RabbitMQ.Client/src/client/exceptions/UnsupportedMethodFieldException.cs index 78db98bd364..c6259029fa6 100644 --- a/mcs/class/RabbitMQ.Client/src/client/exceptions/UnsupportedMethodFieldException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/exceptions/UnsupportedMethodFieldException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/exceptions/WireFormattingException.cs b/mcs/class/RabbitMQ.Client/src/client/exceptions/WireFormattingException.cs index 75c44708bc6..1673654ba42 100644 --- a/mcs/class/RabbitMQ.Client/src/client/exceptions/WireFormattingException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/exceptions/WireFormattingException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/AbstractProtocolBase.cs b/mcs/class/RabbitMQ.Client/src/client/impl/AbstractProtocolBase.cs index 9d2c14976b5..c6fd0f17eca 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/AbstractProtocolBase.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/AbstractProtocolBase.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -66,7 +66,7 @@ namespace RabbitMQ.Client.Impl { public abstract int DefaultPort { get; } public abstract IFrameHandler CreateFrameHandler(AmqpTcpEndpoint endpoint); - public abstract IConnection CreateConnection(ConnectionParameters parameters, + public abstract IConnection CreateConnection(ConnectionFactory factory, bool insist, IFrameHandler frameHandler); public abstract IModel CreateModel(ISession session); diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/BasicProperties.cs b/mcs/class/RabbitMQ.Client/src/client/impl/BasicProperties.cs index a1a0f6567f6..5c4b2df7836 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/BasicProperties.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/BasicProperties.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -57,53 +57,86 @@ using System; using System.Collections; -namespace RabbitMQ.Client.Impl { - public abstract class BasicProperties: ContentHeaderBase, IBasicProperties { - public abstract string ContentType { get; set; } - public abstract string ContentEncoding { get; set; } - public abstract IDictionary Headers { get; set; } - public abstract byte DeliveryMode { get; set; } - public abstract byte Priority { get; set; } - public abstract string CorrelationId { get; set; } - public abstract string ReplyTo { get; set; } - public abstract string Expiration { get; set; } - public abstract string MessageId { get; set; } - public abstract AmqpTimestamp Timestamp { get; set; } - public abstract string Type { get; set; } - public abstract string UserId { get; set; } - public abstract string AppId { get; set; } - public abstract string ClusterId { get; set; } +namespace RabbitMQ.Client.Impl +{ + public abstract class BasicProperties: ContentHeaderBase, IBasicProperties + { + public abstract string ContentType { get; set; } + public abstract string ContentEncoding { get; set; } + public abstract IDictionary Headers { get; set; } + public abstract byte DeliveryMode { get; set; } + public abstract byte Priority { get; set; } + public abstract string CorrelationId { get; set; } + public abstract string ReplyTo { get; set; } + public abstract string Expiration { get; set; } + public abstract string MessageId { get; set; } + public abstract AmqpTimestamp Timestamp { get; set; } + public abstract string Type { get; set; } + public abstract string UserId { get; set; } + public abstract string AppId { get; set; } + public abstract string ClusterId { get; set; } - public abstract void ClearContentType(); - public abstract void ClearContentEncoding(); - public abstract void ClearHeaders(); - public abstract void ClearDeliveryMode(); - public abstract void ClearPriority(); - public abstract void ClearCorrelationId(); - public abstract void ClearReplyTo(); - public abstract void ClearExpiration(); - public abstract void ClearMessageId(); - public abstract void ClearTimestamp(); - public abstract void ClearType(); - public abstract void ClearUserId(); - public abstract void ClearAppId(); - public abstract void ClearClusterId(); + public abstract void ClearContentType(); + public abstract void ClearContentEncoding(); + public abstract void ClearHeaders(); + public abstract void ClearDeliveryMode(); + public abstract void ClearPriority(); + public abstract void ClearCorrelationId(); + public abstract void ClearReplyTo(); + public abstract void ClearExpiration(); + public abstract void ClearMessageId(); + public abstract void ClearTimestamp(); + public abstract void ClearType(); + public abstract void ClearUserId(); + public abstract void ClearAppId(); + public abstract void ClearClusterId(); - public PublicationAddress ReplyToAddress { - get { + public abstract bool IsContentTypePresent(); + public abstract bool IsContentEncodingPresent(); + public abstract bool IsHeadersPresent(); + public abstract bool IsDeliveryModePresent(); + public abstract bool IsPriorityPresent(); + public abstract bool IsCorrelationIdPresent(); + public abstract bool IsReplyToPresent(); + public abstract bool IsExpirationPresent(); + public abstract bool IsMessageIdPresent(); + public abstract bool IsTimestampPresent(); + public abstract bool IsTypePresent(); + public abstract bool IsUserIdPresent(); + public abstract bool IsAppIdPresent(); + public abstract bool IsClusterIdPresent(); + + public PublicationAddress ReplyToAddress + { + get + { return PublicationAddress.Parse(ReplyTo); } - set { + set + { ReplyTo = value.ToString(); } } - public void SetPersistent(bool persistent) { - if (persistent) { - DeliveryMode = 2; - } else { - DeliveryMode = 1; - } - } + public void SetPersistent(bool persistent) + { + if (persistent) + DeliveryMode = 2; + else + DeliveryMode = 1; + } + + public override object Clone() + { + BasicProperties clone = MemberwiseClone() as BasicProperties; + if (IsHeadersPresent()) + { + clone.Headers = new Hashtable(); + foreach (DictionaryEntry entry in Headers) + clone.Headers[entry.Key] = entry.Value; + } + + return clone; + } } } diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/BodyTooLongException.cs b/mcs/class/RabbitMQ.Client/src/client/impl/BodyTooLongException.cs deleted file mode 100644 index 59d8a6a146d..00000000000 --- a/mcs/class/RabbitMQ.Client/src/client/impl/BodyTooLongException.cs +++ /dev/null @@ -1,85 +0,0 @@ -// This source code is dual-licensed under the Apache License, version -// 2.0, and the Mozilla Public License, version 1.1. -// -// The APL v2.0: -// -//--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial -// Technologies LLC., and Rabbit Technologies Ltd. -// -// 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. -//--------------------------------------------------------------------------- -// -// The MPL v1.1: -// -//--------------------------------------------------------------------------- -// 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.rabbitmq.com/mpl.html -// -// 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 RabbitMQ .NET Client. -// -// The Initial Developers of the Original Code are LShift Ltd, -// Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. -// -// Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, -// Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd -// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial -// Technologies LLC, and Rabbit Technologies Ltd. -// -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift -// Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies -// LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. -// -// All Rights Reserved. -// -// Contributor(s): ______________________________________. -// -//--------------------------------------------------------------------------- -using System; - -// We use spec version 0-9 for common constants such as frame types, -// error codes, and the frame end byte, since they don't vary *within -// the versions we support*. Obviously we may need to revisit this if -// that ever changes. -using CommonFraming = RabbitMQ.Client.Framing.v0_9; - -namespace RabbitMQ.Client.Impl { - /// - /// Thrown when the connection receives a body that exceeds the permissible maximum. - /// FIXME: document the permissible maximum, and how to query and configure it - /// - public class BodyTooLongException: SoftProtocolException { - private readonly ulong m_requestedLength; - - public BodyTooLongException(int channelNumber, ulong requestedLength) - : base(channelNumber, - string.Format("The body of a message ({0} bytes) was too long.", - requestedLength)) - { - m_requestedLength = requestedLength; - } - - public ulong RequestedLength { get { return m_requestedLength; } } - - public override ushort ReplyCode { get { return CommonFraming.Constants.ContentTooLarge; } } - } -} diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/ChannelErrorException.cs b/mcs/class/RabbitMQ.Client/src/client/impl/ChannelErrorException.cs index a6a9e378e1c..ece631c4176 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/ChannelErrorException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/ChannelErrorException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/Command.cs b/mcs/class/RabbitMQ.Client/src/client/impl/Command.cs index dd08f84a8da..580bafdbc69 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/Command.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/Command.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/CommandAssembler.cs b/mcs/class/RabbitMQ.Client/src/client/impl/CommandAssembler.cs index d0e6fa717c7..fbbb2ce731c 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/CommandAssembler.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/CommandAssembler.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -142,7 +142,7 @@ namespace RabbitMQ.Client.Impl } NetworkBinaryReader reader = f.GetReader(); m_command.m_header = m_protocol.DecodeContentHeaderFrom(reader); - m_remainingBodyBytes = m_command.m_header.ReadFrom(f.Channel, reader); + m_remainingBodyBytes = m_command.m_header.ReadFrom(reader); UpdateContentBodyState(); return CompletedCommand(); } diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/ConnectionBase.cs b/mcs/class/RabbitMQ.Client/src/client/impl/ConnectionBase.cs index b72ef072a8b..9b621175d38 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/ConnectionBase.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/ConnectionBase.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -56,6 +56,7 @@ //--------------------------------------------------------------------------- using System; using System.IO; +using System.Net.Sockets; using System.Text; using System.Threading; using System.Collections; @@ -89,16 +90,18 @@ namespace RabbitMQ.Client.Impl ///(milliseconds) public static int ConnectionCloseTimeout = 10000; - public ConnectionParameters m_parameters; + public ConnectionFactory m_factory; public IFrameHandler m_frameHandler; public uint m_frameMax = 0; public ushort m_heartbeat = 0; + public IDictionary m_clientProperties; + public IDictionary m_serverProperties; public AmqpTcpEndpoint[] m_knownHosts = null; public MainSession m_session0; public ModelBase m_model0; - public readonly SessionManager m_sessionManager; + public SessionManager m_sessionManager; public volatile bool m_running = true; @@ -119,14 +122,14 @@ namespace RabbitMQ.Client.Impl public IList m_shutdownReport = ArrayList.Synchronized(new ArrayList()); - public ConnectionBase(ConnectionParameters parameters, + public ConnectionBase(ConnectionFactory factory, bool insist, IFrameHandler frameHandler) { - m_parameters = parameters; + m_factory = factory; m_frameHandler = frameHandler; - m_sessionManager = new SessionManager(this); + m_sessionManager = new SessionManager(this, 0); m_session0 = new MainSession(this); m_session0.Handler = new MainSession.SessionCloseDelegate(NotifyReceivedCloseOk); m_model0 = (ModelBase)Protocol.CreateModel(m_session0); @@ -134,6 +137,7 @@ namespace RabbitMQ.Client.Impl StartMainLoop(); Open(insist); StartHeartbeatLoops(); + AppDomain.CurrentDomain.DomainUnload += HandleDomainUnload; } public event ConnectionShutdownEventHandler ConnectionShutdown @@ -214,24 +218,12 @@ namespace RabbitMQ.Client.Impl m_heartbeatWrite.Set(); } - public ConnectionParameters Parameters - { - get - { - return m_parameters; - } - } - public ushort ChannelMax { get { return m_sessionManager.ChannelMax; } - set - { - m_sessionManager.ChannelMax = value; - } } public uint FrameMax @@ -262,6 +254,30 @@ namespace RabbitMQ.Client.Impl } } + public IDictionary ClientProperties + { + get + { + return new Hashtable(m_clientProperties); + } + set + { + m_clientProperties = value; + } + } + + public IDictionary ServerProperties + { + get + { + return m_serverProperties; + } + set + { + m_serverProperties = value; + } + } + public AmqpTcpEndpoint[] KnownHosts { get { return m_knownHosts; } @@ -355,7 +371,7 @@ namespace RabbitMQ.Client.Impl ///API-side invocation of connection close. public void Close() { - Close(200, "Goodbye", Timeout.Infinite); + Close(CommonFraming.Constants.ReplySuccess, "Goodbye", Timeout.Infinite); } ///API-side invocation of connection close. @@ -367,7 +383,7 @@ namespace RabbitMQ.Client.Impl ///API-side invocation of connection close with timeout. public void Close(int timeout) { - Close(200, "Goodbye", timeout); + Close(CommonFraming.Constants.ReplySuccess, "Goodbye", timeout); } ///API-side invocation of connection close with timeout. @@ -396,7 +412,7 @@ namespace RabbitMQ.Client.Impl ///API-side invocation of connection abort with timeout. public void Abort(int timeout) { - Abort(200, "Connection close forced", timeout); + Abort(CommonFraming.Constants.ReplySuccess, "Connection close forced", timeout); } ///API-side invocation of connection abort with timeout. @@ -496,9 +512,9 @@ namespace RabbitMQ.Client.Impl public void StartMainLoop() { - Thread mainloopThread = new Thread(new ThreadStart(MainLoop)); - mainloopThread.Name = "AMQP Connection " + Endpoint.ToString(); - mainloopThread.Start(); + Thread mainLoopThread = new Thread(new ThreadStart(MainLoop)); + mainLoopThread.Name = "AMQP Connection " + Endpoint.ToString(); + mainLoopThread.Start(); } public void StartHeartbeatLoops() @@ -604,6 +620,14 @@ namespace RabbitMQ.Client.Impl { shutdownCleanly = HardProtocolExceptionHandler(hpe); } + catch (SocketException se) + { + // Possibly due to handshake timeout + HandleMainLoopException(new ShutdownEventArgs(ShutdownInitiator.Library, + 0, + "Socket exception", + se)); + } catch (Exception ex) { HandleMainLoopException(new ShutdownEventArgs(ShutdownInitiator.Library, @@ -635,7 +659,7 @@ namespace RabbitMQ.Client.Impl // counter. return; } - + if (frame.Channel == 0) { // In theory, we could get non-connection.close-ok // frames here while we're quiescing (m_closeReason != @@ -682,7 +706,16 @@ namespace RabbitMQ.Client.Impl m_model0.SetCloseReason(m_closeReason); m_model0.FinishClose(); } - + + /// + /// We need to close the socket, otherwise attempting to unload the domain + /// could cause a CannotUnloadAppDomainException + /// + public void HandleDomainUnload(object sender, EventArgs ea) + { + Abort(CommonFraming.Constants.InternalError, "Domain Unload"); + } + public bool HardProtocolExceptionHandler(HardProtocolException hpe) { if (SetCloseReason(hpe.ShutdownReason)) @@ -875,6 +908,7 @@ namespace RabbitMQ.Client.Impl } } } + AppDomain.CurrentDomain.DomainUnload -= HandleDomainUnload; } public void OnCallbackException(CallbackExceptionEventArgs args) @@ -897,9 +931,11 @@ namespace RabbitMQ.Client.Impl } } - public IDictionary BuildClientPropertiesTable() + public static IDictionary DefaultClientProperties() { - string version = this.GetType().Assembly.GetName().Version.ToString(); + System.Reflection.Assembly assembly = + System.Reflection.Assembly.GetAssembly(typeof(ConnectionBase)); + string version = assembly.GetName().Version.ToString(); //TODO: Get the rest of this data from the Assembly Attributes Hashtable table = new Hashtable(); table["product"] = Encoding.UTF8.GetBytes("RabbitMQ"); @@ -942,6 +978,8 @@ namespace RabbitMQ.Client.Impl ConnectionStartDetails connectionStart = (ConnectionStartDetails) connectionStartCell.Value; + ServerProperties = connectionStart.m_serverProperties; + AmqpVersion serverVersion = new AmqpVersion(connectionStart.m_versionMajor, connectionStart.m_versionMinor); if (!serverVersion.Equals(Protocol.Version)) @@ -954,24 +992,36 @@ namespace RabbitMQ.Client.Impl serverVersion.Minor); } + m_clientProperties = new Hashtable(m_factory.ClientProperties); + // FIXME: check that PLAIN is supported. // FIXME: parse out locales properly! - ConnectionTuneDetails connectionTune = - m_model0.ConnectionStartOk(BuildClientPropertiesTable(), + ConnectionTuneDetails connectionTune = default(ConnectionTuneDetails); + try + { + connectionTune = + m_model0.ConnectionStartOk(m_clientProperties, "PLAIN", - Encoding.UTF8.GetBytes("\0" + m_parameters.UserName + - "\0" + m_parameters.Password), + Encoding.UTF8.GetBytes( + "\0" + m_factory.UserName + + "\0" + m_factory.Password), "en_US"); + } + catch (OperationInterruptedException e) + { + throw new PossibleAuthenticationFailureException( + "Possibly caused by authentication failure", e); + } - ushort channelMax = (ushort) NegotiatedMaxValue(m_parameters.RequestedChannelMax, + ushort channelMax = (ushort) NegotiatedMaxValue(m_factory.RequestedChannelMax, connectionTune.m_channelMax); - ChannelMax = channelMax; + m_sessionManager = new SessionManager(this, channelMax); - uint frameMax = NegotiatedMaxValue(m_parameters.RequestedFrameMax, + uint frameMax = NegotiatedMaxValue(m_factory.RequestedFrameMax, connectionTune.m_frameMax); FrameMax = frameMax; - ushort heartbeat = (ushort) NegotiatedMaxValue(m_parameters.RequestedHeartbeat, + ushort heartbeat = (ushort) NegotiatedMaxValue(m_factory.RequestedHeartbeat, connectionTune.m_heartbeat); Heartbeat = heartbeat; @@ -979,7 +1029,7 @@ namespace RabbitMQ.Client.Impl frameMax, heartbeat); - string knownHosts = m_model0.ConnectionOpen(m_parameters.VirtualHost, + string knownHosts = m_model0.ConnectionOpen(m_factory.VirtualHost, "", // FIXME: make configurable? insist); KnownHosts = AmqpTcpEndpoint.ParseMultiple(Protocol, knownHosts); diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/ConnectionStartDetails.cs b/mcs/class/RabbitMQ.Client/src/client/impl/ConnectionStartDetails.cs index a7e7199e915..53e9c3ede1e 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/ConnectionStartDetails.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/ConnectionStartDetails.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/ContentHeaderBase.cs b/mcs/class/RabbitMQ.Client/src/client/impl/ContentHeaderBase.cs index 0ddbffb4ad1..7ac076cd8c5 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/ContentHeaderBase.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/ContentHeaderBase.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -62,33 +62,18 @@ namespace RabbitMQ.Client.Impl { public abstract class ContentHeaderBase : IContentHeader { - public static uint MaximumPermittedReceivableBodySize = 32 * 1048576; // FIXME: configurable - public abstract int ProtocolClassId { get; } public abstract string ProtocolClassName { get; } public abstract void ReadPropertiesFrom(ContentHeaderPropertyReader reader); public abstract void WritePropertiesTo(ContentHeaderPropertyWriter writer); public abstract void AppendPropertyDebugStringTo(System.Text.StringBuilder sb); - ///Fill this instance from the given byte buffer - ///stream. Throws BodyTooLongException, which is the reason - ///for the channelNumber parameter. - /// - /// - /// It might be better to do the body length check in our - /// caller, currently CommandAssembler, which would avoid - /// passing in the otherwise unrequired channelNumber - /// parameter. - /// - /// - public ulong ReadFrom(int channelNumber, NetworkBinaryReader reader) + ///Fill this instance from the given byte buffer stream. + /// + public ulong ReadFrom(NetworkBinaryReader reader) { reader.ReadUInt16(); // weight - not currently used ulong bodySize = reader.ReadUInt64(); - if (bodySize > MaximumPermittedReceivableBodySize) - { - throw new BodyTooLongException(channelNumber, bodySize); - } ReadPropertiesFrom(new ContentHeaderPropertyReader(reader)); return bodySize; } @@ -99,5 +84,10 @@ namespace RabbitMQ.Client.Impl writer.Write((ulong)bodySize); WritePropertiesTo(new ContentHeaderPropertyWriter(writer)); } + + public virtual object Clone() + { + throw new NotImplementedException(); + } } } diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/ContentHeaderPropertyReader.cs b/mcs/class/RabbitMQ.Client/src/client/impl/ContentHeaderPropertyReader.cs index d887a46148a..9ecb748618e 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/ContentHeaderPropertyReader.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/ContentHeaderPropertyReader.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/ContentHeaderPropertyWriter.cs b/mcs/class/RabbitMQ.Client/src/client/impl/ContentHeaderPropertyWriter.cs index 003fdb01735..0cd48b7668a 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/ContentHeaderPropertyWriter.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/ContentHeaderPropertyWriter.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/FileProperties.cs b/mcs/class/RabbitMQ.Client/src/client/impl/FileProperties.cs index af879d66a5a..2b92b2318b4 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/FileProperties.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/FileProperties.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -80,5 +80,28 @@ namespace RabbitMQ.Client.Impl public abstract void ClearFilename(); public abstract void ClearTimestamp(); public abstract void ClearClusterId(); + + public abstract bool IsContentTypePresent(); + public abstract bool IsContentEncodingPresent(); + public abstract bool IsHeadersPresent(); + public abstract bool IsPriorityPresent(); + public abstract bool IsReplyToPresent(); + public abstract bool IsMessageIdPresent(); + public abstract bool IsFilenamePresent(); + public abstract bool IsTimestampPresent(); + public abstract bool IsClusterIdPresent(); + + public override object Clone() + { + FileProperties clone = MemberwiseClone() as FileProperties; + if (IsHeadersPresent()) + { + clone.Headers = new Hashtable(); + foreach (DictionaryEntry entry in Headers) + clone.Headers[entry.Key] = entry.Value; + } + + return clone; + } } } diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/Frame.cs b/mcs/class/RabbitMQ.Client/src/client/impl/Frame.cs index 9168f057530..ea8cbbc5844 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/Frame.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/Frame.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -56,6 +56,7 @@ //--------------------------------------------------------------------------- using System; using System.IO; +using System.Net.Sockets; using RabbitMQ.Util; using RabbitMQ.Client.Exceptions; @@ -103,7 +104,21 @@ namespace RabbitMQ.Client.Impl int type; int channel; - type = reader.ReadByte(); + try + { + type = reader.ReadByte(); + } + catch (IOException ioe) + { + // If it's a WSAETIMEDOUT SocketException, unwrap it. + // This might happen when the limit of half-open connections is + // reached. + if (ioe.InnerException == null || + !(ioe.InnerException is SocketException) || + ((SocketException)ioe.InnerException).SocketErrorCode != SocketError.TimedOut) + throw ioe; + throw ioe.InnerException; + } if (type == 'A') { @@ -177,11 +192,11 @@ namespace RabbitMQ.Client.Impl public void WriteTo(NetworkBinaryWriter writer) { FinishWriting(); - writer.Write((byte)m_type); - writer.Write((ushort)m_channel); - writer.Write((uint)m_payload.Length); - writer.Write((byte[])m_payload); - writer.Write((byte)CommonFraming.Constants.FrameEnd); + writer.Write((byte) m_type); + writer.Write((ushort) m_channel); + writer.Write((uint) m_payload.Length); + writer.Write((byte[]) m_payload); + writer.Write((byte) CommonFraming.Constants.FrameEnd); } public NetworkBinaryReader GetReader() diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/HardProtocolException.cs b/mcs/class/RabbitMQ.Client/src/client/impl/HardProtocolException.cs index 20a3c9b9592..e94d784a704 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/HardProtocolException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/HardProtocolException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/IFrameHandler.cs b/mcs/class/RabbitMQ.Client/src/client/impl/IFrameHandler.cs index 2da37714e69..be26c652817 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/IFrameHandler.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/IFrameHandler.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/IRpcContinuation.cs b/mcs/class/RabbitMQ.Client/src/client/impl/IRpcContinuation.cs index b535d7787c1..217aa169cd6 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/IRpcContinuation.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/IRpcContinuation.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/ISession.cs b/mcs/class/RabbitMQ.Client/src/client/impl/ISession.cs index 0a393107c5a..65fc4fdcd0f 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/ISession.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/ISession.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/MainSession.cs b/mcs/class/RabbitMQ.Client/src/client/impl/MainSession.cs index 9c185978060..7898e17fd85 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/MainSession.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/MainSession.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/MalformedFrameException.cs b/mcs/class/RabbitMQ.Client/src/client/impl/MalformedFrameException.cs index 98ee6058378..a5e031dd2a6 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/MalformedFrameException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/MalformedFrameException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/MethodArgumentReader.cs b/mcs/class/RabbitMQ.Client/src/client/impl/MethodArgumentReader.cs index 1be72847c3a..3a10e284723 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/MethodArgumentReader.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/MethodArgumentReader.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/MethodArgumentWriter.cs b/mcs/class/RabbitMQ.Client/src/client/impl/MethodArgumentWriter.cs index e36a38281c6..1c7c8aa580a 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/MethodArgumentWriter.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/MethodArgumentWriter.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/MethodBase.cs b/mcs/class/RabbitMQ.Client/src/client/impl/MethodBase.cs index fac81aeb85e..ba4ab009243 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/MethodBase.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/MethodBase.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/ModelBase.cs b/mcs/class/RabbitMQ.Client/src/client/impl/ModelBase.cs index 055b51e80a0..78b8cdc2e17 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/ModelBase.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/ModelBase.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -57,6 +57,7 @@ using System; using System.IO; using System.Collections; +using System.Diagnostics; using System.Threading; using RabbitMQ.Client; @@ -69,7 +70,6 @@ using RabbitMQ.Util; // we support*. Obviously we may need to revisit this if that ever // changes. using CommonFraming = RabbitMQ.Client.Framing.v0_9; -using System.Diagnostics; namespace RabbitMQ.Client.Impl { @@ -808,7 +808,7 @@ namespace RabbitMQ.Client.Impl public void Close() { - Close(200, "Goodbye"); + Close(CommonFraming.Constants.ReplySuccess, "Goodbye"); } public void Close(ushort replyCode, string replyText) @@ -818,7 +818,7 @@ namespace RabbitMQ.Client.Impl public void Abort() { - Abort(200, "Goodbye"); + Abort(CommonFraming.Constants.ReplySuccess, "Goodbye"); } public void Abort(ushort replyCode, string replyText) diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/ProtocolException.cs b/mcs/class/RabbitMQ.Client/src/client/impl/ProtocolException.cs index df688b237ff..d202b8db004 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/ProtocolException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/ProtocolException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/QuiescingSession.cs b/mcs/class/RabbitMQ.Client/src/client/impl/QuiescingSession.cs index 889a2fa1f9b..8d8152db47e 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/QuiescingSession.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/QuiescingSession.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/RedirectException.cs b/mcs/class/RabbitMQ.Client/src/client/impl/RedirectException.cs index 74b28c1a4a8..db402d8ef6b 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/RedirectException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/RedirectException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/RpcContinuationQueue.cs b/mcs/class/RabbitMQ.Client/src/client/impl/RpcContinuationQueue.cs index 2263536b6f4..c69344bfb5f 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/RpcContinuationQueue.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/RpcContinuationQueue.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/Session.cs b/mcs/class/RabbitMQ.Client/src/client/impl/Session.cs index fdc280851fc..6766c919ab4 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/Session.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/Session.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/SessionBase.cs b/mcs/class/RabbitMQ.Client/src/client/impl/SessionBase.cs index b30d33ecd10..9df784aefbb 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/SessionBase.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/SessionBase.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/SessionManager.cs b/mcs/class/RabbitMQ.Client/src/client/impl/SessionManager.cs index 4ace62ae63f..9ccf1caeb80 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/SessionManager.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/SessionManager.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -62,30 +62,27 @@ using RabbitMQ.Client; using RabbitMQ.Client.Exceptions; using RabbitMQ.Util; +// We use spec version 0-9 for common constants such as frame types, +// error codes, and the frame end byte, since they don't vary *within +// the versions we support*. Obviously we may need to revisit this if +// that ever changes. +using CommonFraming = RabbitMQ.Client.Framing.v0_9; + namespace RabbitMQ.Client.Impl { public class SessionManager { private readonly Hashtable m_sessionMap = new Hashtable(); private readonly ConnectionBase m_connection; - private ushort m_channelMax = 0; + private readonly IntAllocator Ints; + public readonly ushort ChannelMax; private bool m_autoClose = false; - public SessionManager(ConnectionBase connection) + public SessionManager(ConnectionBase connection, ushort channelMax) { m_connection = connection; - } - - public ushort ChannelMax - { - get - { - return m_channelMax; - } - set - { - m_channelMax = value; - } + ChannelMax = (channelMax == 0) ? ushort.MaxValue : channelMax; + Ints = new IntAllocator(1, ChannelMax); } public bool AutoClose @@ -121,30 +118,36 @@ namespace RabbitMQ.Client.Impl { lock (m_sessionMap) { - int channelNumber = Allocate(); + int channelNumber = Ints.Allocate(); if (channelNumber == -1) { throw new ChannelAllocationException(); } - return Create(channelNumber); + return CreateInternal(channelNumber); } } public ISession Create(int channelNumber) { - ISession session; lock (m_sessionMap) { - if (m_sessionMap.ContainsKey(channelNumber)) + if (!Ints.Reserve(channelNumber)) { throw new ChannelAllocationException(channelNumber); } - session = new Session(m_connection, channelNumber); + return CreateInternal(channelNumber); + } + } + + public ISession CreateInternal(int channelNumber) + { + lock(m_sessionMap) + { + ISession session = new Session(m_connection, channelNumber); session.SessionShutdown += new SessionShutdownEventHandler(HandleSessionShutdown); - //Console.WriteLine("SessionManager adding session "+session); m_sessionMap[channelNumber] = session; + return session; } - return session; } ///Replace an active session slot with a new ISession @@ -165,30 +168,13 @@ namespace RabbitMQ.Client.Impl } } - ///Find an unused channel number. Must be called - ///while holding m_sessionMap lock! - /// - /// Returns -1 if no unused channel numbers are available. - /// - public int Allocate() - { - ushort maxChannels = (m_channelMax == 0) ? ushort.MaxValue : m_channelMax; - for (int candidate = 1; candidate <= maxChannels; candidate++) - { - if (!m_sessionMap.ContainsKey(candidate)) - { - return candidate; - } - } - return -1; - } - public void HandleSessionShutdown(ISession session, ShutdownEventArgs reason) { //Console.WriteLine("SessionManager removing session "+session); lock (m_sessionMap) { m_sessionMap.Remove(session.ChannelNumber); + Ints.Free(session.ChannelNumber); CheckAutoClose(); } } @@ -223,7 +209,7 @@ namespace RabbitMQ.Client.Impl ///when we decide to close the connection. public void AutoCloseConnection() { - m_connection.Abort(200, "AutoClose", ShutdownInitiator.Library, Timeout.Infinite); + m_connection.Abort(CommonFraming.Constants.ReplySuccess, "AutoClose", ShutdownInitiator.Library, Timeout.Infinite); } } } diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/ShutdownContinuation.cs b/mcs/class/RabbitMQ.Client/src/client/impl/ShutdownContinuation.cs index f17e28955e4..593f582060b 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/ShutdownContinuation.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/ShutdownContinuation.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/SimpleBlockingRpcContinuation.cs b/mcs/class/RabbitMQ.Client/src/client/impl/SimpleBlockingRpcContinuation.cs index c760f1b24f8..173d4dcf755 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/SimpleBlockingRpcContinuation.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/SimpleBlockingRpcContinuation.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/SocketFrameHandler_0_9.cs b/mcs/class/RabbitMQ.Client/src/client/impl/SocketFrameHandler_0_9.cs index 9d37bc7c772..cd5d4391912 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/SocketFrameHandler_0_9.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/SocketFrameHandler_0_9.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -82,8 +82,16 @@ namespace RabbitMQ.Client.Impl m_socket.NoDelay = true; Stream netstream = m_socket.GetStream(); - m_reader = new NetworkBinaryReader(netstream); - m_writer = new NetworkBinaryWriter(netstream); + if (endpoint.Ssl.Enabled) { + try { + netstream = SslHelper.TcpUpgrade(netstream, endpoint.Ssl); + } catch (Exception) { + Close(); + throw; + } + } + m_reader = new NetworkBinaryReader(new BufferedStream(netstream)); + m_writer = new NetworkBinaryWriter(new BufferedStream(netstream)); } public AmqpTcpEndpoint Endpoint @@ -115,6 +123,7 @@ namespace RabbitMQ.Client.Impl m_writer.Write((byte)1); m_writer.Write((byte)m_endpoint.Protocol.MajorVersion); m_writer.Write((byte)m_endpoint.Protocol.MinorVersion); + m_writer.Flush(); } } @@ -122,7 +131,7 @@ namespace RabbitMQ.Client.Impl { lock (m_reader) { - return Frame.ReadFrom(m_reader); + return Frame.ReadFrom(m_reader); } } @@ -131,6 +140,7 @@ namespace RabbitMQ.Client.Impl lock (m_writer) { frame.WriteTo(m_writer); + m_writer.Flush(); //Console.WriteLine("OUTBOUND:"); //DebugUtil.DumpProperties(frame, Console.Out, 2); } diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/SoftProtocolException.cs b/mcs/class/RabbitMQ.Client/src/client/impl/SoftProtocolException.cs index 88f2ad41590..1569fa4fed4 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/SoftProtocolException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/SoftProtocolException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/StreamProperties.cs b/mcs/class/RabbitMQ.Client/src/client/impl/StreamProperties.cs index 5bb70bf2813..75dfa38d2c0 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/StreamProperties.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/StreamProperties.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -72,5 +72,24 @@ namespace RabbitMQ.Client.Impl public abstract void ClearHeaders(); public abstract void ClearPriority(); public abstract void ClearTimestamp(); + + public abstract bool IsContentTypePresent(); + public abstract bool IsContentEncodingPresent(); + public abstract bool IsHeadersPresent(); + public abstract bool IsPriorityPresent(); + public abstract bool IsTimestampPresent(); + + public override object Clone() + { + StreamProperties clone = MemberwiseClone() as StreamProperties; + if (IsHeadersPresent()) + { + clone.Headers = new Hashtable(); + foreach (DictionaryEntry entry in Headers) + clone.Headers[entry.Key] = entry.Value; + } + + return clone; + } } } diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/SyntaxError.cs b/mcs/class/RabbitMQ.Client/src/client/impl/SyntaxError.cs index ebcac39153f..1905ccfc99c 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/SyntaxError.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/SyntaxError.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/UnexpectedFrameException.cs b/mcs/class/RabbitMQ.Client/src/client/impl/UnexpectedFrameException.cs index 86bbb6a0446..2a2b7bfd18d 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/UnexpectedFrameException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/UnexpectedFrameException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/UnknownClassOrMethodException.cs b/mcs/class/RabbitMQ.Client/src/client/impl/UnknownClassOrMethodException.cs index e7507d0cdef..452f5fbce19 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/UnknownClassOrMethodException.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/UnknownClassOrMethodException.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/WireFormatting.cs b/mcs/class/RabbitMQ.Client/src/client/impl/WireFormatting.cs index 0defc4ea62c..3da50069962 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/WireFormatting.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/WireFormatting.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -128,7 +128,7 @@ namespace RabbitMQ.Client.Impl /// /// Supports the AMQP 0-8/0-9 standard entry types S, I, D, T /// and F, as well as the QPid-0-8 specific b, d, f, l, s, t, - /// x and V types. + /// x and V types and the AMQP 0-9-1 A type. /// public static IDictionary ReadTable(NetworkBinaryReader reader) { @@ -140,10 +140,36 @@ namespace RabbitMQ.Client.Impl while ((backingStream.Position - startPosition) < tableLength) { string key = ReadShortstr(reader); - object value = null; + object value = ReadFieldValue(reader); + + if (!table.ContainsKey(key)) + { + table[key] = value; + } + } - byte discriminator = reader.ReadByte(); - switch ((char)discriminator) + return table; + } + + public static IList ReadArray(NetworkBinaryReader reader) + { + IList array = new ArrayList(); + long arrayLength = reader.ReadUInt32(); + Stream backingStream = reader.BaseStream; + long startPosition = backingStream.Position; + while ((backingStream.Position - startPosition) < arrayLength) + { + object value = ReadFieldValue(reader); + array.Add(value); + } + return array; + } + + public static object ReadFieldValue(NetworkBinaryReader reader) + { + object value = null; + byte discriminator = reader.ReadByte(); + switch ((char)discriminator) { case 'S': value = ReadLongstr(reader); @@ -161,6 +187,9 @@ namespace RabbitMQ.Client.Impl value = ReadTable(reader); break; + case 'A': + value = ReadArray(reader); + break; case 'b': value = ReadOctet(reader); break; @@ -190,16 +219,9 @@ namespace RabbitMQ.Client.Impl throw new SyntaxError("Unrecognised type in table: " + (char) discriminator); } - - if (!table.ContainsKey(key)) - { - table[key] = value; - } - } - - return table; + return value; } - + public static AmqpTimestamp ReadTimestamp(NetworkBinaryReader reader) { ulong stamp = ReadLonglong(reader); @@ -290,7 +312,7 @@ namespace RabbitMQ.Client.Impl /// /// Supports the AMQP 0-8/0-9 standard entry types S, I, D, T /// and F, as well as the QPid-0-8 specific b, d, f, l, s, t - /// x and V types. + /// x and V types and the AMQP 0-9-1 A type. /// /// public static void WriteTable(NetworkBinaryWriter writer, IDictionary val) @@ -309,81 +331,7 @@ namespace RabbitMQ.Client.Impl { WriteShortstr(writer, (string)entry.Key); object value = entry.Value; - - if (value == null) - { - WriteOctet(writer, (byte)'V'); - } - else if (value is string) - { - WriteOctet(writer, (byte)'S'); - WriteLongstr(writer, Encoding.UTF8.GetBytes((string)value)); - } - else if (value is byte[]) - { - WriteOctet(writer, (byte)'S'); - WriteLongstr(writer, (byte[])value); - } - else if (value is int) - { - WriteOctet(writer, (byte)'I'); - writer.Write((int)value); - } - else if (value is decimal) - { - WriteOctet(writer, (byte)'D'); - WriteDecimal(writer, (decimal)value); - } - else if (value is AmqpTimestamp) - { - WriteOctet(writer, (byte)'T'); - WriteTimestamp(writer, (AmqpTimestamp)value); - } - else if (value is IDictionary) - { - WriteOctet(writer, (byte)'F'); - WriteTable(writer, (IDictionary)value); - } - else if (value is byte) - { - WriteOctet(writer, (byte)'b'); - WriteOctet(writer, (byte)value); - } - else if (value is double) - { - WriteOctet(writer, (byte)'d'); - writer.Write((double)value); - } - else if (value is float) - { - WriteOctet(writer, (byte)'f'); - writer.Write((float)value); - } - else if (value is long) - { - WriteOctet(writer, (byte)'l'); - writer.Write((long)value); - } - else if (value is short) - { - WriteOctet(writer, (byte)'s'); - writer.Write((short)value); - } - else if (value is bool) - { - WriteOctet(writer, (byte)'t'); - WriteOctet(writer, (byte)(((bool)value) ? 1 : 0)); - } - else if (value is BinaryTableValue) - { - WriteOctet(writer, (byte)'x'); - WriteLongstr(writer, ((BinaryTableValue)value).Bytes); - } - else - { - throw new WireFormattingException("Value cannot appear as table value", - value); - } + WriteFieldValue(writer, value); } // Now, backpatch the table length. @@ -395,6 +343,112 @@ namespace RabbitMQ.Client.Impl } } + public static void WriteArray(NetworkBinaryWriter writer, IList val) + { + if (val == null) + { + writer.Write((uint)0); + } + else + { + Stream backingStream = writer.BaseStream; + long patchPosition = backingStream.Position; + writer.Write((uint)0); // length of table - will be backpatched + foreach (object entry in val) + { + WriteFieldValue(writer, entry); + } + long savedPosition = backingStream.Position; + long tableLength = savedPosition - patchPosition - 4; // offset for length word + backingStream.Seek(patchPosition, SeekOrigin.Begin); + writer.Write((uint)tableLength); + backingStream.Seek(savedPosition, SeekOrigin.Begin); + } + } + + public static void WriteFieldValue(NetworkBinaryWriter writer, object value) + { + if (value == null) + { + WriteOctet(writer, (byte)'V'); + } + else if (value is string) + { + WriteOctet(writer, (byte)'S'); + WriteLongstr(writer, Encoding.UTF8.GetBytes((string)value)); + } + else if (value is byte[]) + { + WriteOctet(writer, (byte)'S'); + WriteLongstr(writer, (byte[])value); + } + else if (value is int) + { + WriteOctet(writer, (byte)'I'); + writer.Write((int)value); + } + else if (value is decimal) + { + WriteOctet(writer, (byte)'D'); + WriteDecimal(writer, (decimal)value); + } + else if (value is AmqpTimestamp) + { + WriteOctet(writer, (byte)'T'); + WriteTimestamp(writer, (AmqpTimestamp)value); + } + else if (value is IDictionary) + { + WriteOctet(writer, (byte)'F'); + WriteTable(writer, (IDictionary)value); + } + else if (value is IList) + { + WriteOctet(writer, (byte)'A'); + WriteArray(writer, (IList)value); + } + else if (value is byte) + { + WriteOctet(writer, (byte)'b'); + WriteOctet(writer, (byte)value); + } + else if (value is double) + { + WriteOctet(writer, (byte)'d'); + writer.Write((double)value); + } + else if (value is float) + { + WriteOctet(writer, (byte)'f'); + writer.Write((float)value); + } + else if (value is long) + { + WriteOctet(writer, (byte)'l'); + writer.Write((long)value); + } + else if (value is short) + { + WriteOctet(writer, (byte)'s'); + writer.Write((short)value); + } + else if (value is bool) + { + WriteOctet(writer, (byte)'t'); + WriteOctet(writer, (byte)(((bool)value) ? 1 : 0)); + } + else if (value is BinaryTableValue) + { + WriteOctet(writer, (byte)'x'); + WriteLongstr(writer, ((BinaryTableValue)value).Bytes); + } + else + { + throw new WireFormattingException("Value cannot appear as table value", + value); + } + } + public static void WriteTimestamp(NetworkBinaryWriter writer, AmqpTimestamp val) { // 0-9 is afaict silent on the signedness of the timestamp. diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/v0_8/Connection.cs b/mcs/class/RabbitMQ.Client/src/client/impl/v0_8/Connection.cs index 1fdbe83fe81..2fcbc45bbf0 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/v0_8/Connection.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/v0_8/Connection.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -59,7 +59,7 @@ using RabbitMQ.Client.Impl; namespace RabbitMQ.Client.Framing.Impl.v0_8 { public class Connection: ConnectionBase { - public Connection(ConnectionParameters parameters, bool insist, IFrameHandler frameHandler) - : base(parameters, insist, frameHandler) {} + public Connection(ConnectionFactory factory, bool insist, IFrameHandler frameHandler) + : base(factory, insist, frameHandler) {} } } diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/v0_8/ProtocolBase.cs b/mcs/class/RabbitMQ.Client/src/client/impl/v0_8/ProtocolBase.cs index 71a1e977aba..43bbb56570f 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/v0_8/ProtocolBase.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/v0_8/ProtocolBase.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -69,11 +69,11 @@ namespace RabbitMQ.Client.Framing.Impl.v0_8 { return new Model(session); } - public override IConnection CreateConnection(ConnectionParameters parameters, + public override IConnection CreateConnection(ConnectionFactory factory, bool insist, IFrameHandler frameHandler) { - return new Connection(parameters, insist, frameHandler); + return new Connection(factory, insist, frameHandler); } public override void CreateConnectionClose(ushort reasonCode, diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/v0_8qpid/Connection.cs b/mcs/class/RabbitMQ.Client/src/client/impl/v0_8qpid/Connection.cs index 22280b26bad..5cdaeb1bc49 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/v0_8qpid/Connection.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/v0_8qpid/Connection.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -59,7 +59,7 @@ using RabbitMQ.Client.Impl; namespace RabbitMQ.Client.Framing.Impl.v0_8qpid { public class Connection: ConnectionBase { - public Connection(ConnectionParameters parameters, bool insist, IFrameHandler frameHandler) - : base(parameters, insist, frameHandler) {} + public Connection(ConnectionFactory factory , bool insist, IFrameHandler frameHandler) + : base(factory, insist, frameHandler) {} } } diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/v0_8qpid/ProtocolBase.cs b/mcs/class/RabbitMQ.Client/src/client/impl/v0_8qpid/ProtocolBase.cs index 550951a559d..b756929b5ff 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/v0_8qpid/ProtocolBase.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/v0_8qpid/ProtocolBase.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -69,11 +69,11 @@ namespace RabbitMQ.Client.Framing.Impl.v0_8qpid { return new Model(session); } - public override IConnection CreateConnection(ConnectionParameters parameters, + public override IConnection CreateConnection(ConnectionFactory factory, bool insist, IFrameHandler frameHandler) { - return new Connection(parameters, insist, frameHandler); + return new Connection(factory, insist, frameHandler); } public override void CreateConnectionClose(ushort reasonCode, diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/v0_9/Connection.cs b/mcs/class/RabbitMQ.Client/src/client/impl/v0_9/Connection.cs index b30b01f94c5..c83e067b394 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/v0_9/Connection.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/v0_9/Connection.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -59,7 +59,7 @@ using RabbitMQ.Client.Impl; namespace RabbitMQ.Client.Framing.Impl.v0_9 { public class Connection: ConnectionBase { - public Connection(ConnectionParameters parameters, bool insist, IFrameHandler frameHandler) - : base(parameters, insist, frameHandler) {} + public Connection(ConnectionFactory factory, bool insist, IFrameHandler frameHandler) + : base(factory, insist, frameHandler) {} } } diff --git a/mcs/class/RabbitMQ.Client/src/client/impl/v0_9/ProtocolBase.cs b/mcs/class/RabbitMQ.Client/src/client/impl/v0_9/ProtocolBase.cs index bc6a01049da..3c62c475f30 100644 --- a/mcs/class/RabbitMQ.Client/src/client/impl/v0_9/ProtocolBase.cs +++ b/mcs/class/RabbitMQ.Client/src/client/impl/v0_9/ProtocolBase.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -69,11 +69,11 @@ namespace RabbitMQ.Client.Framing.Impl.v0_9 { return new Model(session); } - public override IConnection CreateConnection(ConnectionParameters parameters, + public override IConnection CreateConnection(ConnectionFactory factory, bool insist, IFrameHandler frameHandler) { - return new Connection(parameters, insist, frameHandler); + return new Connection(factory, insist, frameHandler); } public override void CreateConnectionClose(ushort reasonCode, diff --git a/mcs/class/RabbitMQ.Client/src/client/messagepatterns/SimpleRpcClient.cs b/mcs/class/RabbitMQ.Client/src/client/messagepatterns/SimpleRpcClient.cs index c1cb54fa9a1..e0c0513bb8b 100644 --- a/mcs/class/RabbitMQ.Client/src/client/messagepatterns/SimpleRpcClient.cs +++ b/mcs/class/RabbitMQ.Client/src/client/messagepatterns/SimpleRpcClient.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/messagepatterns/SimpleRpcServer.cs b/mcs/class/RabbitMQ.Client/src/client/messagepatterns/SimpleRpcServer.cs index baaf8fb8455..0e4d3d620e8 100644 --- a/mcs/class/RabbitMQ.Client/src/client/messagepatterns/SimpleRpcServer.cs +++ b/mcs/class/RabbitMQ.Client/src/client/messagepatterns/SimpleRpcServer.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/client/messagepatterns/Subscription.cs b/mcs/class/RabbitMQ.Client/src/client/messagepatterns/Subscription.cs index 956fb360ecd..4635a7276b9 100644 --- a/mcs/class/RabbitMQ.Client/src/client/messagepatterns/Subscription.cs +++ b/mcs/class/RabbitMQ.Client/src/client/messagepatterns/Subscription.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -98,10 +98,12 @@ namespace RabbitMQ.Client.MessagePatterns { public IModel Model { get { return m_model; } } protected string m_queueName; - protected QueueingBasicConsumer m_consumer; - protected string m_consumerTag; protected bool m_noAck; - protected bool m_shouldDelete; + + protected readonly object m_consumerLock = new object(); + protected volatile QueueingBasicConsumer m_consumer; + protected string m_consumerTag; + protected volatile bool m_shouldDelete; ///Retrieve the queue name we have subscribed to. May ///be a server-generated name, depending on how the @@ -127,17 +129,18 @@ namespace RabbitMQ.Client.MessagePatterns { protected BasicDeliverEventArgs m_latestEvent; ///Returns the most recent value returned by Next(), - ///or null when either no values have been retrieved yet, or - ///the most recent value has already been Ack()ed. See also - ///the documentation for Ack(). + ///or null when either no values have been retrieved yet, the + ///end of the subscription has been reached, or the most + ///recent value has already been Ack()ed. See also the + ///documentation for Ack(). public BasicDeliverEventArgs LatestEvent { get { return m_latestEvent; } } ///Creates a new Subscription in "noAck" mode, - ///consuming from a fresh, autodelete, anonymous queue. The - ///name of the queue can be retrieved using the QueueName - ///property of the Subscription. After creating the queue, the - ///queue is bound to the named exchange, using Bind() with the - ///given routingKey bind parameter. + ///consuming from a fresh, exclusive, autodelete, anonymous + ///queue. The name of the queue can be retrieved using the + ///QueueName property of the Subscription. After creating the + ///queue, the queue is bound to the named exchange, using + ///Bind() with the given routingKey bind parameter. public Subscription(IModel model, string exchangeName, string exchangeType, string routingKey) : this(model) @@ -146,20 +149,21 @@ namespace RabbitMQ.Client.MessagePatterns { } ///Creates a new Subscription in "noAck" mode, - ///consuming from a fresh, autodelete, anonymous queue. The - ///name of the queue can be retrieved using the QueueName - ///property of the Subscription. + ///consuming from a fresh, exclusive, autodelete, anonymous + ///queue. The name of the queue can be retrieved using the + ///QueueName property of the Subscription. public Subscription(IModel model) : this(model, null) {} ///Creates a new Subscription in "noAck" mode, ///consuming from a named queue. If the queueName parameter is - ///null or the empty-string, creates a fresh, autodelete, - ///anonymous queue; otherwise, the queue is declared using - ///IModel.QueueDeclare() before IModel.BasicConsume() is - ///called. After declaring the queue and starting the - ///consumer, the queue is bound to the named exchange, using - ///Bind() with the given routingKey bind parameter. + ///null or the empty-string, creates a fresh, exclusive, + ///autodelete, anonymous queue; otherwise, the queue is + ///declared using IModel.QueueDeclare() before + ///IModel.BasicConsume() is called. After declaring the queue + ///and starting the consumer, the queue is bound to the named + ///exchange, using Bind() with the given routingKey bind + ///parameter. public Subscription(IModel model, string queueName, string exchangeName, string exchangeType, string routingKey) : this(model, queueName) @@ -169,20 +173,20 @@ namespace RabbitMQ.Client.MessagePatterns { ///Creates a new Subscription in "noAck" mode, ///consuming from a named queue. If the queueName parameter is - ///null or the empty-string, creates a fresh, autodelete, - ///anonymous queue; otherwise, the queue is declared using - ///IModel.QueueDeclare() before IModel.BasicConsume() is - ///called. + ///null or the empty-string, creates a fresh, exclusive, + ///autodelete, anonymous queue; otherwise, the queue is + ///declared using IModel.QueueDeclare() before + ///IModel.BasicConsume() is called. public Subscription(IModel model, string queueName) : this(model, queueName, true) {} ///Creates a new Subscription, with full control over ///both "noAck" mode and the name of the queue (which, if null - ///or the empty-string, will be a fresh autodelete queue, as - ///for the other constructor overloads). After declaring the - ///queue and starting the consumer, the queue is bound to the - ///named exchange, using Bind() with the given routingKey bind - ///parameter. + ///or the empty-string, will be a fresh, exclusive, + ///autodelete, anonymous queue, as for the other constructor + ///overloads). After declaring the queue and starting the + ///consumer, the queue is bound to the named exchange, using + ///Bind() with the given routingKey bind parameter. public Subscription(IModel model, string queueName, bool noAck, string exchangeName, string exchangeType, string routingKey) : this(model, queueName, noAck) @@ -192,8 +196,9 @@ namespace RabbitMQ.Client.MessagePatterns { ///Creates a new Subscription, with full control over ///both "noAck" mode and the name of the queue (which, if null - ///or the empty-string, will be a fresh autodelete queue, as - ///for the other constructor overloads). + ///or the empty-string, will be a fresh, exclusive, + ///autodelete, anonymous queue, as for the other constructor + ///overloads). public Subscription(IModel model, string queueName, bool noAck) { m_model = model; @@ -210,30 +215,42 @@ namespace RabbitMQ.Client.MessagePatterns { } ///Closes this Subscription, cancelling the consumer - ///record in the server. If an anonymous, autodelete queue - ///(i.e., one with a server-generated name) was created during - ///construction of the Subscription, this method also deletes - ///the created queue (which is an optimisation: autodelete - ///queues will be deleted when the IModel closes in any - ///case). + ///record in the server. If an anonymous, exclusive, + ///autodelete queue (i.e., one with a server-generated name) + ///was created during construction of the Subscription, this + ///method also deletes the created queue (which is an + ///optimisation: autodelete queues will be deleted when the + ///IModel closes in any case). public void Close() { try { - if (m_consumer != null) { - m_model.BasicCancel(m_consumerTag); - } - if (m_shouldDelete) { - m_shouldDelete = false; + bool shouldCancelConsumer = false; + bool shouldDelete = false; + + lock (m_consumerLock) { + if (m_consumer != null) { + shouldCancelConsumer = true; + m_consumer = null; + } + + shouldDelete = m_shouldDelete; // We set m_shouldDelete false before attempting // the delete, because trying twice is worse than // trying once and failing. + m_shouldDelete = false; + } + + if (shouldCancelConsumer) { + m_model.BasicCancel(m_consumerTag); + m_consumerTag = null; + } + + if (shouldDelete) { m_model.QueueDelete(m_queueName, false, false, false); } } catch (OperationInterruptedException) { // We don't mind, here. } - m_consumer = null; - m_consumerTag = null; } ///Causes the queue to which we have subscribed to be @@ -317,11 +334,16 @@ namespace RabbitMQ.Client.MessagePatterns { public BasicDeliverEventArgs Next() { try { - if (m_consumer == null) { + // Alias the pointer as otherwise it may change out + // from under us by the operation of Close() from + // another thread. + QueueingBasicConsumer consumer = m_consumer; + if (consumer == null) { // Closed! - throw new InvalidOperationException(); + m_latestEvent = null; + } else { + m_latestEvent = (BasicDeliverEventArgs) consumer.Queue.Dequeue(); } - m_latestEvent = (BasicDeliverEventArgs) m_consumer.Queue.Dequeue(); } catch (EndOfStreamException) { m_latestEvent = null; } @@ -375,16 +397,21 @@ namespace RabbitMQ.Client.MessagePatterns { public bool Next(int millisecondsTimeout, out BasicDeliverEventArgs result) { try { - if (m_consumer == null) { + // Alias the pointer as otherwise it may change out + // from under us by the operation of Close() from + // another thread. + QueueingBasicConsumer consumer = m_consumer; + if (consumer == null) { // Closed! - throw new InvalidOperationException(); - } - object qValue; - if (!m_consumer.Queue.Dequeue(millisecondsTimeout, out qValue)) { - result = null; - return false; + m_latestEvent = null; + } else { + object qValue; + if (!consumer.Queue.Dequeue(millisecondsTimeout, out qValue)) { + result = null; + return false; + } + m_latestEvent = (BasicDeliverEventArgs) qValue; } - m_latestEvent = (BasicDeliverEventArgs) qValue; } catch (EndOfStreamException) { m_latestEvent = null; } diff --git a/mcs/class/RabbitMQ.Client/src/util/BlockingCell.cs b/mcs/class/RabbitMQ.Client/src/util/BlockingCell.cs index be2b64c9300..d0c379d4010 100644 --- a/mcs/class/RabbitMQ.Client/src/util/BlockingCell.cs +++ b/mcs/class/RabbitMQ.Client/src/util/BlockingCell.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/util/DebugUtil.cs b/mcs/class/RabbitMQ.Client/src/util/DebugUtil.cs index 56b49565885..b1e1a44f6e9 100644 --- a/mcs/class/RabbitMQ.Client/src/util/DebugUtil.cs +++ b/mcs/class/RabbitMQ.Client/src/util/DebugUtil.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/util/Either.cs b/mcs/class/RabbitMQ.Client/src/util/Either.cs index 492fb30dd4b..96b29117f09 100644 --- a/mcs/class/RabbitMQ.Client/src/util/Either.cs +++ b/mcs/class/RabbitMQ.Client/src/util/Either.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/util/IntAllocator.cs b/mcs/class/RabbitMQ.Client/src/util/IntAllocator.cs new file mode 100644 index 00000000000..c63d21dee8a --- /dev/null +++ b/mcs/class/RabbitMQ.Client/src/util/IntAllocator.cs @@ -0,0 +1,255 @@ +// This source code is dual-licensed under the Apache License, version +// 2.0, and the Mozilla Public License, version 1.1. +// +// The APL v2.0: +// +//--------------------------------------------------------------------------- +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial +// Technologies LLC., and Rabbit Technologies Ltd. +// +// 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. +//--------------------------------------------------------------------------- +// +// The MPL v1.1: +// +//--------------------------------------------------------------------------- +// 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.Rabbitmq.Com/mpl.Html +// +// 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 RabbitMQ .NET Client. +// +// The Initial Developers of the Original Code are LShift Ltd, +// Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd. +// +// Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd, +// Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd +// are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial +// Technologies LLC, and Rabbit Technologies Ltd. +// +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift +// Ltd. Portions created by Cohesive Financial Technologies LLC are +// Copyright (C) 2007-2010 Cohesive Financial Technologies +// LLC. Portions created by Rabbit Technologies Ltd are Copyright +// (C) 2007-2010 Rabbit Technologies Ltd. +// +// All Rights Reserved. +// +// Contributor(s): ______________________________________. +// +//--------------------------------------------------------------------------- + +using System; +using System.Collections.Generic; +using System.Text; +using System.Diagnostics; + +namespace RabbitMQ.Util +{ + + + /** + * A class for allocating integer IDs in a given range. + */ + public class IntAllocator{ + + private IntervalList Base; + + private readonly int[] unsorted; + private int unsortedCount = 0; + + /** + * A class representing a list of inclusive intervals + */ + public class IntervalList{ + public IntervalList(int start, int end){ + this.Start = start; + this.End = end; + } + + public int Start; + public int End; + + // Invariant: If Next != Null then Next.Start > this.End + 1 + public IntervalList Next; + + // Destructively merge two IntervalLists. + // Invariant: None of the Intervals in the two lists may overlap + // intervals in this list. + public static IntervalList Merge(IntervalList x, IntervalList y) + { + if(x == null) return y; + if(y == null) return x; + + if(x.End > y.Start) return Merge(y, x); + + Debug.Assert(x.End != y.Start); + + // We now have x, y non-null and x.End < y.Start. + + if(y.Start == x.End + 1) + { + // The two intervals adjoin. Merge them into one and then + // merge the tails. + x.End = y.End; + x.Next = Merge(x.Next, y.Next); + return x; + } + + // y belongs in the tail of x. + + x.Next = Merge(y, x.Next); + return x; + } + + public static IntervalList FromArray(int[] xs, int length) + { + Array.Sort(xs, 0, length); + + IntervalList result = null; + IntervalList current = null; + + int i = 0; + while(i < length){ + int start = i; + while((i < length - 1) && (xs[i + 1] == xs[i] + 1)) + i++; + + IntervalList interval = new IntervalList(xs[start], xs[i]); + + if(result == null) + { + result = interval; + current = interval; + } + else + { + current.Next = interval; + current = interval; + } + i++; + } + return result; + } + } + + /** + * Creates an IntAllocator allocating integer IDs within the inclusive range [start, end] + */ + public IntAllocator(int start, int end) + { + if(start > end) throw new ArgumentException("illegal range [" + start +", " + end + "]"); + + // Fairly arbitrary heuristic for a good size for the unsorted set. + unsorted = new int[Math.Max(32, (int)Math.Sqrt(end - start))]; + Base = new IntervalList(start, end); + } + + /** + * Allocate a fresh integer from the range, or return -1 if no more integers + * are available. This operation is guaranteed to run in O(1) + */ + public int Allocate() + { + if(unsortedCount > 0){ + return unsorted[--unsortedCount]; + } else if (Base != null) { + int result = Base.Start++; + if(Base.Start == Base.End) Base = Base.Next; + return result; + } else { + return -1; + } + } + + private void Flush() + { + if(unsortedCount > 0) + { + Base = IntervalList.Merge(Base, IntervalList.FromArray(unsorted, unsortedCount)); + unsortedCount = 0; + } + } + + + /** + * Make the provided integer available for allocation again. This operation + * runs in amortized O(sqrt(range size)) time: About every sqrt(range size) + * operations will take O(range_size + number of intervals) to complete and + * the rest run in constant time. + * + * No error checking is performed, so if you double Free or Free an integer + * that was not originally Allocated the results are undefined. Sorry. + */ + public void Free(int id) + { + if(unsortedCount >= unsorted.Length) + { + Flush(); + } + unsorted[unsortedCount++] = id; + } + + public bool Reserve(int id) + { + // We always flush before reserving because the only way to determine + // if an ID is in the unsorted array is through a linear scan. This leads + // us to the potentially expensive situation where there is a large unsorted + // array and we reserve several IDs, incurring the cost of the scan each time. + // Flushing makes sure the array is always empty and does no additional work if + // reserve is called twice. + Flush(); + + IntervalList current = Base; + + while(current != null) + { + if(current.End < id) + { + current = current.Next; + continue; + } + else if(current.Start > id) + { + return false; + } + else if(current.End == id) + { + current.End--; + } + else if(current.Start == id) + { + current.Start++; + } + else + { + // The ID is in the middle of this interval. + // We need to split the interval into two. + IntervalList rest = new IntervalList(id + 1, current.End); + current.End = id - 1; + rest.Next = current.Next; + current.Next = rest; + } + return true; + } + return false; + } + + } +} diff --git a/mcs/class/RabbitMQ.Client/src/util/NetworkBinaryReader.cs b/mcs/class/RabbitMQ.Client/src/util/NetworkBinaryReader.cs index 5d247a06119..5776f53c90d 100644 --- a/mcs/class/RabbitMQ.Client/src/util/NetworkBinaryReader.cs +++ b/mcs/class/RabbitMQ.Client/src/util/NetworkBinaryReader.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/util/NetworkBinaryWriter.cs b/mcs/class/RabbitMQ.Client/src/util/NetworkBinaryWriter.cs index 2e1399142a8..e3dd13680ad 100644 --- a/mcs/class/RabbitMQ.Client/src/util/NetworkBinaryWriter.cs +++ b/mcs/class/RabbitMQ.Client/src/util/NetworkBinaryWriter.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // diff --git a/mcs/class/RabbitMQ.Client/src/util/SharedQueue.cs b/mcs/class/RabbitMQ.Client/src/util/SharedQueue.cs index 1d45d968bc3..aba76ad5494 100644 --- a/mcs/class/RabbitMQ.Client/src/util/SharedQueue.cs +++ b/mcs/class/RabbitMQ.Client/src/util/SharedQueue.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. // @@ -61,7 +61,7 @@ using System.Threading; namespace RabbitMQ.Util { ///A thread-safe shared queue implementation. - public class SharedQueue: IDisposable { + public class SharedQueue : IEnumerable { ///The shared queue. /// ///Subclasses must ensure appropriate locking discipline when @@ -77,10 +77,10 @@ namespace RabbitMQ.Util { public SharedQueue() { } - ///Close the queue. Causes all waiting threads to be - ///interrupted (with EndOfStreamException) and all further - ///Enqueue() and Dequeue() operations to throw - ///EndOfStreamException. + ///Close the queue. Causes all further Enqueue() + ///operations to throw EndOfStreamException, and all pending + ///or subsequent Dequeue() operations to throw an + ///EndOfStreamException once the queue is empty. public void Close() { lock (m_queue) { m_isOpen = false; @@ -88,12 +88,6 @@ namespace RabbitMQ.Util { } } - ///Implement IDisposable.Dispose. Delegates directly - ///to Close(). - public void Dispose() { - Close(); - } - ///Call only when the lock on m_queue is held. /// private void EnsureIsOpen() { @@ -121,12 +115,11 @@ namespace RabbitMQ.Util { /// ///Callers of Dequeue() will block if no items are available ///until some other thread calls Enqueue() or the queue is - ///closed. If the queue is closed (by a call to Close()), this - ///method will throw EndOfStreamException. + ///closed. In the latter case this method will throw + ///EndOfStreamException. /// public object Dequeue() { lock (m_queue) { - EnsureIsOpen(); while (m_queue.Count == 0) { EnsureIsOpen(); Monitor.Wait(m_queue); @@ -151,15 +144,15 @@ namespace RabbitMQ.Util { /// whereas Dequeue() will. /// /// - /// If, at the time of call, the queue is in a closed state - /// (by a call to Close()), this method will throw - /// EndOfStreamException. + /// If at the time of call the queue is empty and in a + /// closed state (following a call to Close()), then this + /// method will throw EndOfStreamException. /// /// public object DequeueNoWait(object defaultValue) { lock (m_queue) { - EnsureIsOpen(); if (m_queue.Count == 0) { + EnsureIsOpen(); return defaultValue; } else { return m_queue.Dequeue(); @@ -197,7 +190,8 @@ namespace RabbitMQ.Util { /// System.Threading.Monitor.Wait(object,int). /// /// - /// If, at any time during the call, the queue is in or + /// If no items are present and the queue is in a closed + /// state, or if at any time while waiting the queue /// transitions to a closed state (by a call to Close()), this /// method will throw EndOfStreamException. /// @@ -210,8 +204,8 @@ namespace RabbitMQ.Util { DateTime startTime = DateTime.Now; lock (m_queue) { - EnsureIsOpen(); while (m_queue.Count == 0) { + EnsureIsOpen(); int elapsedTime = (int) ((DateTime.Now - startTime).TotalMilliseconds); int remainingTime = millisecondsTimeout - elapsedTime; if (remainingTime <= 0) { @@ -220,12 +214,61 @@ namespace RabbitMQ.Util { } Monitor.Wait(m_queue, remainingTime); - EnsureIsOpen(); } result = m_queue.Dequeue(); return true; } } + + ///Implementation of the IEnumerable interface, for + ///permitting SharedQueue to be used in foreach + ///loops. + IEnumerator IEnumerable.GetEnumerator() { + return new SharedQueueEnumerator(this); + } + + } + + ///Implementation of the IEnumerator interface, for + ///permitting SharedQueue to be used in foreach loops. + public class SharedQueueEnumerator : IEnumerator { + + protected SharedQueue m_queue; + protected object m_current; + + ///Construct an enumerator for the given + ///SharedQueue. + public SharedQueueEnumerator(SharedQueue queue) { + m_queue = queue; + } + + object IEnumerator.Current { + get { + if (m_current == null) { + throw new InvalidOperationException(); + } + return m_current; + } + } + + bool IEnumerator.MoveNext() { + try { + m_current = m_queue.Dequeue(); + return true; + } catch (EndOfStreamException) { + m_current = null; + return false; + } + } + + ///Reset()ting a SharedQueue doesn't make sense, so + ///this method always throws + ///InvalidOperationException. + void IEnumerator.Reset() { + throw new InvalidOperationException("SharedQueue.Reset() does not make sense"); + } + } + } diff --git a/mcs/class/RabbitMQ.Client/src/util/XmlUtil.cs b/mcs/class/RabbitMQ.Client/src/util/XmlUtil.cs index 576c2933a37..a064f9797aa 100644 --- a/mcs/class/RabbitMQ.Client/src/util/XmlUtil.cs +++ b/mcs/class/RabbitMQ.Client/src/util/XmlUtil.cs @@ -4,7 +4,7 @@ // The APL v2.0: // //--------------------------------------------------------------------------- -// Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial +// Copyright (C) 2007-2010 LShift Ltd., Cohesive Financial // Technologies LLC., and Rabbit Technologies Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -43,11 +43,11 @@ // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial // Technologies LLC, and Rabbit Technologies Ltd. // -// Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift +// Portions created by LShift Ltd are Copyright (C) 2007-2010 LShift // Ltd. Portions created by Cohesive Financial Technologies LLC are -// Copyright (C) 2007-2009 Cohesive Financial Technologies +// Copyright (C) 2007-2010 Cohesive Financial Technologies // LLC. Portions created by Rabbit Technologies Ltd are Copyright -// (C) 2007-2009 Rabbit Technologies Ltd. +// (C) 2007-2010 Rabbit Technologies Ltd. // // All Rights Reserved. //