Akka.Interfaced.NotificationHandlerBuilder.AddHandler C# (CSharp) Method

AddHandler() private method

private AddHandler ( Type interfaceType, MethodInfo method, Type invokePayloadType, FilterChain filterChain, bool isSyncHandler, bool isReentrant ) : void
interfaceType System.Type
method System.Reflection.MethodInfo
invokePayloadType System.Type
filterChain FilterChain
isSyncHandler bool
isReentrant bool
return void
        private void AddHandler(Type interfaceType, MethodInfo method, Type invokePayloadType, FilterChain filterChain, bool isSyncHandler, bool isReentrant)
        {
            if (method.IsGenericMethod == false)
            {
                if (isSyncHandler)
                {
                    _table.Add(invokePayloadType, new NotificationHandlerItem
                    {
                        InterfaceType = interfaceType,
                        IsReentrant = isReentrant,
                        Handler = BuildHandler(_type, invokePayloadType, method, filterChain)
                    });
                }
                else
                {
                    _table.Add(invokePayloadType, new NotificationHandlerItem
                    {
                        InterfaceType = interfaceType,
                        IsReentrant = isReentrant,
                        AsyncHandler = BuildAsyncHandler(_type, invokePayloadType, method, filterChain)
                    });
                }
            }
            else
            {
                // because a generic method needs parameter types to construct handler
                // so factory method is built to generate the handler when paramter types are ready

                if (isSyncHandler)
                {
                    _table.Add(invokePayloadType, new NotificationHandlerItem
                    {
                        InterfaceType = interfaceType,
                        IsReentrant = isReentrant,
                        IsGeneric = true,
                        GenericHandlerBuilder = t => new NotificationHandlerItem
                        {
                            InterfaceType = interfaceType,
                            IsReentrant = isReentrant,
                            Handler = BuildGenericHandler(_type, t, method, filterChain)
                        }
                    });
                }
                else
                {
                    _table.Add(invokePayloadType, new NotificationHandlerItem
                    {
                        InterfaceType = interfaceType,
                        IsReentrant = isReentrant,
                        IsGeneric = true,
                        GenericHandlerBuilder = t => new NotificationHandlerItem
                        {
                            InterfaceType = interfaceType,
                            IsReentrant = isReentrant,
                            AsyncHandler = BuildGenericAsyncHandler(_type, t, method, filterChain)
                        }
                    });
                }
            }
        }