diff --git a/MassTransit.ServiceBus/Envelope.cs b/MassTransit.ServiceBus/Envelope.cs index d19b3632c7..17e604e94f 100644 --- a/MassTransit.ServiceBus/Envelope.cs +++ b/MassTransit.ServiceBus/Envelope.cs @@ -1,123 +1,136 @@ +/// Copyright 2007-2008 The Apache Software Foundation. +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); you may not use +/// this file except in compliance with the License. You may obtain a copy of the +/// License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software distributed +/// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +/// CONDITIONS OF ANY KIND, either express or implied. See the License for the +/// specific language governing permissions and limitations under the License. + using System; using MassTransit.ServiceBus.Util; namespace MassTransit.ServiceBus { - public class Envelope : - IEnvelope, IEquatable - { - private DateTime _arrivedTime; - private MessageId _correlationId = MessageId.Empty; - private MessageId _id = MessageId.Empty; - private string _label; - private IMessage[] _messages; - private bool _recoverable; - private IEndpoint _ReturnEndpoint; - private DateTime _sentTime; - private TimeSpan _timeToBeReceived = TimeSpan.MaxValue; - - public Envelope(IEndpoint returnEndpoint, params IMessage[] messages) - { - _ReturnEndpoint = returnEndpoint; - _messages = messages; - } - - public Envelope(params IMessage[] messages) - { - _messages = messages; - } - - #region IEnvelope Members - - public IMessage[] Messages - { - get { return _messages; } - set { _messages = value; } - } - - public IEndpoint ReturnEndpoint - { - get { return _ReturnEndpoint; } - set { _ReturnEndpoint = value; } - } - - public MessageId Id - { - get { return _id; } - set { _id = value; } - } - - public MessageId CorrelationId - { - get { return _correlationId; } - set { _correlationId = value; } - } - - public bool Recoverable - { - get { return _recoverable; } - set { _recoverable = value; } - } - - public TimeSpan TimeToBeReceived - { - get { return _timeToBeReceived; } - set { _timeToBeReceived = value; } - } - - public DateTime SentTime - { - get { return _sentTime; } - set { _sentTime = value; } - } - - public DateTime ArrivedTime - { - get { return _arrivedTime; } - set { _arrivedTime = value; } - } - - public string Label - { - get { return _label; } - set { _label = value; } - } - - public object Clone() - { - Envelope env = new Envelope(ReturnEndpoint, Messages); - env.ArrivedTime = ArrivedTime; - env.Id = Id; - env.CorrelationId = CorrelationId; - env.Label = Label; - env.Recoverable = Recoverable; - env.SentTime = SentTime; - env.TimeToBeReceived = TimeToBeReceived; - - return env; - } - - #endregion - - #region IEquatable Members - - public bool Equals(Envelope envelope) - { - if (envelope == null) return false; - return Equals(_id, envelope._id); - } - - #endregion - - public override bool Equals(object obj) - { - if (ReferenceEquals(this, obj)) return true; - return Equals(obj as Envelope); - } - - public override int GetHashCode() - { - return _id.GetHashCode(); - } - } + public class Envelope : + IEnvelope, IEquatable + { + private DateTime _arrivedTime; + private MessageId _correlationId = MessageId.Empty; + private MessageId _id = MessageId.Empty; + private string _label; + private IMessage[] _messages; + private bool _recoverable; + private IEndpoint _returnEndpoint; + private DateTime _sentTime; + private TimeSpan _timeToBeReceived = TimeSpan.MaxValue; + + public Envelope(IEndpoint returnEndpoint, params IMessage[] messages) + { + _returnEndpoint = returnEndpoint; + _messages = messages; + } + + public Envelope(params IMessage[] messages) + { + _messages = messages; + } + + #region IEnvelope Members + + public IMessage[] Messages + { + get { return _messages; } + set { _messages = value; } + } + + public IEndpoint ReturnEndpoint + { + get { return _returnEndpoint; } + set { _returnEndpoint = value; } + } + + public MessageId Id + { + get { return _id; } + set { _id = value; } + } + + public MessageId CorrelationId + { + get { return _correlationId; } + set { _correlationId = value; } + } + + public bool Recoverable + { + get { return _recoverable; } + set { _recoverable = value; } + } + + public TimeSpan TimeToBeReceived + { + get { return _timeToBeReceived; } + set { _timeToBeReceived = value; } + } + + public DateTime SentTime + { + get { return _sentTime; } + set { _sentTime = value; } + } + + public DateTime ArrivedTime + { + get { return _arrivedTime; } + set { _arrivedTime = value; } + } + + public string Label + { + get { return _label; } + set { _label = value; } + } + + public object Clone() + { + Envelope env = new Envelope(ReturnEndpoint, Messages); + env.ArrivedTime = ArrivedTime; + env.Id = Id; + env.CorrelationId = CorrelationId; + env.Label = Label; + env.Recoverable = Recoverable; + env.SentTime = SentTime; + env.TimeToBeReceived = TimeToBeReceived; + + return env; + } + + #endregion + + #region IEquatable Members + + public bool Equals(Envelope envelope) + { + if (envelope == null) return false; + return Equals(_id, envelope._id); + } + + #endregion + + public override bool Equals(object obj) + { + if (ReferenceEquals(this, obj)) return true; + return Equals(obj as Envelope); + } + + public override int GetHashCode() + { + return _id.GetHashCode(); + } + } } \ No newline at end of file diff --git a/MassTransit.ServiceBus/ServiceBus.cs b/MassTransit.ServiceBus/ServiceBus.cs index 3056a78e91..8f69e2780a 100644 --- a/MassTransit.ServiceBus/ServiceBus.cs +++ b/MassTransit.ServiceBus/ServiceBus.cs @@ -1,3 +1,16 @@ +/// Copyright 2007-2008 The Apache Software Foundation. +/// +/// Licensed under the Apache License, Version 2.0 (the "License"); you may not use +/// this file except in compliance with the License. You may obtain a copy of the +/// License at +/// +/// http://www.apache.org/licenses/LICENSE-2.0 +/// +/// Unless required by applicable law or agreed to in writing, software distributed +/// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +/// CONDITIONS OF ANY KIND, either express or implied. See the License for the +/// specific language governing permissions and limitations under the License. + using System; using System.Collections.Generic; using System.Reflection; diff --git a/NOTICE b/NOTICE index f19f3ae558..e5cb62d860 100644 --- a/NOTICE +++ b/NOTICE @@ -4,6 +4,6 @@ ========================================================================= MassTransit -Copyright 2007-2008 +Copyright 2007-2008 The Apache Software Foundation.