Add endpoint behavior support in NET_2_1, which involved not a few additions.
authorAtsushi Eno <atsushi@ximian.com>
Wed, 16 Mar 2011 08:20:00 +0000 (17:20 +0900)
committerAtsushi Eno <atsushi@ximian.com>
Wed, 16 Mar 2011 08:20:00 +0000 (17:20 +0900)
mcs/class/System.ServiceModel/Dummy_2_1.cs
mcs/class/System.ServiceModel/System.ServiceModel.Description/ServiceEndpoint.cs
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/DispatchOperation.cs
mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/DispatchRuntime.cs
mcs/class/System.ServiceModel/moonlight_raw_System.ServiceModel.dll.sources

index 7ad208512cc59fef3d7ee4b9d17bc5290ae7b2f1..f8f2af5162e1fd9b8d29d629777edea32698ce66 100644 (file)
@@ -53,7 +53,6 @@ namespace System.ServiceModel.Description
        public interface IPolicyImportExtension {}
        public interface IWsdlExportExtension {}
        public interface IWsdlImportExtension {}
-       public interface IContractBehavior {}
 
        // introduced for silverlight sdk compatibility
        internal class ServiceReflector
@@ -92,6 +91,12 @@ namespace System.ServiceModel.DiagnosticUtility
 }
 namespace System.ServiceModel.Dispatcher
 {
+       public class EndpointDispatcher
+       {
+               internal EndpointDispatcher ()
+               {
+               }
+       }
 }
 namespace System.ServiceModel.Security
 {
index e18c9a98fab3dcdbd64c2ba52d0fc0c7a9609b09..2f8ff573fcd65c4f31ab446674a74ae57ecbeeeb 100644 (file)
@@ -117,7 +117,7 @@ namespace System.ServiceModel.Description
                }
 
                internal void Validate () {
-#if !NET_2_1
+#if !MOONLIGHT
                        foreach (IContractBehavior b in Contract.Behaviors)
                                b.Validate (Contract, this);
                        foreach (IEndpointBehavior b in Behaviors)
index 0fdae05bd42d717710ce4bacc3fad182d6cf99e4..2188d18deb36d833277b62ed7e3acd45fa57eaba 100644 (file)
@@ -53,8 +53,9 @@ namespace System.ServiceModel.Dispatcher
                        release_after_call, release_before_call,
                        tx_auto_complete, tx_required,
                        auto_dispose_params = true;
-               ImpersonationOption impersonation;
                IDispatchMessageFormatter formatter;
+#if !NET_2_1
+               ImpersonationOption impersonation;
                IOperationInvoker invoker;
                SynchronizedCollection<IParameterInspector> inspectors
                        = new SynchronizedCollection<IParameterInspector> ();
@@ -62,6 +63,7 @@ namespace System.ServiceModel.Dispatcher
                        = new SynchronizedCollection<FaultContractInfo> ();
                SynchronizedCollection<ICallContextInitializer> ctx_initializers
                        = new SynchronizedCollection<ICallContextInitializer> ();
+#endif
 
                public DispatchOperation (DispatchRuntime parent,
                        string name, string action)
@@ -91,38 +93,16 @@ namespace System.ServiceModel.Dispatcher
                        get { return action; }
                }
 
+#if !NET_2_1
                public SynchronizedCollection<ICallContextInitializer> CallContextInitializers {
                        get { return ctx_initializers; }
                }
 
-               public bool AutoDisposeParameters {
-                       get { return auto_dispose_params; }
-                       set {
-                               ThrowIfOpened ();
-                               auto_dispose_params = value;
-                       }
-               }
-
-               public bool DeserializeRequest {
-                       get { return deserialize_request; }
-                       set {
-                               ThrowIfOpened ();
-                               deserialize_request = value;
-                       }
-               }
-
                public SynchronizedCollection<FaultContractInfo> FaultContractInfos {
                        get { return fault_contract_infos; }
                }
 
-               public IDispatchMessageFormatter Formatter {
-                       get { return formatter; }
-                       set {
-                               ThrowIfOpened ();
-                               formatter = value;
-                       }
-               }
-
+               [MonoTODO ("not considered")]
                public ImpersonationOption Impersonation {
                        get { return impersonation; }
                        set {
@@ -139,10 +119,6 @@ namespace System.ServiceModel.Dispatcher
                        }
                }
 
-               public bool IsOneWay {
-                       get { return is_oneway; }
-               }
-
                public bool IsTerminating {
                        get { return is_terminating; }
                        set {
@@ -151,18 +127,10 @@ namespace System.ServiceModel.Dispatcher
                        }
                }
 
-               public string Name {
-                       get { return name; }
-               }
-
                public SynchronizedCollection<IParameterInspector> ParameterInspectors {
                        get { return inspectors; }
                }
 
