1 // This source code is dual-licensed under the Apache License, version
2 // 2.0, and the Mozilla Public License, version 1.1.
6 //---------------------------------------------------------------------------
7 // Copyright (C) 2007-2009 LShift Ltd., Cohesive Financial
8 // Technologies LLC., and Rabbit Technologies Ltd.
10 // Licensed under the Apache License, Version 2.0 (the "License");
11 // you may not use this file except in compliance with the License.
12 // You may obtain a copy of the License at
14 // http://www.apache.org/licenses/LICENSE-2.0
16 // Unless required by applicable law or agreed to in writing, software
17 // distributed under the License is distributed on an "AS IS" BASIS,
18 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 // See the License for the specific language governing permissions and
20 // limitations under the License.
21 //---------------------------------------------------------------------------
25 //---------------------------------------------------------------------------
26 // The contents of this file are subject to the Mozilla Public License
27 // Version 1.1 (the "License"); you may not use this file except in
28 // compliance with the License. You may obtain a copy of the License at
29 // http://www.rabbitmq.com/mpl.html
31 // Software distributed under the License is distributed on an "AS IS"
32 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
33 // License for the specific language governing rights and limitations
36 // The Original Code is The RabbitMQ .NET Client.
38 // The Initial Developers of the Original Code are LShift Ltd,
39 // Cohesive Financial Technologies LLC, and Rabbit Technologies Ltd.
41 // Portions created before 22-Nov-2008 00:00:00 GMT by LShift Ltd,
42 // Cohesive Financial Technologies LLC, or Rabbit Technologies Ltd
43 // are Copyright (C) 2007-2008 LShift Ltd, Cohesive Financial
44 // Technologies LLC, and Rabbit Technologies Ltd.
46 // Portions created by LShift Ltd are Copyright (C) 2007-2009 LShift
47 // Ltd. Portions created by Cohesive Financial Technologies LLC are
48 // Copyright (C) 2007-2009 Cohesive Financial Technologies
49 // LLC. Portions created by Rabbit Technologies Ltd are Copyright
50 // (C) 2007-2009 Rabbit Technologies Ltd.
52 // All Rights Reserved.
54 // Contributor(s): ______________________________________.
56 //---------------------------------------------------------------------------
58 using System.Collections;
59 using RabbitMQ.Client.Apigen.Attributes;
60 using RabbitMQ.Client.Events;
62 namespace RabbitMQ.Client
64 ///<summary>Common AMQP model, spanning the union of the
65 ///functionality offered by versions 0-8, 0-8qpid, and 0-9
66 ///(without WIP) of AMQP.</summary>
68 /// Extends the IDisposable interface, so that the "using"
69 /// statement can be used to scope the lifetime of a channel when
72 public interface IModel: IDisposable
74 ///<summary>Notifies the destruction of the model.</summary>
76 /// If the model is already destroyed at the time an event
77 /// handler is added to this event, the event handler will be
78 /// fired immediately.
80 event ModelShutdownEventHandler ModelShutdown;
82 ///<summary>Signalled when a Basic.Return command arrives from
83 ///the broker.</summary>
84 event BasicReturnEventHandler BasicReturn;
86 ///<summary>Signalled when an exception occurs in a callback
87 ///invoked by the model.</summary>
89 ///Examples of cases where this event will be signalled
90 ///include exceptions thrown in IBasicConsumer methods, or
91 ///exceptions thrown in ModelShutdownEventHandler delegates
94 event CallbackExceptionEventHandler CallbackException;
96 ///<summary>Returns null if the session is still in a state
97 ///where it can be used, or the cause of its closure
98 ///otherwise.</summary>
99 ShutdownEventArgs CloseReason { get; }
101 ///<summary>Returns true if the session is still in a state
102 ///where it can be used. Identical to checking if CloseReason
103 ///== null.</summary>
106 ///<summary>Construct a completely empty content header for
107 ///use with the Basic content class.</summary>
108 [AmqpContentHeaderFactory("basic")]
109 IBasicProperties CreateBasicProperties();
111 ///<summary>Construct a completely empty content header for
112 ///use with the File content class.</summary>
113 [AmqpContentHeaderFactory("file")]
114 IFileProperties CreateFileProperties();
116 ///<summary>Construct a completely empty content header for
117 ///use with the Stream content class.</summary>
118 [AmqpContentHeaderFactory("stream")]
119 IStreamProperties CreateStreamProperties();
121 ///<summary>(Spec method) Channel flow control functionality.</summary>
124 [return: AmqpFieldMapping(null, "active")]
125 void ChannelFlow(bool active);
127 ///<summary>(Spec method) Declare an exchange.</summary>
129 ///The exchange is declared non-passive, non-autodelete, and
130 ///non-internal, with no arguments. The "nowait" option is not
133 [AmqpMethodDoNotImplement(null)]
134 void ExchangeDeclare(string exchange, string type, bool durable);
136 ///<summary>(Spec method) Declare an exchange.</summary>
138 ///The exchange is declared non-passive, non-durable, non-autodelete, and
139 ///non-internal, with no arguments. The "nowait" option is not
142 [AmqpMethodDoNotImplement(null)]
143 void ExchangeDeclare(string exchange, string type);
145 ///<summary>(Spec method) Declare an exchange.</summary>
146 void ExchangeDeclare(string exchange,
152 [AmqpNowaitArgument(null)]
154 IDictionary arguments);
156 ///<summary>(Spec method) Delete an exchange.</summary>
157 void ExchangeDelete(string exchange,
159 [AmqpNowaitArgument(null)]
162 ///<summary>(Spec method) Declare a queue.</summary>
164 ///The queue is declared non-passive, non-durable,
165 ///but exclusive and autodelete, with no arguments. The
166 ///server autogenerates a name for the queue - the generated
167 ///name is the return value of this method.
169 [AmqpMethodDoNotImplement(null)]
170 string QueueDeclare();
172 ///<summary>(Spec method) Declare a queue.</summary>
174 ///The queue is declared non-passive, non-durable,
175 ///non-exclusive, and non-autodelete, with no arguments.
177 [AmqpMethodDoNotImplement(null)]
178 string QueueDeclare(string queue);
180 ///<summary>(Spec method) Declare a queue.</summary>
182 ///The queue is declared non-passive, non-exclusive, and
183 ///non-autodelete, with no arguments.
185 [AmqpMethodDoNotImplement(null)]
186 string QueueDeclare(string queue,
189 ///<summary>(Spec method) Declare a queue.</summary>
191 ///Returns the name of the queue that was declared.
193 [return: AmqpFieldMapping(null, "queue")]
194 string QueueDeclare(string queue,
199 [AmqpNowaitArgument(null)]
201 IDictionary arguments);
203 ///<summary>(Spec method) Bind a queue to an exchange.</summary>
204 void QueueBind(string queue,
207 [AmqpNowaitArgument(null)]
209 IDictionary arguments);
211 ///<summary>(Spec method) Unbind a queue from an exchange.</summary>
213 ///Note: This operation is only supported when communicating
214 ///using AMQP protocol version 0-9, or when communicating with
215 ///a 0-8 broker that has been enhanced with the unofficial
216 ///addition of a queue.unbind method.
218 [AmqpUnsupported("RabbitMQ.Client.Framing.v0_8qpid")]
219 void QueueUnbind(string queue,
222 IDictionary arguments);
224 ///<summary>(Spec method) Purge a queue of messages.</summary>
226 ///Returns the number of messages purged. If nowait is
227 ///specified, returns <code>uint.MaxValue</code>.
229 [return: AmqpFieldMapping(null, "messageCount")]
230 uint QueuePurge(string queue,
231 [AmqpNowaitArgument(null, "0xFFFFFFFF")]
234 ///<summary>(Spec method) Delete a queue.</summary>
236 ///Returns the number of messages purged during queue
237 ///deletion. If nowait is specified, returns
238 ///<code>uint.MaxValue</code>.
240 [return: AmqpFieldMapping(null, "messageCount")]
241 uint QueueDelete(string queue,
244 [AmqpNowaitArgument(null, "0xFFFFFFFF")]
247 ///<summary>Start a Basic content-class consumer.</summary>
249 ///The consumer is started with noAck=false (i.e. BasicAck is required),
250 ///an empty consumer tag (i.e. the server creates and returns a fresh consumer tag),
251 ///noLocal=false and exclusive=false.
253 [AmqpMethodDoNotImplement(null)]
254 string BasicConsume(string queue,
256 IBasicConsumer consumer);
258 ///<summary>Start a Basic content-class consumer.</summary>
260 ///The consumer is started with
261 ///an empty consumer tag (i.e. the server creates and returns a fresh consumer tag),
262 ///noLocal=false and exclusive=false.
264 [AmqpMethodDoNotImplement(null)]
265 string BasicConsume(string queue,
268 IBasicConsumer consumer);
270 ///<summary>Start a Basic content-class consumer.</summary>
272 ///The consumer is started with
273 ///noLocal=false and exclusive=false.
275 [AmqpMethodDoNotImplement(null)]
276 string BasicConsume(string queue,
280 IBasicConsumer consumer);
282 ///<summary>Start a Basic content-class consumer.</summary>
283 [AmqpMethodDoNotImplement(null)]
284 string BasicConsume(string queue,
290 IBasicConsumer consumer);
292 ///<summary>Delete a Basic content-class consumer.</summary>
293 [AmqpMethodDoNotImplement(null)]
294 void BasicCancel(string consumerTag);
296 ///<summary>(Spec method) Configures QoS parameters of the Basic content-class.</summary>
297 void BasicQos(uint prefetchSize,
298 ushort prefetchCount,
301 ///<summary>(Spec method) Convenience overload of BasicPublish.</summary>
303 ///The publication occurs with mandatory=false and immediate=false.
305 [AmqpMethodDoNotImplement(null)]
306 void BasicPublish(PublicationAddress addr,
307 IBasicProperties basicProperties,
310 ///<summary>(Spec method) Convenience overload of BasicPublish.</summary>
312 ///The publication occurs with mandatory=false and immediate=false.
314 [AmqpMethodDoNotImplement(null)]
315 void BasicPublish(string exchange,
317 IBasicProperties basicProperties,
320 ///<summary>(Spec method) Publish a message using the Basic
321 ///content-class.</summary>
322 [AmqpMethodDoNotImplement(null)]
323 void BasicPublish(string exchange,
327 IBasicProperties basicProperties,
330 ///<summary>(Spec method) Acknowledge one or more delivered message(s).</summary>
331 void BasicAck(ulong deliveryTag,
334 ///<summary>(Spec method) Reject a delivered message.</summary>
335 void BasicReject(ulong deliveryTag,
338 ///<summary>(Spec method)</summary>
339 void BasicRecover(bool requeue);
341 ///<summary>(Spec method) Retrieve an individual message, if
342 ///one is available; returns null if the server answers that
343 ///no messages are currently available. See also
344 ///IModel.BasicAck.</summary>
345 [AmqpMethodDoNotImplement(null)]
346 BasicGetResult BasicGet(string queue,
349 ///<summary>(Spec method) Enable TX mode for this session.</summary>
352 ///<summary>(Spec method) Commit this session's active TX
353 ///transaction.</summary>
356 ///<summary>(Spec method) Roll back this session's active TX
357 ///transaction.</summary>
360 ///<summary>(Spec method) Enable DTX mode for this session.</summary>
363 ///<summary>(Spec method)</summary>
364 void DtxStart(string dtxIdentifier);
366 ///<summary>Close this session.</summary>
368 ///If the session is already closed (or closing), then this
369 ///method does nothing but wait for the in-progress close
370 ///operation to complete. This method will not return to the
371 ///caller until the shutdown is complete.
373 [AmqpMethodDoNotImplement(null)]
376 ///<summary>Close this session.</summary>
378 ///The method behaves in the same way as Close(), with the only
379 ///difference that the model is closed with the given model
380 ///close code and message.
382 ///The close code (See under "Reply Codes" in the AMQP specification)
385 ///A message indicating the reason for closing the model
388 [AmqpMethodDoNotImplement(null)]
389 void Close(ushort replyCode, string replyText);
391 ///<summary>Abort this session.</summary>
393 ///If the session is already closed (or closing), then this
394 ///method does nothing but wait for the in-progress close
395 ///operation to complete. This method will not return to the
396 ///caller until the shutdown is complete.
397 ///In comparison to normal Close() method, Abort() will not throw
398 ///AlreadyClosedException or IOException during closing model.
400 [AmqpMethodDoNotImplement(null)]
403 ///<summary>Abort this session.</summary>
405 ///The method behaves in the same way as Abort(), with the only
406 ///difference that the model is closed with the given model
407 ///close code and message.
409 ///The close code (See under "Reply Codes" in the AMQP specification)
412 ///A message indicating the reason for closing the model
415 [AmqpMethodDoNotImplement(null)]
416 void Abort(ushort replyCode, string replyText);
419 ///<summary>Represents Basic.GetOk responses from the server.</summary>
421 /// Basic.Get either returns an instance of this class, or null if
422 /// a Basic.GetEmpty was received.
424 public class BasicGetResult
426 private ulong m_deliveryTag;
427 private bool m_redelivered;
428 private string m_exchange;
429 private string m_routingKey;
430 private uint m_messageCount;
431 private IBasicProperties m_basicProperties;
432 private byte[] m_body;
434 ///<summary>Sets the new instance's properties from the
435 ///arguments passed in.</summary>
436 public BasicGetResult(ulong deliveryTag,
441 IBasicProperties basicProperties,
444 m_deliveryTag = deliveryTag;
445 m_redelivered = redelivered;
446 m_exchange = exchange;
447 m_routingKey = routingKey;
448 m_messageCount = messageCount;
449 m_basicProperties = basicProperties;
453 ///<summary>Retrieve the delivery tag for this message. See also IModel.BasicAck.</summary>
454 public ulong DeliveryTag { get { return m_deliveryTag; } }
455 ///<summary>Retrieve the redelivered flag for this message.</summary>
456 public bool Redelivered { get { return m_redelivered; } }
457 ///<summary>Retrieve the exchange this message was published to.</summary>
458 public string Exchange { get { return m_exchange; } }
459 ///<summary>Retrieve the routing key with which this message was published.</summary>
460 public string RoutingKey { get { return m_routingKey; } }
462 ///<summary>Retrieve the number of messages pending on the
463 ///queue, excluding the message being delivered.</summary>
465 /// Note that this figure is indicative, not reliable, and can
466 /// change arbitrarily as messages are added to the queue and
467 /// removed by other clients.
469 public uint MessageCount { get { return m_messageCount; } }
471 ///<summary>Retrieves the Basic-class content header properties for this message.</summary>
472 public IBasicProperties BasicProperties { get { return m_basicProperties; } }
473 ///<summary>Retrieves the body of this message.</summary>
474 public byte[] Body { get { return m_body; } }
478 namespace RabbitMQ.Client.Impl
480 ///<summary>Not part of the public API. Extension of IModel to
481 ///include utilities and connection-setup routines needed by the
482 ///implementation side.</summary>
484 ///<remarks>This interface is used by the API autogeneration
485 ///process. The AMQP XML specifications are read by the spec
486 ///compilation tool, and after the basic method interface and
487 ///implementation classes are generated, this interface is
488 ///scanned, and a spec-version-specific implementation is
489 ///autogenerated. Annotations are used on certain methods, return
490 ///types, and parameters, to customise the details of the
491 ///autogeneration process.</remarks>
493 ///<see cref="RabbitMQ.Client.Impl.ModelBase"/>
494 ///<see cref="RabbitMQ.Client.Framing.Impl.v0_9.Model"/>
495 public interface IFullModel : RabbitMQ.Client.IModel
497 ///<summary>Used to send a Basic.Publish method. Called by the
498 ///public publish method after potential null-reference issues
499 ///have been rectified.</summary>
500 [AmqpMethodMapping(null, "basic", "publish")]
501 void _Private_BasicPublish(string exchange,
505 [AmqpContentHeaderMapping]
506 IBasicProperties basicProperties,
507 [AmqpContentBodyMapping]
510 ///<summary>Used to send a Basic.Consume method. The public
511 ///consume API calls this while also managing internal
512 ///datastructures.</summary>
514 [AmqpMethodMapping(null, "basic", "consume")]
515 void _Private_BasicConsume(string queue,
521 [AmqpUnsupported("RabbitMQ.Client.Framing.v0_8")]
522 [AmqpFieldMapping("RabbitMQ.Client.Framing.v0_8qpid",
526 ///<summary>Handle incoming Basic.ConsumeOk methods.</summary>
527 void HandleBasicConsumeOk(string consumerTag);
529 ///<summary>Used to send a Basic.Cancel method. The public
530 ///consume API calls this while also managing internal
531 ///datastructures.</summary>
533 [AmqpMethodMapping(null, "basic", "cancel")]
534 void _Private_BasicCancel(string consumerTag,
537 ///<summary>Handle incoming Basic.CancelOk methods.</summary>
538 void HandleBasicCancelOk(string consumerTag);
540 ///<summary>Used to send a Channel.Open. Called during session
541 ///initialisation.</summary>
542 [AmqpMethodMapping(null, "channel", "open")]
543 void _Private_ChannelOpen(string outOfBand);
545 ///<summary>Used to send a Channel.CloseOk. Called during
546 ///session shutdown.</summary>
547 [AmqpMethodMapping(null, "channel", "close-ok")]
548 void _Private_ChannelCloseOk();
550 ///<summary>Used to send a Channel.Close. Called during
551 ///session shutdown.</summary>
553 [AmqpMethodMapping(null, "channel", "close")]
554 void _Private_ChannelClose(ushort replyCode,
559 ///<summary>Used to send a Basic.Get. Basic.Get is a special
560 ///case, since it can result in a Basic.GetOk or a
561 ///Basic.GetEmpty, so this level of manual control is
562 ///required.</summary>
564 [AmqpMethodMapping(null, "basic", "get")]
565 void _Private_BasicGet(string queue,
568 ///<summary>Handle incoming Basic.GetOk methods. Routes the
569 ///information to a waiting Basic.Get continuation.</summary>
570 void HandleBasicGetOk(ulong deliveryTag,
575 [AmqpContentHeaderMapping]
576 IBasicProperties basicProperties,
577 [AmqpContentBodyMapping]
580 ///<summary>Handle incoming Basic.GetEmpty methods. Routes the
581 ///information to a waiting Basic.Get continuation.</summary>
583 /// Note that the clusterId field is ignored, as in the
584 /// specification it notes that it is "deprecated pending
587 void HandleBasicGetEmpty();
589 ///<summary>Handle incoming Basic.Deliver methods. Dispatches
590 ///to waiting consumers.</summary>
591 void HandleBasicDeliver(string consumerTag,
596 [AmqpContentHeaderMapping]
597 IBasicProperties basicProperties,
598 [AmqpContentBodyMapping]
601 ///<summary>Handle incoming Basic.Return methods. Signals a
602 ///BasicReturnEvent.</summary>
603 void HandleBasicReturn(ushort replyCode,
607 [AmqpContentHeaderMapping]
608 IBasicProperties basicProperties,
609 [AmqpContentBodyMapping]
612 ///<summary>Used to send a Channel.FlowOk. Confirms that
613 ///Channel.Flow from the broker was processed.</summary>
614 [AmqpMethodMapping(null, "channel", "flow-ok")]
615 void _Private_ChannelFlowOk();
617 ///<summary>Handle incoming Channel.Flow methods. Either
618 ///stops or resumes sending the methods that have content.</summary>
619 void HandleChannelFlow(bool active);
621 ///<summary>Handle an incoming Channel.Close. Shuts down the
622 ///session and model.</summary>
623 void HandleChannelClose(ushort replyCode,
628 ///<summary>Handle an incoming Channel.CloseOk.</summary>
629 void HandleChannelCloseOk();
631 ///////////////////////////////////////////////////////////////////////////
632 // Connection-related methods, for use in channel 0 during
633 // connection startup/shutdown.
635 ///<summary>Handle an incoming Connection.Start. Used during
636 ///connection initialisation.</summary>
637 void HandleConnectionStart(byte versionMajor,
639 IDictionary serverProperties,
643 ///<summary>Sends a Connection.StartOk, and waits for a
644 ///Connection.Tune. Used during connection
645 ///initialisation.</summary>
646 [return: AmqpMethodMapping(null, "connection", "tune")]
647 ConnectionTuneDetails ConnectionStartOk(IDictionary clientProperties,
652 ///<summary>Sends a Connection.TuneOk. Used during connection
653 ///initialisation.</summary>
654 void ConnectionTuneOk(ushort channelMax,
659 ///<summary>Used to send a Connection.Open. Called during
660 ///connection startup.</summary>
662 [AmqpMethodMapping(null, "connection", "open")]
663 void _Private_ConnectionOpen(string virtualHost,
667 ///<summary>Handle an incoming Connection.OpenOk.</summary>
668 void HandleConnectionOpenOk(string knownHosts);
670 ///<summary>Handle an incoming Connection.Redirect.</summary>
671 void HandleConnectionRedirect(string host,
674 ///<summary>Used to send a Connection.Close. Called during
675 ///connection shutdown.</summary>
676 [AmqpMethodMapping(null, "connection", "close")]
677 void _Private_ConnectionClose(ushort replyCode,
682 ///<summary>Used to send a Connection.CloseOk. Called during
683 ///connection shutdown.</summary>
684 [AmqpMethodMapping(null, "connection", "close-ok")]
685 void _Private_ConnectionCloseOk();
687 ///<summary>Handle an incoming Connection.Close. Shuts down the
688 ///connection and all sessions and models.</summary>
689 void HandleConnectionClose(ushort replyCode,
695 ///<summary>Essential information from an incoming Connection.Tune
697 public struct ConnectionTuneDetails
699 ///<summary>The peer's suggested channel-max parameter.</summary>
700 public ushort m_channelMax;
701 ///<summary>The peer's suggested frame-max parameter.</summary>
702 public uint m_frameMax;
703 ///<summary>The peer's suggested heartbeat parameter.</summary>
704 public ushort m_heartbeat;
708 namespace RabbitMQ.Client.Apigen.Attributes
710 ///<summary>Base class for attributes for controlling the API
711 ///autogeneration process.</summary>
712 public abstract class AmqpApigenAttribute : Attribute
714 ///<summary>The specification namespace (i.e. version) that
715 ///this attribute applies to, or null for all specification
716 ///versions.</summary>
717 public string m_namespaceName;
719 public AmqpApigenAttribute(string namespaceName)
721 m_namespaceName = namespaceName;
725 ///<summary>Causes the API generator to ignore the attributed method.</summary>
727 ///<remarks>Mostly used to declare convenience overloads of
728 ///various AMQP methods in the IModel interface. The API
729 ///autogeneration process should of course not attempt to produce
730 ///an implementation of the convenience methods, as they will be
731 ///implemented by hand with sensible defaults, delegating to the
732 ///autogenerated variant of the method concerned.</remarks>
733 [AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
734 public class AmqpMethodDoNotImplementAttribute : AmqpApigenAttribute
736 public AmqpMethodDoNotImplementAttribute(string namespaceName)
737 : base(namespaceName) { }
740 ///<summary>Causes the API generator to generate asynchronous
741 ///receive code for the attributed method.</summary>
742 [AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
743 public class AmqpAsynchronousHandlerAttribute : AmqpApigenAttribute
745 public AmqpAsynchronousHandlerAttribute(string namespaceName)
746 : base(namespaceName) { }
749 ///<summary>Causes the API generator to generate
750 ///exception-throwing code for, instead of simply ignoring, the
751 ///attributed method.</summary>
753 ///<see cref="AmqpMethodDoNotImplementAttribute"/>
754 [AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
755 public class AmqpUnsupportedAttribute : AmqpApigenAttribute
757 public AmqpUnsupportedAttribute(string namespaceName)
758 : base(namespaceName) { }
761 ///<summary>Informs the API generator which AMQP method field to
762 ///use for either a parameter in a request, or for a simple result
763 ///in a reply.</summary>
764 [AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
765 public class AmqpFieldMappingAttribute : AmqpApigenAttribute
767 public string m_fieldName;
769 public AmqpFieldMappingAttribute(string namespaceName,
771 : base(namespaceName)
773 m_fieldName = fieldName;
777 ///<summary>Informs the API generator which AMQP method to use for
778 ///either a request (if applied to an IModel method) or a reply
779 ///(if applied to an IModel method result).</summary>
780 [AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
781 public class AmqpMethodMappingAttribute : AmqpApigenAttribute
783 public string m_className;
784 public string m_methodName;
786 public AmqpMethodMappingAttribute(string namespaceName,
789 : base(namespaceName)
791 m_className = className;
792 m_methodName = methodName;
796 ///<summary>This attribute, if placed on a parameter in an IModel
797 ///method, causes it to be interpreted as a "nowait" parameter for
798 ///the purposes of autogenerated RPC reply continuation management
799 ///and control.</summary>
800 [AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
801 public class AmqpNowaitArgumentAttribute : AmqpApigenAttribute
803 public string m_replacementExpression;
805 public AmqpNowaitArgumentAttribute(string namespaceName)
806 : this(namespaceName, null) { }
808 public AmqpNowaitArgumentAttribute(string namespaceName,
809 string replacementExpression)
810 : base(namespaceName)
812 m_replacementExpression = replacementExpression;
816 ///<summary>This attribute, if placed on a method in IModel,
817 ///causes the method to be interpreted as a factory method
818 ///producing a protocol-specific implementation of a common
819 ///content header interface.</summary>
820 public class AmqpContentHeaderFactoryAttribute : Attribute
822 public string m_contentClass;
824 public AmqpContentHeaderFactoryAttribute(string contentClass)
826 m_contentClass = contentClass;
830 ///<summary>This attribute, if placed on a parameter in a
831 ///content-carrying IModel method, causes it to be sent as part of
832 ///the content header frame.</summary>
833 public class AmqpContentHeaderMappingAttribute : Attribute
835 public AmqpContentHeaderMappingAttribute() { }
838 ///<summary>This attribute, if placed on a parameter in a
839 ///content-carrying IModel method, causes it to be sent as part of
840 ///the content body frame.</summary>
841 public class AmqpContentBodyMappingAttribute : Attribute
843 public AmqpContentBodyMappingAttribute() { }
846 ///<summary>This attribute, placed on an IModel method, causes
847 ///what would normally be an RPC, sent with ModelRpc, to be sent
848 ///as if it were oneway, with ModelSend. The assumption that this
849 ///is for a custom continuation (e.g. for BasicConsume/BasicCancel
851 public class AmqpForceOneWayAttribute : Attribute
853 public AmqpForceOneWayAttribute() { }