コード例 #1
0
        /// <summary>
        /// Intercept the service.
        /// </summary>
        /// <param name="service">The service.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public ServerServiceDefinition Intercept(ServerServiceDefinition service, RpcConfigurationContext context)
        {
            Interceptor[] interceptors = RpcConfigurationUtility.CreateInterceptors(context, Interceptors, ExtraInterceptors);

            if (interceptors.Length > 0)
            {
                return(service.Intercept(interceptors));
            }
            else
            {
                return(service);
            }
        }
コード例 #2
0
        /// <summary>
        /// Create a <see cref="CallInvoker"/>.
        /// </summary>
        /// <param name="channel">The channel.</param>
        /// <param name="context">The context.</param>
        /// <returns></returns>
        public CallInvoker CreateCallInvoker(Channel channel, RpcConfigurationContext context)
        {
            Interceptor[] interceptors = RpcConfigurationUtility.CreateInterceptors(context, Interceptors, ExtraInterceptors);

            if (interceptors.Length > 0)
            {
                return(CreateRootCallInvoker(channel, context).Intercept(interceptors));
            }
            else
            {
                return(CreateRootCallInvoker(channel, context));
            }
        }