public static RoutingChannelExtension Create(RoutingBehavior.RoutingEndpointBehavior endpointBehavior) { Type contractType = endpointBehavior.Endpoint.Contract.ContractType; if (contractType == typeof(IDuplexSessionRouter)) { return(new RoutingChannelExtension <IDuplexSessionRouter>(endpointBehavior)); } else if (contractType == typeof(ISimplexDatagramRouter)) { return(new RoutingChannelExtension <ISimplexDatagramRouter>(endpointBehavior)); } else if (contractType == typeof(IRequestReplyRouter)) { return(new RoutingChannelExtension <IRequestReplyRouter>(endpointBehavior)); } else { Fx.Assert(contractType == typeof(ISimplexSessionRouter), "Was a new contract added?"); return(new RoutingChannelExtension <ISimplexSessionRouter>(endpointBehavior)); } }
public RoutingChannelExtension(RoutingBehavior.RoutingEndpointBehavior endpointBehavior) { this.ActivityID = Guid.NewGuid(); this.endpointBehavior = endpointBehavior; this.thisLock = new object(); }