5 // Michael Barker (mike@middlesoft.co.uk)
7 // (C) 2008 Michael Barker
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 using System.ComponentModel;
34 namespace Mono.Messaging {
36 public interface IMessageQueue {
62 bool DenySharedReceive {
66 EncryptionRequired EncryptionRequired {
74 DateTime LastModifyTime {
78 long MaximumJournalSize {
82 long MaximumQueueSize {
90 ISynchronizeInvoke SynchronizingObject {
98 bool UseJournalQueue {
106 QueueReference QRef {
114 void Send (IMessage message);
116 void Send (IMessage message, IMessageQueueTransaction transaction);
118 void Send (IMessage message, MessageQueueTransactionType transactionType);
122 IMessage Peek (TimeSpan timeout);
124 IMessage PeekById (string id);
126 IMessage PeekById (string id, TimeSpan timeout);
128 IMessage PeekByCorrelationId (string correlationId);
130 IMessage PeekByCorrelationId (string correlationId, TimeSpan timeout);
134 IMessage Receive (TimeSpan timeout);
136 IMessage Receive (IMessageQueueTransaction transaction);
138 IMessage Receive (TimeSpan timeout, IMessageQueueTransaction transaction);
140 IMessage Receive (MessageQueueTransactionType transactionType);
142 IMessage Receive (TimeSpan timeout, MessageQueueTransactionType transactionType);
144 IMessage ReceiveById (string id);
146 IMessage ReceiveById (string id, TimeSpan timeout);
148 IMessage ReceiveById (string id, IMessageQueueTransaction transaction);
150 IMessage ReceiveById (string id, MessageQueueTransactionType transactionType);
152 IMessage ReceiveById (string id, TimeSpan timeout, IMessageQueueTransaction transaction);
154 IMessage ReceiveById (string id, TimeSpan timeout, MessageQueueTransactionType transactionType);
156 IMessage ReceiveByCorrelationId (string correlationId);
158 IMessage ReceiveByCorrelationId (string correlationId, TimeSpan timeout);
160 IMessage ReceiveByCorrelationId (string correlationId, IMessageQueueTransaction transaction);
162 IMessage ReceiveByCorrelationId (string correlationId, MessageQueueTransactionType transactionType);
164 IMessage ReceiveByCorrelationId (string correlationId, TimeSpan timeout, IMessageQueueTransaction transaction);
166 IMessage ReceiveByCorrelationId (string correlationId, TimeSpan timeout, MessageQueueTransactionType transactionType);
168 IAsyncResult BeginPeek ();
170 IAsyncResult BeginPeek (TimeSpan timeout);
172 IAsyncResult BeginPeek (TimeSpan timeout, object stateObject);
174 IAsyncResult BeginPeek (TimeSpan timeout, object stateObject, AsyncCallback callback);
176 IMessage EndPeek (IAsyncResult asyncResult);
178 IAsyncResult BeginReceive ();
180 IAsyncResult BeginReceive (TimeSpan timeout);
182 IAsyncResult BeginReceive (TimeSpan timeout, object stateObject);
184 IAsyncResult BeginReceive (TimeSpan timeout, object stateObject, AsyncCallback callback);
186 IMessage EndReceive (IAsyncResult asyncResult);
188 IMessageEnumerator GetMessageEnumerator ();
190 event CompletedEventHandler PeekCompleted;
192 event CompletedEventHandler ReceiveCompleted;
194 void SendReceiveCompleted (IAsyncResult result);
196 void SendPeekCompleted (IAsyncResult result);