DispatchRuntime.cs 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. //
  2. // DispatchRuntime.cs
  3. //
  4. // Author:
  5. // Atsushi Enomoto <[email protected]>
  6. //
  7. // Copyright (C) 2005-2010 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. #if !NET_2_1
  33. using System.IdentityModel.Policy;
  34. using System.Web.Security;
  35. #endif
  36. using System.Text;
  37. using System.Threading;
  38. using System.ServiceModel;
  39. using System.ServiceModel.Channels;
  40. using System.ServiceModel.Description;
  41. namespace System.ServiceModel.Dispatcher
  42. {
  43. public sealed class DispatchRuntime
  44. {
  45. #if NET_2_1
  46. internal DispatchRuntime (EndpointDispatcher dispatcher, ClientRuntime callbackClientRuntime)
  47. {
  48. UnhandledDispatchOperation = new DispatchOperation (
  49. this, "*", "*", "*");
  50. }
  51. #else
  52. DispatchOperation.DispatchOperationCollection operations =
  53. new DispatchOperation.DispatchOperationCollection ();
  54. internal DispatchRuntime (EndpointDispatcher dispatcher, ClientRuntime callbackClientRuntime)
  55. {
  56. EndpointDispatcher = dispatcher;
  57. CallbackClientRuntime = callbackClientRuntime ?? new ClientRuntime (EndpointDispatcher.ContractName, EndpointDispatcher.ContractNamespace, this);
  58. UnhandledDispatchOperation = new DispatchOperation (
  59. this, "*", "*", "*");
  60. AutomaticInputSessionShutdown = true;
  61. PrincipalPermissionMode = PrincipalPermissionMode.UseWindowsGroups; // silly default value for us.
  62. SuppressAuditFailure = true;
  63. ValidateMustUnderstand = true;
  64. InputSessionShutdownHandlers = new SynchronizedCollection<IInputSessionShutdown> ();
  65. InstanceContextInitializers = new SynchronizedCollection<IInstanceContextInitializer> ();
  66. MessageInspectors = new SynchronizedCollection<IDispatchMessageInspector> ();
  67. }
  68. [MonoTODO]
  69. public AuditLogLocation SecurityAuditLogLocation { get; set; }
  70. [MonoTODO]
  71. public bool AutomaticInputSessionShutdown { get; set; }
  72. public ChannelDispatcher ChannelDispatcher {
  73. get { return EndpointDispatcher.ChannelDispatcher; }
  74. }
  75. [MonoTODO]
  76. public ConcurrencyMode ConcurrencyMode { get; set; }
  77. public EndpointDispatcher EndpointDispatcher { get; private set; }
  78. public ClientRuntime CallbackClientRuntime { get; internal set; }
  79. [MonoTODO]
  80. public ReadOnlyCollection<IAuthorizationPolicy> ExternalAuthorizationPolicies { get; set; }
  81. [MonoTODO]
  82. public bool IgnoreTransactionMessageProperty { get; set; }
  83. [MonoTODO]
  84. public bool ImpersonateCallerForAllOperations { get; set; }
  85. [MonoTODO]
  86. public SynchronizedCollection<IInputSessionShutdown> InputSessionShutdownHandlers { get; private set; }
  87. [MonoTODO]
  88. public SynchronizedCollection<IInstanceContextInitializer> InstanceContextInitializers { get; private set; }
  89. public IInstanceProvider InstanceProvider { get; set; }
  90. public IInstanceContextProvider InstanceContextProvider { get; set; }
  91. [MonoTODO]
  92. public AuditLevel MessageAuthenticationAuditLevel { get; set; }
  93. public SynchronizedCollection<IDispatchMessageInspector> MessageInspectors { get; private set; }
  94. public SynchronizedKeyedCollection<string,DispatchOperation> Operations {
  95. get { return operations; }
  96. }
  97. public IDispatchOperationSelector OperationSelector { get; set; }
  98. [MonoTODO]
  99. public PrincipalPermissionMode PrincipalPermissionMode { get; set; }
  100. [MonoTODO]
  101. public bool ReleaseServiceInstanceOnTransactionComplete { get; set; }
  102. [MonoTODO]
  103. public RoleProvider RoleProvider { get; set; }
  104. [MonoTODO]
  105. public AuditLevel ServiceAuthorizationAuditLevel { get; set; }
  106. [MonoTODO]
  107. public ServiceAuthorizationManager ServiceAuthorizationManager { get; set; }
  108. public InstanceContext SingletonInstanceContext { get; set; }
  109. [MonoTODO]
  110. public bool SuppressAuditFailure { get; set; }
  111. [MonoTODO]
  112. public SynchronizationContext SynchronizationContext { get; set; }
  113. [MonoTODO]
  114. public bool TransactionAutoCompleteOnSessionClose { get; set; }
  115. public Type Type { get; set; }
  116. public bool ValidateMustUnderstand { get; set; }
  117. #endif
  118. public DispatchOperation UnhandledDispatchOperation { get; set; }
  119. }
  120. }