DispatchRuntime.cs 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  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. public sealed class DispatchRuntime
  42. {
  43. ClientRuntime callback_client_runtime;
  44. DispatchOperation.DispatchOperationCollection operations =
  45. new DispatchOperation.DispatchOperationCollection ();
  46. internal DispatchRuntime (EndpointDispatcher dispatcher)
  47. {
  48. EndpointDispatcher = dispatcher;
  49. UnhandledDispatchOperation = new DispatchOperation (
  50. this, "*", "*", "*");
  51. AutomaticInputSessionShutdown = true;
  52. PrincipalPermissionMode = PrincipalPermissionMode.UseWindowsGroups; // silly default value for us.
  53. SuppressAuditFailure = true;
  54. ValidateMustUnderstand = true;
  55. InputSessionShutdownHandlers = new SynchronizedCollection<IInputSessionShutdown> ();
  56. InstanceContextInitializers = new SynchronizedCollection<IInstanceContextInitializer> ();
  57. MessageInspectors = new SynchronizedCollection<IDispatchMessageInspector> ();
  58. }
  59. [MonoTODO]
  60. public AuditLogLocation SecurityAuditLogLocation { get; set; }
  61. [MonoTODO]
  62. public bool AutomaticInputSessionShutdown { get; set; }
  63. public ChannelDispatcher ChannelDispatcher {
  64. get { return EndpointDispatcher.ChannelDispatcher; }
  65. }
  66. [MonoTODO]
  67. public ConcurrencyMode ConcurrencyMode { get; set; }
  68. public EndpointDispatcher EndpointDispatcher { get; private set; }
  69. // FIXME: this is somewhat compromized solution to workaround
  70. // an issue that this runtime-creation-logic could result in
  71. // an infinite loop on callback instatiation between
  72. // ClientRuntime, but so far it works by this property...
  73. internal bool HasCallbackRuntime {
  74. get { return callback_client_runtime != null; }
  75. }
  76. public ClientRuntime CallbackClientRuntime {
  77. get {
  78. if (callback_client_runtime == null)
  79. callback_client_runtime = new ClientRuntime (EndpointDispatcher.ContractName, EndpointDispatcher.ContractNamespace);
  80. return callback_client_runtime;
  81. }
  82. internal set { callback_client_runtime = value; }
  83. }
  84. [MonoTODO]
  85. public ReadOnlyCollection<IAuthorizationPolicy> ExternalAuthorizationPolicies { get; set; }
  86. [MonoTODO]
  87. public bool IgnoreTransactionMessageProperty { get; set; }
  88. [MonoTODO]
  89. public bool ImpersonateCallerForAllOperations { get; set; }
  90. [MonoTODO]
  91. public SynchronizedCollection<IInputSessionShutdown> InputSessionShutdownHandlers { get; private set; }
  92. [MonoTODO]
  93. public SynchronizedCollection<IInstanceContextInitializer> InstanceContextInitializers { get; private set; }
  94. public IInstanceProvider InstanceProvider { get; set; }
  95. public IInstanceContextProvider InstanceContextProvider { get; set; }
  96. [MonoTODO]
  97. public AuditLevel MessageAuthenticationAuditLevel { get; set; }
  98. public SynchronizedCollection<IDispatchMessageInspector> MessageInspectors { get; private set; }
  99. public SynchronizedKeyedCollection<string,DispatchOperation> Operations {
  100. get { return operations; }
  101. }
  102. public IDispatchOperationSelector OperationSelector { get; set; }
  103. [MonoTODO]
  104. public PrincipalPermissionMode PrincipalPermissionMode { get; set; }
  105. [MonoTODO]
  106. public bool ReleaseServiceInstanceOnTransactionComplete { get; set; }
  107. [MonoTODO]
  108. public RoleProvider RoleProvider { get; set; }
  109. [MonoTODO]
  110. public AuditLevel ServiceAuthorizationAuditLevel { get; set; }
  111. [MonoTODO]
  112. public ServiceAuthorizationManager ServiceAuthorizationManager { get; set; }
  113. public InstanceContext SingletonInstanceContext { get; set; }
  114. [MonoTODO]
  115. public bool SuppressAuditFailure { get; set; }
  116. [MonoTODO]
  117. public SynchronizationContext SynchronizationContext { get; set; }
  118. [MonoTODO]
  119. public bool TransactionAutoCompleteOnSessionClose { get; set; }
  120. public Type Type { get; set; }
  121. public DispatchOperation UnhandledDispatchOperation { get; set; }
  122. public bool ValidateMustUnderstand { get; set; }
  123. }
  124. }