-               public DispatchRuntime Parent {
-                       get { return parent; }
-               }
-
                public bool ReleaseInstanceAfterCall {
                        get { return release_after_call; }
                        set {
@@ -183,14 +151,6 @@ namespace System.ServiceModel.Dispatcher
                        get { return reply_action; }
                }
 
-               public bool SerializeReply {
-                       get { return serialize_reply; }
-                       set {
-                               ThrowIfOpened ();
-                               serialize_reply = value;
-                       }
-               }
-
                public bool TransactionAutoComplete {
                        get { return tx_auto_complete; }
                        set {
@@ -206,9 +166,55 @@ namespace System.ServiceModel.Dispatcher
                                tx_required = value;
                        }
                }
+#endif
+
+               public bool AutoDisposeParameters {
+                       get { return auto_dispose_params; }
+                       set {
+                               ThrowIfOpened ();
+                               auto_dispose_params = value;
+                       }
+               }
+
+               public bool DeserializeRequest {
+                       get { return deserialize_request; }
+                       set {
+                               ThrowIfOpened ();
+                               deserialize_request = value;
+                       }
+               }
+
+               public IDispatchMessageFormatter Formatter {
+                       get { return formatter; }
+                       set {
+                               ThrowIfOpened ();
+                               formatter = value;
+                       }
+               }
+
+               public bool IsOneWay {
+                       get { return is_oneway; }
+               }
+
+               public string Name {
+                       get { return name; }
+               }
+
+               public DispatchRuntime Parent {
+                       get { return parent; }
+               }
+
+               public bool SerializeReply {
+                       get { return serialize_reply; }
+                       set {
+                               ThrowIfOpened ();
+                               serialize_reply = value;
+                       }
+               }
 
                void ThrowIfOpened ()
                {
+#if !NET_2_1
                        // FIXME: get callback client runtime status when ChannelDispatcher is not available.
                        var state = Parent.ChannelDispatcher != null ? Parent.ChannelDispatcher.State : CommunicationState.Created; // Parent.CallbackClientRuntime.ChannelFactory.State;
                        switch (state) {
@@ -217,6 +223,7 @@ namespace System.ServiceModel.Dispatcher
                                return;
                        }
                        throw new InvalidOperationException ("Cannot change this property after the service host is opened");
+#endif
                }
        }
 }
index 74a0ef8dfa3dc665747aa873a2573515f3d5ed7b..f2a48bf51788ee7492a833d26c299f6c7cb08d58 100644 (file)
@@ -29,18 +29,27 @@ using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
 using System.Reflection;
+#if !NET_2_1
 using System.IdentityModel.Policy;
-using System.ServiceModel.Channels;
+using System.Web.Security;
+#endif
 using System.Text;
 using System.Threading;
 using System.ServiceModel;
+using System.ServiceModel.Channels;
 using System.ServiceModel.Description;
-using System.Web.Security;
 
 namespace System.ServiceModel.Dispatcher
 {
        public sealed class DispatchRuntime
        {
+#if NET_2_1
+               internal DispatchRuntime (EndpointDispatcher dispatcher, ClientRuntime callbackClientRuntime)
+               {
+                       UnhandledDispatchOperation = new DispatchOperation (
+                               this, "*", "*", "*");
+               }
+#else
                DispatchOperation.DispatchOperationCollection operations =
                        new DispatchOperation.DispatchOperationCollection ();
 
@@ -137,8 +146,9 @@ namespace System.ServiceModel.Dispatcher
 
                public Type Type { get; set; }
 
-               public DispatchOperation UnhandledDispatchOperation { get; set; }
-
                public bool ValidateMustUnderstand { get; set; }
+#endif
+
+               public DispatchOperation UnhandledDispatchOperation { get; set; }
        }
 }
index 7f72fd23a71e2f6e3c7e1c0c7e241a25f8011470..a0b5d93ebc8033336b29a1db947543f056e4e587 100755 (executable)
@@ -134,6 +134,7 @@ System.ServiceModel.Description/ContractDescription.cs
 System.ServiceModel.Description/ContractDescriptionGenerator.cs
 System.ServiceModel.Description/FaultDescription.cs
 System.ServiceModel.Description/FaultDescriptionCollection.cs
+System.ServiceModel.Description/IContractBehavior.cs
 System.ServiceModel.Description/IEndpointBehavior.cs
 System.ServiceModel.Description/IOperationBehavior.cs
 System.ServiceModel.Description/MessageBodyDescription.cs
@@ -152,6 +153,8 @@ System.ServiceModel.Description/XmlName.cs
 System.ServiceModel.Dispatcher/BaseMessagesFormatter.cs
 System.ServiceModel.Dispatcher/ClientOperation.cs
 System.ServiceModel.Dispatcher/ClientRuntime.cs
+System.ServiceModel.Dispatcher/DispatchRuntime.cs
+System.ServiceModel.Dispatcher/DispatchOperation.cs
 System.ServiceModel.Dispatcher/FaultContractInfo.cs
 System.ServiceModel.Dispatcher/IChannelInitializer.cs
 System.ServiceModel.Dispatcher/IClientMessageFormatter.cs