本文整理汇总了C#中System.ServiceModel.Dispatcher.DispatchRuntime类的典型用法代码示例。如果您正苦于以下问题:C# DispatchRuntime类的具体用法?C# DispatchRuntime怎么用?C# DispatchRuntime使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DispatchRuntime类属于System.ServiceModel.Dispatcher命名空间,在下文中一共展示了DispatchRuntime类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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());
}
开发者ID:gruan01,项目名称:Unity.WCF.4,代码行数:7,代码来源:UnityContractBehavior.cs
示例2: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ContractDescription contractDescription, ServiceEndpoint endpoint, DispatchRuntime dispatchRuntime)
{
foreach (DispatchOperation op in dispatchRuntime.Operations)
{
op.ParameterInspectors.Add(new ParameterValidatorBehavior(ThrowErrorOnFirstError, ThrowErrorAfterValidation));
}
}
开发者ID:Chunhui-Liu,项目名称:Blog,代码行数:7,代码来源:ParameterValidatorAttribute.cs
示例3: MethodInfoOperationSelector
void IContractBehavior.ApplyDispatchBehavior(ContractDescription description, ServiceEndpoint endpoint, DispatchRuntime dispatch)
{
if (dispatch.ClientRuntime != null)
{
dispatch.ClientRuntime.OperationSelector = new MethodInfoOperationSelector(description, MessageDirection.Output);
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:7,代码来源:OperationSelectorBehavior.cs
示例4: ApplyDispatchBehavior
public void ApplyDispatchBehavior(
ContractDescription contractDescription,
ServiceEndpoint endpoint,
DispatchRuntime dispatchRuntime)
{
dispatchRuntime.InstanceProvider = this;
}
开发者ID:tavisca-dhruvas,项目名称:Training,代码行数:7,代码来源:UnityServiceHostFactory.cs
示例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);
}
开发者ID:zlphoenix,项目名称:MyDemos,代码行数:13,代码来源:PolicyInjectionBehaviorAttribute.cs
示例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);
}
开发者ID:khoanguyen,项目名称:KLib40,代码行数:7,代码来源:ApplyMessageInspector.cs
示例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;
}
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:25,代码来源:EndpointDispatcher.cs
示例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));
}
开发者ID:wildart,项目名称:WcfRestContrib,代码行数:33,代码来源:ServiceAuthenticationBehavior.cs
示例9: NotImplementedException
void IContractBehavior.ApplyDispatchBehavior (
ContractDescription description,
ServiceEndpoint endpoint,
DispatchRuntime dispatch)
{
throw new NotImplementedException ();
}
开发者ID:nickchal,项目名称:pash,代码行数:7,代码来源:DeliveryRequirementsAttribute.cs
示例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
}
开发者ID:enzo3m,项目名称:DistributedComputing-WCF,代码行数:13,代码来源:ProcessingInstanceProvider.cs
示例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());
}
开发者ID:JaysonJG,项目名称:Catel,代码行数:15,代码来源:ContractBehavior.cs
示例15: CreateIfNeeded
internal static TransactionBehavior CreateIfNeeded(DispatchRuntime dispatch)
{
if (NeedsTransactionBehavior(dispatch))
{
return new TransactionBehavior(dispatch);
}
return null;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:TransactionBehavior.cs
示例16: lock
void IContractBehavior.ApplyDispatchBehavior(ContractDescription description,ServiceEndpoint endpoint,DispatchRuntime dispatchRuntime)
{
PoolName = PoolName ?? "Pool executing endpoints of " + ServiceType;
lock(typeof(ThreadPoolHelper))
{
ThreadPoolHelper.ApplyDispatchBehavior(ProvideSynchronizer(),PoolSize,ServiceType,PoolName,dispatchRuntime);
}
}
开发者ID:JMnITup,项目名称:HotelApp,代码行数:8,代码来源:ThreadPoolBehaviorAttribute.cs
示例17: CreateIfNecessary
public static SecurityImpersonationBehavior CreateIfNecessary(DispatchRuntime dispatch)
{
if (IsSecurityBehaviorNeeded(dispatch))
{
return new SecurityImpersonationBehavior(dispatch);
}
return null;
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:8,代码来源:SecurityImpersonationBehavior.cs
示例18: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ContractDescription description, ServiceEndpoint endpoint, DispatchRuntime dispatch)
{
dispatch.InstanceProvider = new ComPlusInstanceProvider(this.info);
dispatch.InstanceContextInitializers.Add(new ComPlusInstanceContextInitializer(this.info));
foreach (DispatchOperation operation in dispatch.Operations)
{
operation.CallContextInitializers.Add(new ComPlusThreadInitializer(description, operation, this.info));
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:9,代码来源:ComPlusContractBehavior.cs
示例19: ApplyDispatchBehavior
public void ApplyDispatchBehavior(ContractDescription description, ServiceEndpoint endpoint, DispatchRuntime dispatch)
{
dispatch.InstanceProvider = new MEFInstanceProvider();
lock (lockobject)
{
if (IOC.Container == null)
IOC.Container = MEFInstanceProvider._container;
}
}
开发者ID:qq5013,项目名称:cabinet,代码行数:9,代码来源:MefBehaviorAttribute.cs
示例20: ApplyDispatchBehavior
internal static void ApplyDispatchBehavior(Type type, string threadName, DispatchRuntime dispatch)
{
Debug.Assert(dispatch.SynchronizationContext == null);
if (m_Contexts.ContainsKey(type) == false)
{
m_Contexts[type] = new AffinitySynchronizer(threadName);
}
dispatch.SynchronizationContext = m_Contexts[type];
}
开发者ID:sajjadahmadi,项目名称:wcf-examples,代码行数:10,代码来源:ThreadAffinityHelper.cs
注:本文中的System.ServiceModel.Dispatcher.DispatchRuntime类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论