Example #1
0
        HistoryManagerAdapter GetOrCreateHistoryManagerAdapter(string symbol)
        {
            HistoryManagerAdapter result;

            lock (this.synchronizer)
            {
                if (!this.symbol2cache.TryGetValue(symbol, out result))
                {
                    var symbols = new HashSet <ISymbolProperties>
                    {
                        new SymbolProperties(symbol)
                    };

                    var storageVersion = this.storageVersion;

                    if (this.historyFeed != null)
                    {
                        storageVersion = this.historyFeed.Server.GetQuotesHistoryVersion();
                    }

                    var provider = HistoryManager.Create(
                        storageVersion,
                        this.store,
                        symbols,
                        DataFeedStorage.GetSupportedPeriodicityToStoreLevel(this.storageVersion),
                        this.saveTickLevel2History,
                        Cache.ClientInstance(Guid.NewGuid().ToString()),
                        true,
                        this.flushOnDispose,
                        NullMonitoringService,
                        NullMonitoringItem);

                    result = new HistoryManagerAdapter(provider);
                    this.symbol2cache[symbol] = result;
                }
            }

            return(result);
        }
Example #2
0
		HistoryManagerAdapter GetOrCreateHistoryManagerAdapter(string symbol)
		{
			HistoryManagerAdapter result;

			lock (this.synchronizer)
			{
				if (!this.symbol2cache.TryGetValue(symbol, out result))
				{
                    var symbols = new HashSet<string>
                    {
                        symbol
                    };

					var storageVersion = this.storageVersion;

					if (this.historyFeed != null)
						storageVersion = this.historyFeed.Server.GetQuotesHistoryVersion();

					var provider = HistoryManager.Create(
                        storageVersion,
                        this.store,
                        symbols,
                        DataFeedStorage.GetSupportedPeriodicityToStoreLevel(this.storageVersion),
                        this.saveTickLevel2History,
                        Cache.ClientInstance(Guid.NewGuid().ToString()),
                        true,
                        this.flushOnDispose,
                        NullMonitoringService,
                        NullMonitoringItem);

					result = new HistoryManagerAdapter(provider);
					this.symbol2cache[symbol] = result;
				}
			}

			return result;
		}