示例#1
0
        protected override object CreateHandlerFromScope <TBusEvent>(IDependencyResolverScope scope, TBusEvent busEvent, Type handlerType, BrokeredMessage brokeredMessage)
        {
            var handler = (IHandleMulticastEvent <TBusEvent>)scope.Resolve(handlerType);

            _propertyInjector.Inject(handler, brokeredMessage);
            return(handler);
        }
示例#2
0
        protected override object CreateHandlerFromScope <TBusEvent>(IDependencyResolverScope scope, TBusEvent busEvent, Type handlerType, NimbusMessage nimbusMessage)
        {
            var handler = (IHandleCompetingEvent <TBusEvent>)scope.Resolve(handlerType);

            _propertyInjector.Inject(handler, nimbusMessage);
            return(handler);
        }
 public IOutboundInterceptor[] CreateInterceptors(IDependencyResolverScope scope)
 {
     return _globalOutboundInterceptorTypes
         .Value
         .Select(t => (IOutboundInterceptor) scope.Resolve(t))
         .ToArray();
 }
 public IOutboundInterceptor[] CreateInterceptors(IDependencyResolverScope scope, BrokeredMessage brokeredMessage)
 {
     return(_globalOutboundInterceptorTypes
            .Value
            .Select(t => (IOutboundInterceptor)scope.Resolve(t))
            .Do(interceptor => _propertyInjector.Inject(interceptor, brokeredMessage))
            .ToArray());
 }
 public IOutboundInterceptor[] CreateInterceptors(IDependencyResolverScope scope, BrokeredMessage brokeredMessage)
 {
     return _globalOutboundInterceptorTypes
         .Value
         .Select(t => (IOutboundInterceptor) scope.Resolve(t))
         .Do(interceptor => _propertyInjector.Inject(interceptor, brokeredMessage))
         .ToArray();
 }
        public IInboundInterceptor[] CreateInterceptors(IDependencyResolverScope scope, object handler, object message)
        {
            var globalInterceptors = GetGlobalInterceptorTypes();
            var classLevelInterceptors = GetClassLevelInterceptorTypes(handler);
            var methodLevelInterceptors = GetMethodLevelInterceptorTypes(handler, message);

            var interceptors = new Type[0]
                .Union(globalInterceptors)
                .Union(classLevelInterceptors)
                .Union(methodLevelInterceptors)
                .DistinctBy(t => t.FullName)
                .Select(t => (IInboundInterceptor) scope.Resolve(t, t.FullName))
                .OrderByDescending(i => i.Priority)
                .ThenBy(i => i.GetType().FullName)
                .ToArray();

            return interceptors;
        }
示例#7
0
        public IInboundInterceptor[] CreateInterceptors(IDependencyResolverScope scope, object handler, object message, NimbusMessage nimbusMessage)
        {
            var globalInterceptors      = GetGlobalInterceptorTypes();
            var classLevelInterceptors  = GetClassLevelInterceptorTypes(handler);
            var methodLevelInterceptors = GetMethodLevelInterceptorTypes(handler, message);

            var interceptors = new Type[0]
                               .Union(globalInterceptors)
                               .Union(classLevelInterceptors)
                               .Union(methodLevelInterceptors)
                               .DistinctBy(t => t.FullName)
                               .Select(t => (IInboundInterceptor)scope.Resolve(t))
                               .Do(interceptor => _propertyInjector.Inject(interceptor, nimbusMessage))
                               .OrderByDescending(i => i.Priority)
                               .ThenBy(i => i.GetType().FullName)
                               .ToArray();

            return(interceptors);
        }