예제 #1
0
파일: LDCaching.cs 프로젝트: liyu7342/QL
 public LDCaching(string name, int localCacheTimeout, ICachingFactory dCachingFactory)
 {
     this._localCacheTimeout = 2;
     this._name = name;
     this._localCacheTimeout = localCacheTimeout;
     this._memoryCaching     = string.IsNullOrEmpty(name) ? new MemoryCaching() : new MemoryCaching(name);
     this._dCaching          = string.IsNullOrEmpty(name) ? dCachingFactory.Default : dCachingFactory.CreateCaching(name);
     this._monitors          = new Dictionary <string, HostFileChangeMonitor>(100, StringComparer.InvariantCultureIgnoreCase);
 }
        private readonly int _newsCacheExpiry = 20; //in minutes

        public InvestagramsApiCachedService(IStockApiRepository apiRepository,
                                            ISocialApiRepository socialApiRepository,
                                            ICalendarApiRepository calendarApiRepository,
                                            ICachingFactory cacheFactory,
                                            ISettingService settingService,
                                            IStockMarketStatusRepository marketStatusRepository)
            : base(apiRepository, socialApiRepository, calendarApiRepository)
        {
            _settingService         = settingService;
            _marketStatusRepository = marketStatusRepository;
            _cache = cacheFactory.GetCacheService();
        }
예제 #3
0
파일: LDCaching.cs 프로젝트: liyu7342/QL
 private static ICachingFactory GetDCachingFactory()
 {
     if (_cachingFactory == null)
     {
         lock (_dcacheLock)
         {
             if (_cachingFactory == null)
             {
                 string instance = ConfigurationManager.AppSettings["QL.Cache.LDCache.DCFactory"];
                 _cachingFactory = Utility.CreateInstance <ICachingFactory>(instance) ?? MemoryCachingFactory.Instance;
             }
         }
     }
     return(_cachingFactory);
 }
예제 #4
0
 public StockService(IDatabaseFactory databaseFactory, ISettingService settingService,
                     IRepository <Stock> stockRepository,
                     IStockHistoryRepository stockHistoryRepository, ICachingFactory cacheFactory,
                     ICookieProviderService cookieProviderService, IInvestagramsApiCachedService investagramsApiService,
                     IStockScoreService stockScoreService, IStockMarketStatusRepository stockMarketStatusRepository, ICandleStickAnalyzerService candleStickAnalyzerService, IEventRepository eventRepository)
 {
     _databaseFactory             = databaseFactory;
     _settingService              = settingService;
     _stockRepository             = stockRepository;
     _stockHistoryRepository      = stockHistoryRepository;
     _cookieProviderService       = cookieProviderService;
     _investagramsApiService      = investagramsApiService;
     _stockScoreService           = stockScoreService;
     _stockMarketStatusRepository = stockMarketStatusRepository;
     _candleStickAnalyzerService  = candleStickAnalyzerService;
     _eventRepository             = eventRepository;
     _cache = cacheFactory.GetCacheService();
 }
예제 #5
0
 private CachingManager(ICachingFactory cachingFactory)
 {
     _cachingFactory = cachingFactory;
     _cacheProvider = _cachingFactory.Create();
 }
예제 #6
0
 public EventRepository(IDatabaseFactory databaseFactory, ICachingFactory cacheFactory, IStockMarketStatusRepository stockMarketStatusRepository) : base(databaseFactory.GetContext())
 {
     _cache = cacheFactory.GetCacheService();
     _stockMarketStatusRepository = stockMarketStatusRepository;
 }
예제 #7
0
 private CachingManager(ICachingFactory cachingFactory)
 {
     _cachingFactory = cachingFactory;
     _cacheProvider  = _cachingFactory.Create();
 }
예제 #8
0
 public StockMarketStatusRepository(ICachingFactory cacheFactory, ISettingService settingService)
 {
     _settingService = settingService;
     _cache          = cacheFactory.GetCacheService();
 }
 public WatchListRepository(IDatabaseFactory databaseFactory, ICachingFactory cacheFactory) : base(databaseFactory.GetContext())
 {
     _cache = cacheFactory.GetCacheService();
 }