5 // Atsushi Enomoto <atsushi@ximian.com>
7 // Copyright (C) 2005-2006 Novell, Inc. http://www.novell.com
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 using System.Collections.Generic;
30 using System.Collections.ObjectModel;
31 using System.ServiceModel.Channels;
32 using System.ServiceModel.Description;
34 namespace System.ServiceModel.Dispatcher
36 public sealed class ClientRuntime
38 SynchronizedCollection<IChannelInitializer> channel_initializers
39 = new SynchronizedCollection<IChannelInitializer> ();
40 SynchronizedCollection<IInteractiveChannelInitializer> interactive_channel_initializers
41 = new SynchronizedCollection<IInteractiveChannelInitializer> ();
42 SynchronizedCollection<IClientMessageInspector> inspectors
43 = new SynchronizedCollection<IClientMessageInspector> ();
44 ClientOperation.ClientOperationCollection operations
45 = new ClientOperation.ClientOperationCollection ();
46 IClientOperationSelector selector;
48 bool validate, manual_addressing;
49 string contract_name, contract_ns;
50 int max_fault_size = 0x10000; // FIXME: not verified.
52 // .ctor() for Clients
53 internal ClientRuntime (string name, string ns, object callbackDispatchRuntime)
58 CallbackDispatchRuntime = (DispatchRuntime) callbackDispatchRuntime ?? new DispatchRuntime (null, this);
62 public Type CallbackClientType { get; set; }
64 public SynchronizedCollection<IChannelInitializer> ChannelInitializers {
65 get { return channel_initializers; }
68 public SynchronizedCollection<IInteractiveChannelInitializer> InteractiveChannelInitializers {
69 get { return interactive_channel_initializers;}
72 public string ContractName {
73 get { return contract_name; }
76 public string ContractNamespace {
77 get { return contract_ns; }
81 public Type ContractClientType { get; set; }
84 public DispatchRuntime CallbackDispatchRuntime { get; internal set; }
87 public SynchronizedCollection<IClientMessageInspector> MessageInspectors {
88 get { return inspectors; }
92 public KeyedCollection<string,ClientOperation> Operations {
93 get { return operations; }
96 public SynchronizedKeyedCollection<string,ClientOperation> Operations {
97 get { return operations; }
102 public ICollection<ClientOperation> ClientOperations {
103 get { throw new NotImplementedException (); }
107 public ICollection<IClientMessageInspector> ClientMessageInspectors {
108 get { throw new NotImplementedException (); }
111 public bool ManualAddressing {
112 get { return manual_addressing; }
113 set { manual_addressing = value; }
116 public int MaxFaultSize {
117 get { return max_fault_size; }
118 set { max_fault_size = value; }
121 public IClientOperationSelector OperationSelector {
122 get { return selector; }
123 set { selector = value; }
126 public bool ValidateMustUnderstand {
127 get { return validate; }
128 set { validate = value; }
137 public ClientOperation UnhandledClientOperation {
138 get { throw new NotImplementedException (); }
142 public bool MessageVersionNoneFaultsEnabled {
143 get { throw new NotImplementedException (); }
144 set { throw new NotImplementedException (); }