private void ApplyPolicies(IInterceptor interceptor, IInterceptingProxy proxy, object target, PolicySet policies)
 {
     foreach (MethodImplementationInfo method in interceptor.GetInterceptableMethods(target.GetType(), target.GetType()))
     {
         HandlerPipeline pipeline = new HandlerPipeline(policies.GetHandlersFor(method, container));
         proxy.SetPipeline(method.ImplementationMethodInfo, pipeline);
     }
 }
示例#2
0
        private void ApplyPolicies(IInterceptor interceptor, IInterceptingProxy proxy, object target, PolicySet policies)
        {
            PipelineManager manager = new PipelineManager();

            foreach (MethodImplementationInfo method in interceptor.GetInterceptableMethods(target.GetType(), target.GetType()))
            {
                HandlerPipeline pipeline = new HandlerPipeline(policies.GetHandlersFor(method, container));
                manager.SetPipeline(method.ImplementationMethodInfo, pipeline);
            }

            proxy.AddInterceptionBehavior(new PolicyInjectionBehavior(manager));
        }
        private void ApplyPolicies(IInterceptor interceptor, IInterceptingProxy proxy, object target, PolicySet policies)
        {
            PipelineManager manager = new PipelineManager();

            foreach (MethodImplementationInfo method in interceptor.GetInterceptableMethods(target.GetType(), target.GetType()))
            {
                HandlerPipeline pipeline = new HandlerPipeline(policies.GetHandlersFor(method, container));
                manager.SetPipeline(method.ImplementationMethodInfo, pipeline);
            }

            proxy.AddInterceptionBehavior(new PolicyInjectionBehavior(manager));
        }