Ejemplo n.º 1
0
 public HttpRequestHandler(
     IContextHolder contextHolder,
     IResponseMapper <TIntent, TOutput> responseMapper)
 {
     _contextHolder  = contextHolder;
     _responseMapper = responseMapper;
 }
Ejemplo n.º 2
0
 public FilesController(ILogger <FilesController> logger, IHostingEnvironment environment, IContextHolder contextHolder)
 {
     _logger        = logger;
     _environment   = environment;
     _contextHolder = contextHolder;
     _mu            = new MuPdf();
 }
Ejemplo n.º 3
0
 public void CopyTo(IContextHolder destination)
 {
     foreach (var item in _contextItems)
     {
         destination.Context.SetValue((string)item.Key, item.Value);
     }
 }
Ejemplo n.º 4
0
        public PgConnectionFactory(IContextHolder contextHolder)
        {
            _contextHolder = contextHolder;

            DatabaseConfig pgConfig = contextHolder.Config.Persistence.Postgres;

            // validate config
            if (string.IsNullOrEmpty(pgConfig.Host))
            {
                throw new Exception("Postgres configuration: invalid or missing 'host'");
            }

            if (pgConfig.Port == 0)
            {
                throw new Exception("Postgres configuration: invalid or missing 'port'");
            }

            if (string.IsNullOrEmpty(pgConfig.Database))
            {
                throw new Exception("Postgres configuration: invalid or missing 'database'");
            }

            if (string.IsNullOrEmpty(pgConfig.User))
            {
                throw new Exception("Postgres configuration: invalid or missing 'user'");
            }

            // build connection string
            _connectionString = $"Server={pgConfig.Host};Port={pgConfig.Port};Database={pgConfig.Database};User Id={pgConfig.User};Password={pgConfig.Password};CommandTimeout=900;";
        }
Ejemplo n.º 5
0
        public void TestGetKill()
        {
            IContextHolder holder = NoContextHolder.Instance;

            CheckGet(holder);
            holder.KillContext();
            CheckGet(holder);
        }
 public static void ExpectGetContext(this IContextHolder mock, IInternalContainer worker,
                                     IInjectionContext result)
 {
     Expect.Once.On(mock)
     .Method("GetContext")
     .With(worker)
     .Will(Return.Value(result));
 }
Ejemplo n.º 7
0
        public ExchangeRateUpdater(IJobManager jobManager, IExchangeRateProvider exchangeRateProvider, IContextHolder contextHolder)
        {
            _jobManager           = jobManager;
            _exchangeRateProvider = exchangeRateProvider;
            _contextHolder        = contextHolder;
            LastExecuted          = DateTime.Now.AddSeconds(-RepetitionIntervalInSeconds * 2);

            _jobManager.Add(this);
        }
Ejemplo n.º 8
0
 public PricingHub(
     IPriceLastValueCache priceLastValueCache,
     ICurrencyPairRepository currencyPairRepository,
     IContextHolder contextHolder)
 {
     _priceLastValueCache = priceLastValueCache;
     _currencyPairRepository = currencyPairRepository;
     _contextHolder = contextHolder;
 }
Ejemplo n.º 9
0
 public PricingHub(
     IPriceLastValueCache priceLastValueCache,
     ICurrencyPairRepository currencyPairRepository,
     IContextHolder contextHolder)
 {
     _priceLastValueCache    = priceLastValueCache;
     _currencyPairRepository = currencyPairRepository;
     _contextHolder          = contextHolder;
 }
Ejemplo n.º 10
0
        protected void CheckGet(IContextHolder holder)
        {
            var internalContainerMock = GetMock <IInternalContainer>();

            internalContainerMock.Setup(c => c.CreateNewLog()).Returns((IGroboContainerLog)null);
            var context = holder.GetContext(internalContainerMock.Object);

            Assert.That(context, Is.InstanceOf <InjectionContext>());
            Assert.That(((InjectionContext)context).ThreadId, Is.EqualTo(Thread.CurrentThread.ManagedThreadId));
        }
Ejemplo n.º 11
0
        protected static void CheckGet(IContextHolder holder)
        {
            var container = GetMock <IInternalContainer>();

            container.Expect(c => c.CreateNewLog()).Return(null);
            var context = holder.GetContext(container);

            Assert.That(context, Is.InstanceOf <InjectionContext>());
            Assert.That(((InjectionContext)context).ThreadId, Is.EqualTo(Thread.CurrentThread.ManagedThreadId));
        }
Ejemplo n.º 12
0
        public DaemonClientFactory(IContextHolder contextHolder, JsonSerializerSettings jsonSerializerSettings)
        {
            _coinClientMap = new ConcurrentDictionary <CoinType, DaemonClient>();

            if (null != contextHolder.Config.Coins && contextHolder.Config.Coins.Length > 0)
            {
                foreach (CoinConfig config in contextHolder.Config.Coins)
                {
                    DaemonClient coinClient = new DaemonClient(jsonSerializerSettings, config.WalletPassword);
                    coinClient.Configure(config.Daemons);
                    _coinClientMap[config.Type] = coinClient;
                }
            }
        }
Ejemplo n.º 13
0
 public ExchangeService(IContextHolder contextHolder,
                        ITransferRequestRepository iTransferRequestRepository,
                        IConnectionFactory iConnectionFactory,
                        JsonSerializerSettings jsonSerializerSettings,
                        DaemonClientFactory daemonClientFactory,
                        PayoutManager payoutManager,
                        IJobManager jobManager)
 {
     _contextHolder = contextHolder;
     _iTransferRequestRepository = iTransferRequestRepository;
     _iConnectionFactory         = iConnectionFactory;
     _jsonSerializerSettings     = jsonSerializerSettings;
     _daemonClientFactory        = daemonClientFactory;
     _payoutManager = payoutManager;
     _jobManager    = jobManager;
 }
