2 using System
.Collections
.Generic
;
4 using System
.ServiceModel
.Channels
;
5 using System
.ServiceModel
;
7 namespace System
.ServiceModel
.Dispatcher
9 internal class InitializingHandler
: BaseRequestProcessorHandler
11 protected override bool ProcessRequest (MessageProcessingContext mrc
)
13 InstanceContext ictx
= CreateInstanceContext (mrc
);
14 mrc
.InstanceContext
= ictx
;
15 mrc
.OperationContext
.InstanceContext
= ictx
;
19 InstanceContext
CreateInstanceContext (MessageProcessingContext mrc
)
21 InstanceContext iCtx
= null;
22 DispatchRuntime dispatchRuntime
= mrc
.OperationContext
.EndpointDispatcher
.DispatchRuntime
;
23 IInstanceContextProvider p
= dispatchRuntime
.InstanceContextProvider
;
26 iCtx
= p
.GetExistingInstanceContext (mrc
.IncomingMessage
, mrc
.OperationContext
.Channel
);
29 ServiceHostBase host
= dispatchRuntime
.ChannelDispatcher
.Host
;
30 iCtx
= new InstanceContext (dispatchRuntime
.ChannelDispatcher
.Host
, null, false);
33 iCtx
.Behavior
= new InstanceBehavior (dispatchRuntime
);