diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2009-08-07 10:33:38 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2009-08-07 10:33:38 +0400 |
commit | 0c22cb44ffb2e4f05e416a385f3f0e47305c330a (patch) | |
tree | 6cf8fa9b569fc8d56b2dd9648b206c6c1ba8da4f | |
parent | 061135e10bc8003105f673aeea138dd7b077c26a (diff) |
2009-08-07 Atsushi Enomoto <atsushi@ximian.com>
* ServiceRuntimeChannel.cs : change .ctor() args.
Add proxy hook methods that simply calls those in callback
ClientRuntimeChannel.
* InputOrReplyRequestProcessor.cs : now it could return an instance
of dynamically generated proxy over DuplexServiceRuntimeChannel.
svn path=/trunk/mcs/; revision=139550
4 files changed, 47 insertions, 8 deletions
diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog b/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog index a22d01cc63f..b4f30d194bd 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog +++ b/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/ChangeLog @@ -1,5 +1,10 @@ 2009-08-07 Atsushi Enomoto <atsushi@ximian.com> + * InputOrReplyRequestProcessor.cs : now it could return an instance + of dynamically generated proxy over DuplexServiceRuntimeChannel. + +2009-08-07 Atsushi Enomoto <atsushi@ximian.com> + * ClientRuntime.cs : oops, it should have been committed at a time. Change .ctor() args. Make some properties auto. diff --git a/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/InputOrReplyRequestProcessor.cs b/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/InputOrReplyRequestProcessor.cs index f97a2acb40c..68a18703eb6 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/InputOrReplyRequestProcessor.cs +++ b/mcs/class/System.ServiceModel/System.ServiceModel.Dispatcher/InputOrReplyRequestProcessor.cs @@ -54,9 +54,13 @@ namespace System.ServiceModel.Dispatcher OperationContext CreateOperationContext (Message incoming) { - ServiceRuntimeChannel contextChannel = new ServiceRuntimeChannel (reply_or_input, - dispatch_runtime.ChannelDispatcher.DefaultOpenTimeout, - dispatch_runtime.ChannelDispatcher.DefaultCloseTimeout); + ServiceRuntimeChannel contextChannel; + if (dispatch_runtime.CallbackClientRuntime != null) { + var type = ServiceProxyGenerator.CreateCallbackProxyType (dispatch_runtime.CallbackClientRuntime.CallbackClientType); + contextChannel = (ServiceRuntimeChannel) Activator.CreateInstance (type, new object [] {reply_or_input, dispatch_runtime}); + } + else + contextChannel = new ServiceRuntimeChannel (reply_or_input, dispatch_runtime); OperationContext opCtx = new OperationContext (contextChannel); opCtx.IncomingMessage = incoming; opCtx.EndpointDispatcher = dispatch_runtime.EndpointDispatcher; diff --git a/mcs/class/System.ServiceModel/System.ServiceModel/ChangeLog b/mcs/class/System.ServiceModel/System.ServiceModel/ChangeLog index ec54ad2463d..7d9177c3ea8 100755 --- a/mcs/class/System.ServiceModel/System.ServiceModel/ChangeLog +++ b/mcs/class/System.ServiceModel/System.ServiceModel/ChangeLog @@ -1,5 +1,11 @@ 2009-08-07 Atsushi Enomoto <atsushi@ximian.com> + * ServiceRuntimeChannel.cs : change .ctor() args. + Add proxy hook methods that simply calls those in callback + ClientRuntimeChannel. + +2009-08-07 Atsushi Enomoto <atsushi@ximian.com> + * ServiceHostBase.cs : create callback runtime here, if required. 2009-08-07 Atsushi Enomoto <atsushi@ximian.com> diff --git a/mcs/class/System.ServiceModel/System.ServiceModel/ServiceRuntimeChannel.cs b/mcs/class/System.ServiceModel/System.ServiceModel/ServiceRuntimeChannel.cs index 2f743240e9f..99b5f9740e4 100644 --- a/mcs/class/System.ServiceModel/System.ServiceModel/ServiceRuntimeChannel.cs +++ b/mcs/class/System.ServiceModel/System.ServiceModel/ServiceRuntimeChannel.cs @@ -36,11 +36,18 @@ namespace System.ServiceModel { internal class DuplexServiceRuntimeChannel : ServiceRuntimeChannel, IDuplexContextChannel { - public DuplexServiceRuntimeChannel (IChannel channel, TimeSpan openTimeout, TimeSpan closeTimeout) - : base (channel, openTimeout, closeTimeout) + public DuplexServiceRuntimeChannel (IChannel channel, DispatchRuntime runtime) + : base (channel, runtime) { + // setup callback ClientRuntimeChannel. + var crt = runtime.CallbackClientRuntime; + var cd = ContractDescriptionGenerator.GetCallbackContract (crt.CallbackClientType); + client = new ClientRuntimeChannel (crt, cd, this.DefaultOpenTimeout, this.DefaultCloseTimeout, channel, null, + runtime.ChannelDispatcher.MessageVersion, this.RemoteAddress, null); } + ClientRuntimeChannel client; + public bool AutomaticInputSessionShutdown { get { throw new NotImplementedException (); } set { throw new NotImplementedException (); } @@ -66,6 +73,23 @@ namespace System.ServiceModel { session_shutdown_delegate.EndInvoke (result); } + + // proxy base implementation. + + public IAsyncResult BeginProcess (MethodBase method, string operationName, object [] parameters, AsyncCallback callback, object asyncState) + { + return client.BeginProcess (method, operationName, parameters, callback, asyncState); + } + + public object EndProcess (MethodBase method, string operationName, object [] parameters, IAsyncResult result) + { + return client.EndProcess (method, operationName, parameters, result); + } + + public object Process (MethodBase method, string operationName, object [] parameters) + { + return client.Process (method, operationName, parameters); + } } internal class ServiceRuntimeChannel : CommunicationObject, IServiceChannel @@ -75,11 +99,11 @@ namespace System.ServiceModel readonly TimeSpan _openTimeout; readonly TimeSpan _closeTimeout; - public ServiceRuntimeChannel (IChannel channel, TimeSpan openTimeout, TimeSpan closeTimeout) + public ServiceRuntimeChannel (IChannel channel, DispatchRuntime runtime) { this.channel = channel; - this._openTimeout = openTimeout; - this._closeTimeout = closeTimeout; + this._openTimeout = runtime.ChannelDispatcher.DefaultOpenTimeout; + this._closeTimeout = runtime.ChannelDispatcher.DefaultCloseTimeout; } #region IContextChannel |