Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Header Start

  • Loading branch information...
commit 9d91e626b6a171b71a3cdcf7a6467312622fae36 1 parent f38eb3a
@phatboyg authored
View
247 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<Envelope>
- {
- 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<Envelope> 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<Envelope>
+ {
+ 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<Envelope> 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();
+ }
+ }
}
View
13 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;
View
2  NOTICE
@@ -4,6 +4,6 @@
=========================================================================
MassTransit
-Copyright 2007-2008
+Copyright 2007-2008 The Apache Software Foundation.
Please sign in to comment.
Something went wrong with that request. Please try again.