public CQRSService(
            IGamePlayEngine gamePlayEngine,
            IGamePlayListener gamePlayListener,
            IReadCacheDataRepository readCacheDataRepository,
            IGameDataRepository gameDataRepository,
            ICqrsLogicHandler logicHandler,
            IEventPublisher eventPublisher,
            IComponentContext componentContext,
            ILogFactory logFactory
            ) : base(componentContext, logFactory)
        {
            _gamePlayEngine          = gamePlayEngine;
            _gamePlayListener        = gamePlayListener;
            _readCacheDataRepository = readCacheDataRepository;
            _gameDataRepository      = gameDataRepository;

            _logicHandler = logicHandler;

            _handlers.AddRange(
                componentContext.ResolveAll <IHttpRequestHandler>()
                );

            _log = logFactory.CreateForType(this);

            // Subscribe myself to any event
            eventPublisher.Attach(this);
        }
        public AbstractService(
            IComponentContext componentContext,
            ILogFactory logFactory
            )
        {
            _eventPublisher = componentContext.Resolve <IEventPublisher>();
            _appSettings    = componentContext.Resolve <IAppSettings>();

            // Subscribe myself to any event
            _eventPublisher.Attach(this);

            _log = logFactory.CreateForType(this);
        }
Exemplo n.º 3
0
        public CqrsLogicHandler(
            IComponentContext componentContext,
            IEventPublisher eventPublisher,
            ILogFactory logFactory
            )
        {
            _componentContext = componentContext;
            _eventPublisher   = eventPublisher;

            _log = logFactory.CreateForType(this);

            // Subscribe myself to events fired by the publisher
            _eventPublisher.Attach(this);
        }