Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

View File

@@ -0,0 +1,79 @@
2010-07-09 Andrew Jorgensen <ajorgensen@novell.com>
* Makefile: Fix make dist again (IntAllocator.cs)
... and fix an embarassing typo
2010-06-27 Michael Barker <mike@middlesoft.co.uk>
* docs/specs/Makefile: Added uninstall-local
2010-06-23 Michael Barker <mike@middlesoft.co.uk>
* Updated to version 1.8 of the RabbitMQ libraries
2009-12-23 Jo Shields <directhex@apebox.org>
* docs/specs/Makefile: Use compiled Mono, not system Mono (fixes
broken build on systems without Mono already installed)
2009-12-19 Michael Barker <mike@middlesoft.co.uk>
* Added stripped xml to avoid licensing issues.
2009-08-31 Michael Barker <mike@middlesoft.co.uk>
* Updated to version 1.6 of the RabbitMQ libraries
2009-05-26 Andrew Jorgensen <ajorgensen@novell.com>Rabbit
* Makefile: Fixed dist from last commit here
2009-05-25 Michael Barker <mike@middlesoft.co.uk>
* Removed amqp spec files and modified generated code to fix licensing
issues.
2009-05-21 Michael Barker <mike@middlesoft.co.uk>
* Updated to version 1.5.3 of the RabbitMQ libraries.
2008-12-09 Atsushi Enomoto <atsushi@ximian.com>
* Makefile: those paths are all wrong!
2008-12-09 Atsushi Enomoto <atsushi@ximian.com>
* Makefile: huh, more messy sources.
2008-12-09 Atsushi Enomoto <atsushi@ximian.com>
* Makefile : sigh, there was missing extension.
2008-12-08 Atsushi Enomoto <atsushi@ximian.com>
* Makefile : I find SUBDIRS almost dumb. another attempt.
2008-12-08 Atsushi Enomoto <atsushi@ximian.com>
* Makefile, src/client/Makefile : another attempt to fix build.
2008-12-08 Atsushi Enomoto <atsushi@ximian.com>
* Makefile : it was wrong fix.
2008-12-08 Atsushi Enomoto <atsushi@ximian.com>
* Makefile : add docs/specs directory, to workaround build breakage.
2008-12-07 Michael BArker <mike@middlesoft.co.uk>
* Makefile: Removed apigen, bootstrap and spec. The code for
the generated interfaces is added to source control.
2008-10-20 Atsushi Enomoto <atsushi@ximian.com>
(This ChangeLog is for Mono integration.)
Patch by Michael Barker (patches are on bug #432471). Imported
RabbitMQ.Client assembly from RabbitMQ project.
http://www.rabbitmq.com/

View File

@@ -0,0 +1,30 @@
thisdir = class/RabbitMQ.Client
SUBDIRS = src/apigen docs/specs src/client
#SUBDIRS = src/client
include ../../build/rules.make
DISTFILES = \
src/util/BlockingCell.cs \
src/util/DebugUtil.cs \
src/util/Either.cs \
src/util/IntAllocator.cs \
src/util/NetworkBinaryReader.cs \
src/util/NetworkBinaryWriter.cs \
src/util/Semaphore.cs \
src/util/SharedQueue.cs \
src/util/XmlUtil.cs \
src/apigen/AmqpClass.cs \
src/apigen/AmqpEntity.cs \
src/apigen/AmqpField.cs \
src/apigen/AmqpMethod.cs \
src/apigen/Apigen.cs \
src/apigen/Makefile \
docs/specs/amqp0-8.stripped.xml \
docs/specs/amqp0-9.stripped.xml \
docs/specs/qpid-amqp.0-8.stripped.xml \
docs/specs/Makefile
all-local install-local clean-local test-local run-test-local run-test-ondotnet-local uninstall-local doc-update-local csproj-local:
dist-local: dist-default

View File

@@ -0,0 +1,32 @@
thisdir = class/RabbitMQ.Client/docs/specs
SUBDIRS =
include ../../../../build/rules.make
all-local: $(PROFILE)-api-0-9.cs $(PROFILE)-api-0-8.cs $(PROFILE)-api-qpid-0-8.cs
$(PROFILE)-api-0-9.cs: amqp0-9.stripped.xml
MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/RabbitMQ.Client.Apigen.exe /n:v0_9 "/apiName:AMQP_0_9" $^ $@
$(PROFILE)-api-0-8.cs: amqp0-8.stripped.xml
MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/RabbitMQ.Client.Apigen.exe /n:v0_8 "/apiName:AMQP_0_8" $^ $@
$(PROFILE)-api-qpid-0-8.cs: qpid-amqp.0-8.stripped.xml
MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/RabbitMQ.Client.Apigen.exe /n:v0_8qpid "/apiName:AMQP_0_8_QPID" $^ $@
install-local:
# These are checked in, so they shouldn't be deleted
#clean-local:
# rm -f $(PROFILE)-api*.cs
test-local:
run-test-local:
run-test-ondotnet-local:
DISTFILES =
dist-local:
uninstall-local:

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,104 @@
// 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.Xml;
namespace RabbitMQ.Client.Apigen {
public class AmqpClass: AmqpEntity {
public ArrayList m_Methods;
public ArrayList m_Fields;
public AmqpClass(XmlNode n)
: base(n)
{
m_Methods = new ArrayList();
foreach (XmlNode m in n.SelectNodes("method")) {
m_Methods.Add(new AmqpMethod(m));
}
m_Fields = new ArrayList();
foreach (XmlNode f in n.SelectNodes("field")) {
m_Fields.Add(new AmqpField(f));
}
}
public int Index {
get {
return GetInt("@index");
}
}
public bool NeedsProperties {
get {
foreach (AmqpMethod m in m_Methods) {
if (m.HasContent) return true;
}
return false;
}
}
public AmqpMethod MethodNamed(string name) {
foreach (AmqpMethod m in m_Methods)
{
if (m.Name == name) {
return m;
}
}
return null;
}
}
}

View File

@@ -0,0 +1,109 @@
// 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.Xml;
namespace RabbitMQ.Client.Apigen {
public class AmqpEntity {
public XmlNode m_node;
public AmqpEntity(XmlNode n) {
m_node = n;
}
public string GetString(string path) {
return Apigen.GetString(m_node, path);
}
public string GetString(string path, string d) {
return Apigen.GetString(m_node, path, d);
}
public int GetInt(string path) {
return Apigen.GetInt(m_node, path);
}
public string Name {
get {
return GetString("@name");
}
}
public string DocumentationComment(string prefixSpaces) {
return DocumentationComment(prefixSpaces, "doc");
}
public string DocumentationCommentVariant(string prefixSpaces, string tagname) {
return DocumentationComment(prefixSpaces, "doc", tagname);
}
public string DocumentationComment(string prefixSpaces, string docXpath) {
return DocumentationComment(prefixSpaces, docXpath, "summary");
}
public string DocumentationComment(string prefixSpaces, string docXpath, string tagname) {
string docStr = GetString(docXpath, "").Trim();
if (docStr.Length > 0) {
return (prefixSpaces + "/// <"+tagname+">\n" +
GetString(docXpath, "") + "\n</"+tagname+">")
.Replace("\n", "\n" + prefixSpaces + "/// ");
} else {
return prefixSpaces + "// (no documentation)";
}
}
}
}

View File

@@ -0,0 +1,74 @@
// 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.Xml;
namespace RabbitMQ.Client.Apigen {
public class AmqpField: AmqpEntity {
public AmqpField(XmlNode n): base(n) {}
public string Domain {
get {
string result = GetString("@domain", "");
if (result.Equals("")) {
result = GetString("@type");
}
return result;
}
}
}
}

View File

@@ -0,0 +1,97 @@
// 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.Xml;
namespace RabbitMQ.Client.Apigen {
public class AmqpMethod: AmqpEntity {
public ArrayList m_Fields;
public ArrayList m_ResponseMethods;
public AmqpMethod(XmlNode n)
: base(n)
{
m_Fields = new ArrayList();
foreach (XmlNode f in n.SelectNodes("field")) {
m_Fields.Add(new AmqpField(f));
}
m_ResponseMethods = new ArrayList();
foreach (XmlNode r in n.SelectNodes("response")) {
m_ResponseMethods.Add(Apigen.GetString(r, "@name"));
}
}
public bool HasContent {
get {
return GetString("@content", null) != null;
}
}
public bool IsSimpleRpcRequest {
get {
return m_ResponseMethods.Count == 1;
}
}
public int Index {
get {
return GetInt("@index");
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,12 @@
thisdir := class/RabbitMQ.Client/src/apigen
SUBDIRS =
include ../../../../build/rules.make
PROGRAM = RabbitMQ.Client.Apigen.exe
LOCAL_MCS_FLAGS = /r:System.dll \
/r:System.Xml.dll \
/main:RabbitMQ.Client.Apigen.Apigen
include ../../../../build/executable.make

View File

@@ -0,0 +1,20 @@
Apigen.cs
AmqpClass.cs
AmqpEntity.cs
AmqpField.cs
AmqpMethod.cs
../client/api/IModel.cs
../client/api/IContentHeader.cs
../client/api/IBasicProperties.cs
../client/api/IFileProperties.cs
../client/api/IStreamProperties.cs
../client/api/AmqpTimestamp.cs
../client/api/IBasicConsumer.cs
../client/api/ShutdownEventArgs.cs
../client/api/ShutdownInitiator.cs
../client/api/PublicationAddress.cs
../client/events/BasicReturnEventArgs.cs
../client/events/BasicReturnEventHandler.cs
../client/events/CallbackExceptionEventArgs.cs
../client/events/CallbackExceptionEventHandler.cs
../client/events/ModelShutdownEventHandler.cs

View File

@@ -0,0 +1,61 @@
//
// AssemblyInfo.cs
//
// Author:
// Andreas Nahr (ClassDevelopment@A-SoftTech.com)
//
// (C) 2003 Ximian, Inc. http://www.ximian.com
//
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
using System;
using System.Reflection;
using System.Resources;
using System.Security;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about the apigen-bootstrap.dll assembly
[assembly: AssemblyTitle ("RabbitMQ.Client.dll")]
[assembly: AssemblyDescription ("RabbitMQ.Client.dll")]
[assembly: AssemblyDefaultAlias ("RabbitMQ.Client.dll")]
[assembly: AssemblyCompany (Consts.MonoCompany)]
[assembly: AssemblyProduct (Consts.MonoProduct)]
[assembly: AssemblyCopyright (Consts.MonoCopyright)]
[assembly: AssemblyVersion (Consts.FxVersion)]
[assembly: SatelliteContractVersion (Consts.FxVersion)]
[assembly: AssemblyInformationalVersion (Consts.FxFileVersion)]
[assembly: NeutralResourcesLanguage ("en-US")]
[assembly: ComVisible (false)]
//[assembly: CLSCompliant (true)]
[assembly: AssemblyDelaySign (true)]
[assembly: AssemblyKeyFile("../../../msfinal.pub")]
[assembly: AssemblyFileVersion (Consts.FxFileVersion)]
[assembly: CompilationRelaxations (CompilationRelaxations.NoStringInterning)]

View File

@@ -0,0 +1,10 @@
thisdir = class/RabbitMQ.Client/src/client
SUBDIRS =
include ../../../../build/rules.make
LIBRARY = RabbitMQ.Client.dll
LIB_MCS_FLAGS = -r:System.dll -r:System.Xml.dll -nowarn:618
NO_TEST = yes
include ../../../../build/library.make

View File

@@ -0,0 +1,125 @@
./AssemblyInfo.cs
../../../../build/common/Consts.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/PossibleAuthenticationFailureException.cs
./exceptions/WireFormattingException.cs
./exceptions/UnsupportedMethodFieldException.cs
./exceptions/ProtocolVersionMismatchException.cs
./exceptions/AlreadyClosedException.cs
./exceptions/BrokerUnreachableException.cs
./exceptions/UnsupportedMethodException.cs
./exceptions/OperationInterruptedException.cs
./messagepatterns/SimpleRpcServer.cs
./messagepatterns/Subscription.cs
./messagepatterns/SimpleRpcClient.cs
./impl/SessionBase.cs
./impl/UnexpectedFrameException.cs
./impl/ContentHeaderPropertyReader.cs
./impl/ConnectionStartDetails.cs
./impl/SessionManager.cs
./impl/AbstractProtocolBase.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/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/RedirectException.cs
./impl/SocketFrameHandler_0_9.cs
./impl/ProtocolException.cs
./impl/Frame.cs
./impl/MethodBase.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/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/SslOption.cs
./api/BinaryTableValue.cs
./api/ConnectionFactory.cs
../util/DebugUtil.cs
../util/NetworkBinaryReader.cs
../util/NetworkBinaryWriter.cs
../util/BlockingCell.cs
../util/Semaphore.cs
../util/Either.cs
../util/SharedQueue.cs
../util/XmlUtil.cs
../util/IntAllocator.cs

View File

@@ -0,0 +1,289 @@
// 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 RabbitMQ.Client.Impl;
namespace RabbitMQ.Client
{
///<summary>Represents a TCP-addressable AMQP peer, including the
///protocol variant to use, and a host name and port
///number.</summary>
///<para>
/// 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.
///</para>
public class AmqpTcpEndpoint
{
///<summary>Indicates that the default port for the protocol should be used</summary>
public const int UseDefaultPort = -1;
private IProtocol m_protocol;
///<summary>Retrieve or set the IProtocol of this AmqpTcpEndpoint.</summary>
public IProtocol Protocol
{
get { return m_protocol; }
set { m_protocol = value; }
}
private string m_hostName;
///<summary>Retrieve or set the hostname of this AmqpTcpEndpoint.</summary>
public string HostName
{
get { return m_hostName; }
set { m_hostName = value; }
}
private int m_port;
///<summary>Retrieve or set the port number of this
///AmqpTcpEndpoint. A port number of -1 causes the default
///port number for the IProtocol to be used.</summary>
public int Port
{
get { return (m_port == UseDefaultPort) ? m_protocol.DefaultPort : m_port; }
set { m_port = value; }
}
private SslOption m_ssl;
///<summary>Retrieve the SSL options for this AmqpTcpEndpoint.
///If not set, null is returned</summary>
public SslOption Ssl
{
get { return m_ssl; }
set { m_ssl = value; }
}
///<summary>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.</summary>
public AmqpTcpEndpoint(IProtocol protocol, string hostName, int portOrMinusOne, SslOption ssl)
{
m_protocol = protocol;
m_hostName = hostName;
m_port = portOrMinusOne;
m_ssl = ssl;
}
///<summary>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.</summary>
public AmqpTcpEndpoint(IProtocol protocol, string hostName, int portOrMinusOne) :
this(protocol, hostName, portOrMinusOne, new SslOption())
{
}
///<summary>Construct an AmqpTcpEndpoint with the given
///IProtocol and hostname, using the default port for the
///IProtocol.</summary>
public AmqpTcpEndpoint(IProtocol protocol, string hostName) :
this(protocol, hostName, -1)
{
}
///<summary>Construct an AmqpTcpEndpoint with the given
///IProtocol, "localhost" as the hostname, and using the
///default port for the IProtocol.</summary>
public AmqpTcpEndpoint(IProtocol protocol) :
this(protocol, "localhost", -1)
{
}
///<summary>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.</summary>
public AmqpTcpEndpoint(string hostName, int portOrMinusOne) :
this(Protocols.FromEnvironment(), hostName, portOrMinusOne)
{
}
///<summary>Construct an AmqpTcpEndpoint with the given
///hostname, using the IProtocol from
///Protocols.FromEnvironment(), and the default port number of
///that IProtocol.</summary>
public AmqpTcpEndpoint(string hostName) :
this(Protocols.FromEnvironment(), hostName)
{
}
///<summary>Construct an AmqpTcpEndpoint with a hostname of
///"localhost", using the IProtocol from
///Protocols.FromEnvironment(), and the default port number of
///that IProtocol.</summary>
public AmqpTcpEndpoint() :
this(Protocols.FromEnvironment())
{
}
///<summary>Construct an AmqpTcpEndpoint with the given
///IProtocol, Uri and ssl options.</summary>
///<remarks>
/// Please see the class overview documentation for
/// information about the Uri format in use.
///</remarks>
public AmqpTcpEndpoint(IProtocol protocol, Uri uri, SslOption ssl) :
this(protocol, uri.Host, uri.Port, ssl)
{
}
///<summary>Construct an AmqpTcpEndpoint with the given
///IProtocol and Uri.</summary>
///<remarks>
/// Please see the class overview documentation for
/// information about the Uri format in use.
///</remarks>
public AmqpTcpEndpoint(IProtocol protocol, Uri uri) :
this(protocol, uri.Host, uri.Port)
{
}
///<summary>Construct an AmqpTcpEndpoint with the given
///Uri, using the IProtocol from
///Protocols.FromEnvironment().</summary>
///<remarks>
/// Please see the class overview documentation for
/// information about the Uri format in use.
///</remarks>
public AmqpTcpEndpoint(Uri uri) :
this(Protocols.FromEnvironment(), uri)
{
}
///<summary>Returns a URI-like string of the form
///amqp-PROTOCOL://HOSTNAME:PORTNUMBER</summary>
///<remarks>
/// This method is intended mainly for debugging and logging use.
///</remarks>
public override string ToString()
{
return "amqp-" + Protocol + "://" + HostName + ":" + Port;
}
///<summary>Compares this instance by value (protocol,
///hostname, port) against another instance</summary>
public override bool Equals(object obj)
{
AmqpTcpEndpoint other = obj as AmqpTcpEndpoint;
if (other == null) return false;
if (other.Protocol != Protocol) return false;
if (other.HostName != HostName) return false;
if (other.Port != Port) return false;
return true;
}
///<summary>Implementation of hash code depending on protocol,
///hostname and port, to line up with the implementation of
///Equals()</summary>
public override int GetHashCode()
{
return
Protocol.GetHashCode() ^
HostName.GetHashCode() ^
Port;
}
///<summary>Construct an instance from a protocol and an
///address in "hostname:port" format.</summary>
///<remarks>
/// If the address string passed in contains ":", it is split
/// into a hostname and a port-number part. Otherwise, the
/// entire string is used as the hostname, and the port-number
/// is set to -1 (meaning the default number for the protocol
/// variant specified).
///</remarks>
public static AmqpTcpEndpoint Parse(IProtocol protocol, string address) {
int index = address.IndexOf(':');
if (index == -1) {
return new AmqpTcpEndpoint(protocol, address, -1);
} else {
string portStr = address.Substring(index + 1).Trim();
int portNum = (portStr.Length == 0) ? -1 : int.Parse(portStr);
return new AmqpTcpEndpoint(protocol,
address.Substring(0, index),
portNum);
}
}
///<summary>Splits the passed-in string on ",", and passes the
///substrings to AmqpTcpEndpoint.Parse()</summary>
///<remarks>
/// Accepts a string of the form "hostname:port,
/// hostname:port, ...", where the ":port" pieces are
/// optional, and returns a corresponding array of
/// AmqpTcpEndpoints.
///</remarks>
public static AmqpTcpEndpoint[] ParseMultiple(IProtocol protocol, string addresses) {
string[] partsArr = addresses.Split(new char[] { ',' });
ArrayList results = new ArrayList();
foreach (string partRaw in partsArr) {
string part = partRaw.Trim();
if (part.Length > 0) {
results.Add(Parse(protocol, part));
}
}
return (AmqpTcpEndpoint[]) results.ToArray(typeof(AmqpTcpEndpoint));
}
}
}

View File

@@ -0,0 +1,105 @@
// 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
{
// time representations in mainstream languages: the horror, the horror
// see in particular the difference between .NET 1.x and .NET 2.0's versions of DateTime
///<summary>Structure holding an AMQP timestamp, a posix 64-bit time_t.</summary>
///<remarks>
///<para>
///When converting between an AmqpTimestamp and a System.DateTime,
///be aware of the effect of your local timezone. In particular,
///different versions of the .NET framework assume different
///defaults.
///</para>
///<para>
///We have chosen a signed 64-bit time_t here, since the AMQP
///specification through versions 0-9 is silent on whether
///timestamps are signed or unsigned.
///</para>
///</remarks>
public struct AmqpTimestamp
{
private long m_unixTime;
///<summary>Construct an AmqpTimestamp holding the given time_t value.</summary>
///<remarks>
///</remarks>
public AmqpTimestamp(long unixTime)
{
m_unixTime = unixTime;
}
///<summary>Retrieve the time_t from this structure.</summary>
public long UnixTime
{
get
{
return m_unixTime;
}
}
///<summary>Provides a debugger-friendly display.</summary>
public override string ToString()
{
return "((time_t)" + m_unixTime + ")";
}
}
}

View File

@@ -0,0 +1,127 @@
// 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
{
///<summary>Represents a version of the AMQP specification.</summary>
///<remarks>
///<para>
///Vendor-specific variants of particular official specification
///versions exist: this class simply represents the AMQP
///specification version, and does not try to represent
///information about any custom variations involved.
///</para>
///<para>
///AMQP version 0-8 peers sometimes advertise themselves as
///version 8-0: for this reason, this class's constructor
///special-cases 8-0, rewriting it at construction time to be 0-8
///instead.
///</para>
///</remarks>
public class AmqpVersion
{
private readonly int m_major;
private readonly int m_minor;
///<summary>The AMQP specification major version number</summary>
public int Major { get { return m_major; } }
///<summary>The AMQP specification minor version number</summary>
public int Minor { get { return m_minor; } }
///<summary>Construct an AmqpVersion from major and minor version numbers.</summary>
///<remarks>
///Converts major=8 and minor=0 into major=0 and
///minor=8. Please see the class comment.
///</remarks>
public AmqpVersion(int major, int minor)
{
if (major == 8 && minor == 0)
{
// The AMQP 0-8 spec confusingly defines the version
// as 8-0. This maps the latter to the former, for
// cases where our peer might be confused.
major = 0;
minor = 8;
}
m_major = major;
m_minor = minor;
}
///<summary>Format appropriately for display.</summary>
///<remarks>
///The specification currently uses "MAJOR-MINOR" as a display format.
///</remarks>
public override string ToString()
{
return m_major + "-" + m_minor;
}
///<summary>Implement value-equality comparison.</summary>
public override bool Equals(object other)
{
AmqpVersion v = other as AmqpVersion;
return (v != null) && (v.m_major == m_major) && (v.m_minor == m_minor);
}
///<summary>Implement hashing as for value-equality.</summary>
public override int GetHashCode()
{
return 31 * m_major.GetHashCode() + m_minor.GetHashCode();
}
}
}

View File

@@ -0,0 +1,110 @@
// 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): ______________________________________.
//
//---------------------------------------------------------------------------
namespace RabbitMQ.Client
{
///<summary>Wrapper for a byte[]. May appear as values read from
///and written to AMQP field tables.</summary>
///<remarks>
///<para>
/// The sole reason for the existence of this class is to permit
/// encoding of byte[] as 'x' in AMQP field tables, an extension
/// to the specification that is part of the tentative JMS mapping
/// implemented by QPid.
///</para>
///<para>
/// Instances of this object may be found as values held in
/// IDictionary instances returned from
/// RabbitMQ.Client.Impl.WireFormatting.ReadTable, e.g. as part of
/// IBasicProperties.Headers tables. Likewise, instances may be
/// set as values in an IDictionary table to be encoded by
/// RabbitMQ.Client.Impl.WireFormatting.WriteTable.
///</para>
///<para>
/// When an instance of this class is encoded/decoded, the type
/// tag 'x' is used in the on-the-wire representation. The AMQP
/// standard type tag 'S' is decoded to a raw byte[], and a raw
/// byte[] is encoded as 'S'. Instances of System.String are
/// converted to a UTF-8 binary representation, and then encoded
/// using tag 'S'. In order to force the use of tag 'x', instances
/// of this class must be used.
///</para>
///</remarks>
public class BinaryTableValue
{
private byte[] m_bytes = null;
///<summary>The wrapped byte array, as decoded or as to be
///encoded.</summary>
public byte[] Bytes {
get { return m_bytes; }
set { m_bytes = value; }
}
///<summary>Constructs an instance with null for its Bytes
///property.</summary>
public BinaryTableValue()
: this(null)
{}
///<summary>Constructs an instance with the passed-in value
///for its Bytes property.</summary>
public BinaryTableValue(byte[] bytes)
{
m_bytes = bytes;
}
}
}

Some files were not shown because too many files have changed in this diff Show More