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.Channels;
30 using System.ServiceModel.Description;
32 namespace System.ServiceModel
34 public abstract class MsmqBindingBase : Binding, IBindingRuntimePreferences
36 Uri custom_dead_letter_queue;
37 DeadLetterQueue dead_letter_queue = DeadLetterQueue.System;
38 bool durable = true, exactly_once = true, use_msmq_trace, use_source_journal;
39 int max_retry_cycles = 2, receive_retry_count = 5;
40 long max_recv_msg_size = 0x10000;
41 ReceiveErrorHandling receive_error_handling;
42 TimeSpan retry_cycle_delay = TimeSpan.FromMinutes (30), ttl = TimeSpan.FromDays (1);
44 public Uri CustomDeadLetterQueue {
45 get { return custom_dead_letter_queue; }
46 set { custom_dead_letter_queue = value; }
49 public DeadLetterQueue DeadLetterQueue {
50 get { return dead_letter_queue; }
51 set { dead_letter_queue = value; }
55 get { return durable; }
56 set { durable = value; }
59 public bool ExactlyOnce {
60 get { return exactly_once; }
61 set { exactly_once = value; }
64 public long MaxReceivedMessageSize {
65 get { return max_recv_msg_size; }
66 set { max_recv_msg_size = value; }
69 public int MaxRetryCycles {
70 get { return max_retry_cycles; }
71 set { max_retry_cycles = value; }
74 public ReceiveErrorHandling ReceiveErrorHandling {
75 get { return receive_error_handling; }
76 set { receive_error_handling = value; }
79 public int ReceiveRetryCount {
80 get { return receive_retry_count; }
81 set { receive_retry_count = value; }
84 public TimeSpan RetryCycleDelay {
85 get { return retry_cycle_delay; }
86 set { retry_cycle_delay = value; }
89 public TimeSpan TimeToLive {
94 public override string Scheme {
96 foreach (BindingElement be in CreateBindingElements ())
97 if (be is TransportBindingElement)
98 return ((TransportBindingElement) be).Scheme;
99 throw new Exception ("INTERNAL ERROR: no TransportBindingElement was created.");
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; }
114 bool IBindingRuntimePreferences.ReceiveSynchronously {
115 get { throw new NotImplementedException (); }