MsmqBindingElementBase.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. //
  2. // MsmqBindingElementBase.cs
  3. //
  4. // Author: Atsushi Enomoto <[email protected]>
  5. //
  6. // Copyright (C) 2007 Novell, Inc (http://www.novell.com)
  7. //
  8. // Permission is hereby granted, free of charge, to any person obtaining
  9. // a copy of this software and associated documentation files (the
  10. // "Software"), to deal in the Software without restriction, including
  11. // without limitation the rights to use, copy, modify, merge, publish,
  12. // distribute, sublicense, and/or sell copies of the Software, and to
  13. // permit persons to whom the Software is furnished to do so, subject to
  14. // the following conditions:
  15. //
  16. // The above copyright notice and this permission notice shall be
  17. // included in all copies or substantial portions of the Software.
  18. //
  19. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  20. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  21. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  22. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  23. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  24. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  25. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  26. //
  27. using System;
  28. using System.ServiceModel;
  29. using System.ServiceModel.Description;
  30. namespace System.ServiceModel.Channels
  31. {
  32. public abstract class MsmqBindingElementBase : TransportBindingElement,
  33. ITransactedBindingElement, IPolicyExportExtension, IWsdlExportExtension
  34. {
  35. Uri custom_dead_letter_queue;
  36. DeadLetterQueue dead_letter_queue = DeadLetterQueue.System;
  37. bool durable = true, exactly_once = true, tx_enabled, use_msmq_trace, use_source_journal;
  38. int max_retry_cycles = 2, receive_retry_count = 5;
  39. ReceiveErrorHandling receive_error_handling;
  40. TimeSpan retry_cycle_delay = TimeSpan.FromMinutes (30), ttl = TimeSpan.FromDays (1);
  41. MsmqTransportSecurity transport_security =
  42. new MsmqTransportSecurity ();
  43. internal MsmqBindingElementBase ()
  44. {
  45. }
  46. public Uri CustomDeadLetterQueue {
  47. get { return custom_dead_letter_queue; }
  48. set { custom_dead_letter_queue = value; }
  49. }
  50. public DeadLetterQueue DeadLetterQueue {
  51. get { return dead_letter_queue; }
  52. set { dead_letter_queue = value; }
  53. }
  54. public bool Durable {
  55. get { return durable; }
  56. set { durable = value; }
  57. }
  58. public bool ExactlyOnce {
  59. get { return exactly_once; }
  60. set { exactly_once = value; }
  61. }
  62. public int MaxRetryCycles {
  63. get { return max_retry_cycles; }
  64. set { max_retry_cycles = value; }
  65. }
  66. public MsmqTransportSecurity MsmqTransportSecurity {
  67. get { return transport_security; }
  68. }
  69. public ReceiveErrorHandling ReceiveErrorHandling {
  70. get { return receive_error_handling; }
  71. set { receive_error_handling = value; }
  72. }
  73. public int ReceiveRetryCount {
  74. get { return receive_retry_count; }
  75. set { receive_retry_count = value; }
  76. }
  77. public TimeSpan RetryCycleDelay {
  78. get { return retry_cycle_delay; }
  79. set { retry_cycle_delay = value; }
  80. }
  81. public TimeSpan TimeToLive {
  82. get { return ttl; }
  83. set { ttl = value; }
  84. }
  85. public bool TransactedReceiveEnabled {
  86. get { return tx_enabled; }
  87. }
  88. public bool UseMsmqTracing {
  89. get { return use_msmq_trace; }
  90. set { use_msmq_trace = value; }
  91. }
  92. public bool UseSourceJournal {
  93. get { return use_source_journal; }
  94. set { use_source_journal = value; }
  95. }
  96. public override T GetProperty<T> (BindingContext context)
  97. {
  98. if (typeof (T) is IBindingDeliveryCapabilities)
  99. throw new NotImplementedException ();
  100. if (typeof (T) is ISecurityCapabilities)
  101. throw new NotImplementedException ();
  102. return base.GetProperty<T> (context);
  103. }
  104. [MonoTODO]
  105. void IPolicyExportExtension.ExportPolicy (MetadataExporter exporter, PolicyConversionContext context)
  106. {
  107. throw new NotImplementedException ();
  108. }
  109. [MonoTODO]
  110. void IWsdlExportExtension.ExportContract (WsdlExporter exporter, WsdlContractConversionContext context)
  111. {
  112. throw new NotImplementedException ();
  113. }
  114. [MonoTODO]
  115. void IWsdlExportExtension.ExportEndpoint (WsdlExporter exporter, WsdlEndpointConversionContext endpointContext)
  116. {
  117. throw new NotImplementedException ();
  118. }
  119. }
  120. }