DispatchRuntime.cs 5.1 KB

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