Ejemplo n.º 14
0
        public NotificationService(IContextHolder contextHolder, JsonSerializerSettings jsonSerializerSettings)
        {
            _contextHolder          = contextHolder;
            _jsonSerializerSettings = jsonSerializerSettings;
            _httpClient             = new HttpClient(new HttpClientHandler
            {
                AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip
            });
            if (contextHolder.Config.Notifications?.Enabled == true)
            {
                _queue = new BlockingCollection <QueuedNotification>();

                _queueSub = _queue.GetConsumingEnumerable()
                            .ToObservable(TaskPoolScheduler.Default)
                            .Select(notification => Observable.FromAsync(() => SendNotificationAsync(notification)))
                            .Concat()
                            .Subscribe();
            }
        }
Ejemplo n.º 15
0
        public PayoutManager(IJobManager jobManager,
                             IContextHolder contextHolder,
                             ITransferRequestRepository iTransferRequestRepository,
                             ITransferRepository iTransferRepository,
                             IConnectionFactory iConnectionFactory,
                             JsonSerializerSettings jsonSerializerSettings,
                             DaemonClientFactory daemonClientFactory,
                             NotificationService notificationService)
        {
            _jobManager    = jobManager;
            _contextHolder = contextHolder;
            _iTransferRequestRepository = iTransferRequestRepository;
            _iTransferRepository        = iTransferRepository;
            _iConnectionFactory         = iConnectionFactory;
            _jsonSerializerSettings     = jsonSerializerSettings;
            _daemonClientFactory        = daemonClientFactory;
            _notificationService        = notificationService;
            _updatingThroughput         = false;
            LastExecuted = DateTime.Now.AddSeconds(-RepetitionIntervalInSeconds * 2);

            _jobManager.Add(this);
        }
Ejemplo n.º 16
0
 public ReferenceDataHub(ICurrencyPairRepository currencyPairRepository, IContextHolder contextHolder)
 {
     _currencyPairRepository = currencyPairRepository;
     _contextHolder = contextHolder;
 }
Ejemplo n.º 17
0
 public TickerHubPublisher(IContextHolder contextHolder,
     ITickerRepository tickerRepository)
 {
     this.contextHolder = contextHolder;
     this.tickerRepository = tickerRepository;
 }
 public FilesPanelViewComponent(ILogger <FilesController> logger, IContextHolder contextHolder)
 {
     _logger        = logger;
     _contextHolder = contextHolder;
 }
Ejemplo n.º 19
0
 public BreadcrumbsViewComponent(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
 public TaskDetailsController(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Ejemplo n.º 21
0
 public TickerHub(ITickerRepository tickerRepository, IContextHolder contextHolder)
 {
     this.tickerRepository = tickerRepository;
     this.contextHolder = contextHolder;
 }
Ejemplo n.º 22
0
 public AnalyticsHub(IContextHolder contextHolder, IAnalyticsService analyticsService)
 {
     _contextHolder = contextHolder;
     _analyticsService = analyticsService;
 }
Ejemplo n.º 23
0
 public UnitOfWorkMock(Mock <ISessionFactory> sessionFactoryMock, IContextHolder contextHolder)
     : base(sessionFactoryMock.Object, contextHolder)
 {
     SessionFactoryMock = sessionFactoryMock;
 }
Ejemplo n.º 24
0
 public HomeController(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
 public FilesController(IContextHolder contextHolder, IStore store, IDocumentRender render)
 {
     _contextHolder = contextHolder;
     _store         = store;
     _render        = render;
 }
Ejemplo n.º 26
0
 public PricePublisher(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Ejemplo n.º 27
0
 public BlotterPublisher(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Ejemplo n.º 28
0
 public AccountController(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Ejemplo n.º 29
0
 public AgentHealthScanPublisher(IContextHolder contextHolder)
 {
     this.contextHolder = contextHolder;
 }
 public AnalyticsPublisher(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Ejemplo n.º 31
0
 public BlotterHub(ITradeRepository tradeRepository, IContextHolder contextHolder)
 {
     _tradeRepository = tradeRepository;
     _contextHolder = contextHolder;
 }
 public FileDetailsViewComponent(IContextHolder contextHolder, IDocumentRender render, IStore store)
 {
     _contextHolder = contextHolder;
     _render        = render;
     _store         = store;
 }
Ejemplo n.º 33
0
 public PricePublisher(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
 public AccountController(ILogger <FilesController> logger, IContextHolder contextHolder)
 {
     _logger        = logger;
     _contextHolder = contextHolder;
 }
 public SidePanelViewComponent(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Ejemplo n.º 36
0
 public TickerHubPublisher(IContextHolder contextHolder,
                           ITickerRepository tickerRepository)
 {
     this.contextHolder    = contextHolder;
     this.tickerRepository = tickerRepository;
 }
Ejemplo n.º 37
0
 public ReferenceDataHub(ICurrencyPairRepository currencyPairRepository, IContextHolder contextHolder)
 {
     _currencyPairRepository = currencyPairRepository;
     _contextHolder          = contextHolder;
 }
 public CurrencyPairUpdatePublisher(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Ejemplo n.º 39
0
 public Container(IInternalContainer internalContainer, IContextHolder holder, IGroboContainerLog currentLog)
 {
     this.internalContainer = internalContainer;
     this.holder            = holder;
     lastConstructedLog     = currentLog;
 }
Ejemplo n.º 40
0
 public BlotterHub(ITradeRepository tradeRepository, IContextHolder contextHolder)
 {
     _tradeRepository = tradeRepository;
     _contextHolder   = contextHolder;
 }