2 // MsmqBindingElementBase.cs
4 // Author: Atsushi Enomoto <atsushi@ximian.com>
6 // Copyright (C) 2007 Novell, Inc (http://www.novell.com)
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:
16 // The above copyright notice and this permission notice shall be
17 // included in all copies or substantial portions of the Software.
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.
29 using System.ServiceModel;
30 using System.ServiceModel.Description;
32 namespace System.ServiceModel.Channels
34 public abstract class MsmqBindingElementBase : TransportBindingElement,
35 ITransactedBindingElement, IPolicyExportExtension, IWsdlExportExtension
37 Uri custom_dead_letter_queue;
38 DeadLetterQueue dead_letter_queue = DeadLetterQueue.System;
39 bool durable = true, exactly_once = true, tx_enabled, use_msmq_trace, use_source_journal;
40 int max_retry_cycles = 2, receive_retry_count = 5;
41 ReceiveErrorHandling receive_error_handling;
42 TimeSpan retry_cycle_delay = TimeSpan.FromMinutes (30), ttl = TimeSpan.FromDays (1);
43 MsmqTransportSecurity transport_security =
44 new MsmqTransportSecurity ();
46 internal MsmqBindingElementBase ()
50 public Uri CustomDeadLetterQueue {
51 get { return custom_dead_letter_queue; }
52 set { custom_dead_letter_queue = value; }
55 public DeadLetterQueue DeadLetterQueue {
56 get { return dead_letter_queue; }
57 set { dead_letter_queue = value; }
61 get { return durable; }
62 set { durable = value; }
65 public bool ExactlyOnce {
66 get { return exactly_once; }
67 set { exactly_once = value; }
70 public int MaxRetryCycles {
71 get { return max_retry_cycles; }
72 set { max_retry_cycles = value; }
75 public MsmqTransportSecurity MsmqTransportSecurity {
76 get { return transport_security; }
79 public ReceiveErrorHandling ReceiveErrorHandling {
80 get { return receive_error_handling; }
81 set { receive_error_handling = value; }
84 public int ReceiveRetryCount {
85 get { return receive_retry_count; }
86 set { receive_retry_count = value; }
89 public TimeSpan RetryCycleDelay {
90 get { return retry_cycle_delay; }
91 set { retry_cycle_delay = value; }
94 public TimeSpan TimeToLive {
99 public bool TransactedReceiveEnabled {
100 get { return tx_enabled; }
103 public bool UseMsmqTracing {
104 get { return use_msmq_trace; }
105 set { use_msmq_trace = value; }
108 public bool UseSourceJournal {
109 get { return use_source_journal; }
110 set { use_source_journal = value; }
113 public override T GetProperty<T> (BindingContext context)
115 if (typeof (T) is IBindingDeliveryCapabilities)
116 throw new NotImplementedException ();
117 if (typeof (T) is ISecurityCapabilities)
118 throw new NotImplementedException ();
119 return base.GetProperty<T> (context);
123 void IPolicyExportExtension.ExportPolicy (MetadataExporter exporter, PolicyConversionContext context)
125 throw new NotImplementedException ();
129 void IWsdlExportExtension.ExportContract (WsdlExporter exporter, WsdlContractConversionContext context)
131 throw new NotImplementedException ();
135 void IWsdlExportExtension.ExportEndpoint (WsdlExporter exporter, WsdlEndpointConversionContext endpointContext)
137 throw new NotImplementedException ();