Esempio n. 1
0
 public HttpRequestHandler(
     IContextHolder contextHolder,
     IResponseMapper <TIntent, TOutput> responseMapper)
 {
     _contextHolder  = contextHolder;
     _responseMapper = responseMapper;
 }
Esempio n. 2
0
 public FilesController(ILogger <FilesController> logger, IHostingEnvironment environment, IContextHolder contextHolder)
 {
     _logger        = logger;
     _environment   = environment;
     _contextHolder = contextHolder;
     _mu            = new MuPdf();
 }
Esempio n. 3
0
 public void CopyTo(IContextHolder destination)
 {
     foreach (var item in _contextItems)
     {
         destination.Context.SetValue((string)item.Key, item.Value);
     }
 }
        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;";
        }
        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));
 }
Esempio 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);
        }
Esempio n. 8
0
 public PricingHub(
     IPriceLastValueCache priceLastValueCache,
     ICurrencyPairRepository currencyPairRepository,
     IContextHolder contextHolder)
 {
     _priceLastValueCache = priceLastValueCache;
     _currencyPairRepository = currencyPairRepository;
     _contextHolder = contextHolder;
 }
Esempio n. 9
0
 public PricingHub(
     IPriceLastValueCache priceLastValueCache,
     ICurrencyPairRepository currencyPairRepository,
     IContextHolder contextHolder)
 {
     _priceLastValueCache    = priceLastValueCache;
     _currencyPairRepository = currencyPairRepository;
     _contextHolder          = contextHolder;
 }
Esempio 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));
        }
Esempio 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));
        }
Esempio 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;
                }
            }
        }
Esempio 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;
 }
Esempio 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();
            }
        }
Esempio 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);
        }
Esempio n. 16
0
 public ReferenceDataHub(ICurrencyPairRepository currencyPairRepository, IContextHolder contextHolder)
 {
     _currencyPairRepository = currencyPairRepository;
     _contextHolder = contextHolder;
 }
Esempio 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;
 }
Esempio n. 19
0
 public BreadcrumbsViewComponent(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
 public TaskDetailsController(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Esempio n. 21
0
 public TickerHub(ITickerRepository tickerRepository, IContextHolder contextHolder)
 {
     this.tickerRepository = tickerRepository;
     this.contextHolder = contextHolder;
 }
 public AnalyticsHub(IContextHolder contextHolder, IAnalyticsService analyticsService)
 {
     _contextHolder = contextHolder;
     _analyticsService = analyticsService;
 }
Esempio n. 23
0
 public UnitOfWorkMock(Mock <ISessionFactory> sessionFactoryMock, IContextHolder contextHolder)
     : base(sessionFactoryMock.Object, contextHolder)
 {
     SessionFactoryMock = sessionFactoryMock;
 }
Esempio n. 24
0
 public HomeController(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
 public FilesController(IContextHolder contextHolder, IStore store, IDocumentRender render)
 {
     _contextHolder = contextHolder;
     _store         = store;
     _render        = render;
 }
Esempio n. 26
0
 public PricePublisher(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Esempio n. 27
0
 public BlotterPublisher(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Esempio n. 28
0
 public AccountController(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Esempio n. 29
0
 public AgentHealthScanPublisher(IContextHolder contextHolder)
 {
     this.contextHolder = contextHolder;
 }
 public AnalyticsPublisher(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Esempio 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;
 }
Esempio 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;
 }
Esempio n. 36
0
 public TickerHubPublisher(IContextHolder contextHolder,
                           ITickerRepository tickerRepository)
 {
     this.contextHolder    = contextHolder;
     this.tickerRepository = tickerRepository;
 }
 public ReferenceDataHub(ICurrencyPairRepository currencyPairRepository, IContextHolder contextHolder)
 {
     _currencyPairRepository = currencyPairRepository;
     _contextHolder          = contextHolder;
 }
 public CurrencyPairUpdatePublisher(IContextHolder contextHolder)
 {
     _contextHolder = contextHolder;
 }
Esempio n. 39
0
 public Container(IInternalContainer internalContainer, IContextHolder holder, IGroboContainerLog currentLog)
 {
     this.internalContainer = internalContainer;
     this.holder            = holder;
     lastConstructedLog     = currentLog;
 }
Esempio n. 40
0
 public BlotterHub(ITradeRepository tradeRepository, IContextHolder contextHolder)
 {
     _tradeRepository = tradeRepository;
     _contextHolder   = contextHolder;
 }