2
0

DispatchRuntime.cs 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. //
  2. // DispatchRuntime.cs
  3. //
  4. // Author:
  5. // Atsushi Enomoto <[email protected]>
  6. //
  7. // Copyright (C) 2005 Novell, Inc. http://www.novell.com
  8. //
  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:
  16. //
  17. // The above copyright notice and this permission notice shall be
  18. // included in all copies or substantial portions of the Software.
  19. //
  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.
  27. //
  28. using System;
  29. using System.Collections.Generic;
  30. using System.Collections.ObjectModel;
  31. using System.Reflection;
  32. using System.IdentityModel.Policy;
  33. using System.ServiceModel.Channels;
  34. using System.Text;
  35. using System.Threading;
  36. using System.ServiceModel;
  37. using System.ServiceModel.Description;
  38. using System.Web.Security;
  39. namespace System.ServiceModel.Dispatcher
  40. {
  41. [MonoTODO]
  42. public sealed class DispatchRuntime
  43. {
  44. EndpointDispatcher endpoint_dispatcher;
  45. AuditLogLocation audit_log_location;
  46. bool automatic_input_session_shutdown = true;
  47. bool suppress_audio_failure = true;
  48. bool completes_tx_on_close, ignore_tx_msg_props, inpersonate;
  49. bool release_tx_complete;
  50. bool validate_must_understand = true;
  51. ClientRuntime callback_client_runtime;
  52. ConcurrencyMode concurrency_mode;
  53. InstanceContext instance_context;
  54. IInstanceProvider instance_provider;
  55. IInstanceContextProvider instance_context_provider;
  56. AuditLevel msg_auth_audit_level, svc_auth_audit_level;
  57. IDispatchOperationSelector operation_selector;
  58. PrincipalPermissionMode perm_mode =
  59. PrincipalPermissionMode.UseWindowsGroups;
  60. SynchronizationContext sync_context;
  61. Type type;
  62. DispatchOperation unhandled_dispatch_oper;
  63. RoleProvider role_provider;
  64. ServiceAuthorizationManager auth_manager;
  65. SynchronizedCollection<IInputSessionShutdown>
  66. shutdown_handlers =
  67. new SynchronizedCollection<IInputSessionShutdown> ();
  68. SynchronizedCollection<IInstanceContextInitializer>
  69. inst_ctx_initializers =
  70. new SynchronizedCollection<IInstanceContextInitializer> ();
  71. SynchronizedCollection<IDispatchMessageInspector>
  72. msg_inspectors =
  73. new SynchronizedCollection<IDispatchMessageInspector> ();
  74. DispatchOperation.DispatchOperationCollection operations =
  75. new DispatchOperation.DispatchOperationCollection ();
  76. ReadOnlyCollection<IAuthorizationPolicy> ext_auth_policies;
  77. internal DispatchRuntime (EndpointDispatcher dispatcher)
  78. {
  79. endpoint_dispatcher = dispatcher;
  80. unhandled_dispatch_oper = new DispatchOperation (
  81. this, "*", "*", "*");
  82. }
  83. public AuditLogLocation SecurityAuditLogLocation {
  84. get { return audit_log_location; }
  85. set { audit_log_location = value; }
  86. }
  87. public bool AutomaticInputSessionShutdown {
  88. get { return automatic_input_session_shutdown; }
  89. set { automatic_input_session_shutdown = value; }
  90. }
  91. public ChannelDispatcher ChannelDispatcher {
  92. get { return endpoint_dispatcher.ChannelDispatcher; }
  93. }
  94. public ConcurrencyMode ConcurrencyMode {
  95. get { return concurrency_mode; }
  96. set { concurrency_mode = value; }
  97. }
  98. public EndpointDispatcher EndpointDispatcher {
  99. get { return endpoint_dispatcher; }
  100. }
  101. public ClientRuntime CallbackClientRuntime {
  102. get { return callback_client_runtime; }
  103. internal set { callback_client_runtime = value; }
  104. }
  105. public ReadOnlyCollection<IAuthorizationPolicy> ExternalAuthorizationPolicies {
  106. get { return ext_auth_policies; }
  107. set { ext_auth_policies = value; }
  108. }
  109. public bool IgnoreTransactionMessageProperty {
  110. get { return ignore_tx_msg_props; }
  111. set { ignore_tx_msg_props = value; }
  112. }
  113. public bool ImpersonateCallerForAllOperations {
  114. get { return inpersonate; }
  115. set { inpersonate = value; }
  116. }
  117. public SynchronizedCollection<IInputSessionShutdown>
  118. InputSessionShutdownHandlers {
  119. get { return shutdown_handlers; }
  120. }
  121. public SynchronizedCollection<IInstanceContextInitializer> InstanceContextInitializers {
  122. get { return inst_ctx_initializers; }
  123. }
  124. public IInstanceProvider InstanceProvider {
  125. get { return instance_provider; }
  126. set { instance_provider = value; }
  127. }
  128. public IInstanceContextProvider InstanceContextProvider {
  129. get { return instance_context_provider; }
  130. set { instance_context_provider = value; }
  131. }
  132. public AuditLevel MessageAuthenticationAuditLevel {
  133. get { return msg_auth_audit_level; }
  134. set { msg_auth_audit_level = value; }
  135. }
  136. public SynchronizedCollection<IDispatchMessageInspector> MessageInspectors {
  137. get { return msg_inspectors; }
  138. }
  139. public SynchronizedKeyedCollection<string,DispatchOperation> Operations {
  140. get { return operations; }
  141. }
  142. public IDispatchOperationSelector OperationSelector {
  143. get { return operation_selector; }
  144. set { operation_selector = value; }
  145. }
  146. public PrincipalPermissionMode PrincipalPermissionMode {
  147. get { return perm_mode; }
  148. set { perm_mode = value; }
  149. }
  150. public bool ReleaseServiceInstanceOnTransactionComplete {
  151. get { return release_tx_complete; }
  152. set { release_tx_complete = value; }
  153. }
  154. public RoleProvider RoleProvider {
  155. get { return role_provider; }
  156. set { role_provider = value; }
  157. }
  158. public AuditLevel ServiceAuthorizationAuditLevel {
  159. get { return svc_auth_audit_level; }
  160. set { svc_auth_audit_level = value; }
  161. }
  162. public ServiceAuthorizationManager ServiceAuthorizationManager {
  163. get { return auth_manager; }
  164. set { auth_manager = value; }
  165. }
  166. public InstanceContext SingletonInstanceContext {
  167. get { return instance_context; }
  168. set { instance_context = value; }
  169. }
  170. public bool SuppressAuditFailure {
  171. get { return suppress_audio_failure; }
  172. set { suppress_audio_failure = value; }
  173. }
  174. public SynchronizationContext SynchronizationContext {
  175. get { return sync_context; }
  176. set { sync_context = value; }
  177. }
  178. public bool TransactionAutoCompleteOnSessionClose {
  179. get { return completes_tx_on_close; }
  180. set { completes_tx_on_close = value; }
  181. }
  182. public Type Type {
  183. get { return type; }
  184. set { type = value; }
  185. }
  186. public DispatchOperation UnhandledDispatchOperation {
  187. get { return unhandled_dispatch_oper; }
  188. set { unhandled_dispatch_oper = value; }
  189. }
  190. public bool ValidateMustUnderstand {
  191. get { return validate_must_understand; }
  192. set { validate_must_understand = value; }
  193. }
  194. }
  195. }