本文整理汇总了C#中System.ServiceModel.Dispatcher.DispatchRuntime类的典型用法代码示例。如果您正苦于以下问题:C# DispatchRuntime类的具体用法?C# DispatchRuntime怎么用?C# DispatchRuntime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DispatchRuntime类属于System.ServiceModel.Dispatcher命名空间,在下文中一共展示了DispatchRuntime类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime)
{
if (dispatchRuntime == null)
throw new ArgumentNullException("dispatchRuntime");
dispatchRuntime.InstanceProvider = this.instanceProvider;
dispatchRuntime.InstanceContextInitializers.Add((IInstanceContextInitializer) new UnityInstanceContextInitializer());
}
示例2: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime)
{
foreach (DispatchOperation op in dispatchRuntime.Operations)
{
op.ParameterInspectors.Add(new ParameterValidatorBehavior(ThrowErrorOnFirstError, ThrowErrorAfterValidation));
}
}
示例3: MethodInfoOperationSelector
void IContractBehavior.ApplyDispatchBehavior(ContractDescription description, ServiceEndpoint endpoint, DispatchRuntime dispatch)
{
if (dispatch.ClientRuntime != null)
{
dispatch.ClientRuntime.OperationSelector = new MethodInfoOperationSelector(description, MessageDirection.Output);
}
}
示例4: ApplyDispatchBehavior
public void ApplyDispatchBehavior(
ContractDescription contractDescription,
ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
dispatchRuntime.InstanceProvider = this;
}
示例5: ApplyDispatchBehavior
/// <summary>
/// 注册 服务实例创建提供者,将基于PIAB的实例生成器注入WCF扩展
/// </summary>
/// <param name="contractDescription"></param>
/// <param name="endpoint"></param>
/// <param name="dispatchRuntime"></param>
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
Type serviceContractType = contractDescription.ContractType;
dispatchRuntime.InstanceProvider = new PolicyInjectionInstanceProvider(serviceContractType,
this.PolicyInjectorName);
}
示例6: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
if (!TypeHelper.IsTypeOf<IDispatchMessageInspector>(_inspectorType)) return;
var inspector = TypeHelper.CreateInstance<IDispatchMessageInspector>(_inspectorType);
dispatchRuntime.MessageInspectors.Add(inspector);
}
示例7: EndpointDispatcher
EndpointDispatcher(EndpointDispatcher baseEndpoint, IEnumerable<AddressHeader> headers)
{
EndpointAddressBuilder builder = new EndpointAddressBuilder(baseEndpoint.EndpointAddress);
foreach (AddressHeader h in headers)
{
builder.Headers.Add(h);
}
EndpointAddress address = builder.ToEndpointAddress();
this.addressFilter = new EndpointAddressMessageFilter(address);
// channelDispatcher is Attached
this.contractFilter = baseEndpoint.ContractFilter;
this.contractName = baseEndpoint.ContractName;
this.contractNamespace = baseEndpoint.ContractNamespace;
this.dispatchRuntime = baseEndpoint.DispatchRuntime;
// endpointFilter is lazy
this.filterPriority = baseEndpoint.FilterPriority + 1;
this.originalAddress = address;
if (PerformanceCounters.PerformanceCountersEnabled)
{
this.perfCounterId = baseEndpoint.perfCounterId;
this.perfCounterBaseId = baseEndpoint.perfCounterBaseId;
}
this.id = baseEndpoint.id;
}
示例8: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime)
{
var behavior =
dispatchRuntime.ChannelDispatcher.Host.Description.FindBehavior
<WebAuthenticationConfigurationBehavior,
WebAuthenticationConfigurationAttribute>(b => b.BaseBehavior);
if (behavior == null)
behavior = contractDescription.FindBehavior
<WebAuthenticationConfigurationBehavior,
WebAuthenticationConfigurationAttribute>(b => b.BaseBehavior);
if (behavior == null)
throw new ServiceAuthenticationConfigurationMissingException();
var authorizationBehavior =
dispatchRuntime.ChannelDispatcher.Host.Description.FindBehavior
<WebAuthorizationConfigurationBehavior,
WebAuthorizationConfigurationAttribute>(b => b.BaseBehavior);
Type authorizationPolicy = null;
if (authorizationBehavior != null)
authorizationPolicy = authorizationBehavior.AuthorizationPolicyType;
foreach (var endpointDispatcher in dispatchRuntime.ChannelDispatcher.Endpoints)
endpointDispatcher.DispatchRuntime.MessageInspectors.Add(
new ServiceAuthenticationInspector(
behavior.ThrowIfNull().AuthenticationHandler,
behavior.UsernamePasswordValidatorType,
behavior.RequireSecureTransport,
behavior.Source,
authorizationPolicy));
}
示例9: NotImplementedException
void IContractBehavior.ApplyDispatchBehavior (
ContractDescription description,
ServiceEndpoint endpoint,
DispatchRuntime dispatch)
{
throw new NotImplementedException ();
}
示例10: ApplyDispatchBehavior
/// <summary>
///
/// </summary>
/// <param name="contractDescription"></param>
/// <param name="endpoint"></param>
/// <param name="dispatchRuntime">The runtime object that can be used to modify the default service behavior.</param>
public void ApplyDispatchBehavior(
ContractDescription contractDescription,
ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
dispatchRuntime.InstanceProvider = this; // set the provider to manage service objects instantiation
}
示例11: ApplyDispatchBehavior
void IContractBehavior.ApplyDispatchBehavior(ContractDescription contract, ServiceEndpoint endpoint, DispatchRuntime runtime)
{
//if (s_Logger.IsDebugEnabled)
//{
// s_Logger.DebugFormat("Applying dispatch ExceptionMarshallingBehavior to contract {0}", contract.ContractType.FullName);
//}
ApplyDispatchBehavior(runtime.ChannelDispatcher);
}
开发者ID:jandppw,项目名称:ppwcode-recovered-from-google-code,代码行数:8,代码来源:ExceptionMarshallingBehaviorAttribute.cs
示例12: ApplyDispatchBehavior
/// <summary>
/// Implements a modification or extension of the client across a contract.
/// </summary>
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
foreach (OperationDescription od in contractDescription.Operations)
{
InjectNetDataContractSerializer(od);
}
}
开发者ID:ChristianWeyer,项目名称:Thinktecture.ServiceModel,代码行数:11,代码来源:NetDataContractSerializerFormatAttribute.cs
示例13: CreateIfNecessary
public static TerminatingOperationBehavior CreateIfNecessary(DispatchRuntime dispatch)
{
if (IsTerminatingOperationBehaviorNeeded(dispatch))
{
return new TerminatingOperationBehavior();
}
return null;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:TerminatingOperationBehavior.cs
示例14: ApplyDispatchBehavior
/// <summary>
/// Implements a modification or extension of the client across a contract.
/// </summary>
/// <param name="contractDescription">The contract description to be modified.</param>
/// <param name="endpoint">The endpoint that exposes the contract.</param>
/// <param name="dispatchRuntime">The dispatch runtime that controls service execution.</param>
/// <exception cref="ArgumentNullException">The <paramref name="dispatchRuntime"/> is <c>null</c>.</exception>
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
Argument.IsNotNull("dispatchRuntime", dispatchRuntime);
dispatchRuntime.InstanceProvider = _instanceProvider;
dispatchRuntime.InstanceContextInitializers.Add(new InstanceContextInitializer());
}
示例15: CreateIfNeeded
internal static TransactionBehavior CreateIfNeeded(DispatchRuntime dispatch)
{
if (NeedsTransactionBehavior(dispatch))
{
return new TransactionBehavior(dispatch);
}
return null;
}