public OneWayRequestSuite() : base(40, 20) { IoC.Container = new Agatha.Unity.Container(); serviceLayerConfiguration = new ServiceLayerConfiguration(Assembly.GetExecutingAssembly(), Assembly.GetExecutingAssembly(), IoC.Container) { BusinessExceptionType = typeof(BusinessException), SecurityExceptionType = typeof(SecurityException), CacheManagerImplementation = typeof(CacheManagerSpy) }; serviceLayerConfiguration.Initialize(); // i want to take advantage of the automatic initialization, so i'm just resolving the requestprocessor instead of creating it requestProcessor = IoC.Container.Resolve <IRequestProcessor>(); // the cache manager is a singleton so i can just resolve it and it'll be the same one the request processor uses cacheManager = (CacheManagerSpy)IoC.Container.Resolve <ICacheManager>(); firstOneWayRequestHandler = MockRepository.GenerateMock <IOneWayRequestHandler <FirstOneWayRequest> >(); secondOneWayRequestHandler = MockRepository.GenerateMock <IOneWayRequestHandler <SecondOneWayRequest> >(); thirdOneWayRequestHandler = MockRepository.GenerateMock <IOneWayRequestHandler <ThirdOneWayRequest> >(); IoC.Container.RegisterInstance(firstOneWayRequestHandler); IoC.Container.RegisterInstance(secondOneWayRequestHandler); IoC.Container.RegisterInstance(thirdOneWayRequestHandler); }
public OneWayRequestSuite() : base(40, 20) { IoC.Container = new Agatha.Unity.Container(); serviceLayerConfiguration = new ServiceLayerConfiguration(Assembly.GetExecutingAssembly(), Assembly.GetExecutingAssembly(), IoC.Container) { BusinessExceptionType = typeof(BusinessException), SecurityExceptionType = typeof(SecurityException), CacheManagerImplementation = typeof(CacheManagerSpy) }; serviceLayerConfiguration.Initialize(); // i want to take advantage of the automatic initialization, so i'm just resolving the requestprocessor instead of creating it requestProcessor = IoC.Container.Resolve<IRequestProcessor>(); // the cache manager is a singleton so i can just resolve it and it'll be the same one the request processor uses cacheManager = (CacheManagerSpy)IoC.Container.Resolve<ICacheManager>(); firstOneWayRequestHandler = MockRepository.GenerateMock<IOneWayRequestHandler<FirstOneWayRequest>>(); secondOneWayRequestHandler = MockRepository.GenerateMock<IOneWayRequestHandler<SecondOneWayRequest>>(); thirdOneWayRequestHandler = MockRepository.GenerateMock<IOneWayRequestHandler<ThirdOneWayRequest>>(); IoC.Container.RegisterInstance(firstOneWayRequestHandler); IoC.Container.RegisterInstance(secondOneWayRequestHandler); IoC.Container.RegisterInstance(thirdOneWayRequestHandler); }
private void ExecuteHandler(OneWayRequest request, IOneWayRequestHandler handler) { try { BeforeHandle(request); handler.Handle(request); AfterHandle(request); } catch (Exception e) { OnHandlerException(request, e); } }
private void ExecuteHandler(OneWayRequest request, IOneWayRequestHandler handler) { BeforeHandle(request); handler.Handle(request); AfterHandle(request); }
public ProcessOneWayRequestsInputElement(IOneWayRequestHandler requestHandler, OneWayRequest request) { RequestHandler = requestHandler; Request = request; }