コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 private void ExecuteHandler(OneWayRequest request, IOneWayRequestHandler handler)
 {
     try
     {
         BeforeHandle(request);
         handler.Handle(request);
         AfterHandle(request);
     }
     catch (Exception e)
     {
         OnHandlerException(request, e);
     }
 }
コード例 #4
0
 private void ExecuteHandler(OneWayRequest request, IOneWayRequestHandler handler)
 {
     try
     {
         BeforeHandle(request);
         handler.Handle(request);
         AfterHandle(request);
     }
     catch (Exception e)
     {
         OnHandlerException(request, e);
     }
 }
コード例 #5
0
ファイル: RequestProcessor.cs プロジェクト: hoghweed/Agatha
 private void ExecuteHandler(OneWayRequest request, IOneWayRequestHandler handler)
 {
     BeforeHandle(request);
     handler.Handle(request);
     AfterHandle(request);
 }
コード例 #6
0
 public ProcessOneWayRequestsInputElement(IOneWayRequestHandler requestHandler, OneWayRequest request)
 {
     RequestHandler = requestHandler;
     Request = request;
 }
コード例 #7
0
 public ProcessOneWayRequestsInputElement(IOneWayRequestHandler requestHandler, OneWayRequest request)
 {
     RequestHandler = requestHandler;
     Request = request;
 }
コード例 #8
0
ファイル: RequestProcessor.cs プロジェクト: siimv/Agatha
 private void ExecuteHandler(OneWayRequest request, IOneWayRequestHandler handler)
 {
     BeforeHandle(request);
     handler.Handle(request);
     AfterHandle(request);
 }