Exemplo n.º 1
0
 public StoreReader(
     SessionFactory sessionFactory,
     HttpQueryParser httpQueryParser,
     HttpBowQueryParser httpDocumentQueryParser)
 {
     _sessionFactory     = sessionFactory;
     _httpQueryParser    = httpQueryParser;
     _httpBowQueryParser = httpDocumentQueryParser;
 }
Exemplo n.º 2
0
Arquivo: Start.cs Projeto: ikvm/resin
        public void OnApplicationStartup(
            IServiceCollection services, ServiceProvider serviceProvider, IConfigurationProvider config)
        {
            var model          = new BocModel();
            var httpParser     = new HttpQueryParser(new QueryParser());
            var httpBowParser  = new HttpBowQueryParser(httpParser);
            var sessionFactory = new SessionFactory(config, model);

            services.AddSingleton(typeof(IStringModel), model);
            services.AddSingleton(typeof(SessionFactory), sessionFactory);
            services.AddSingleton(typeof(HttpQueryParser), httpParser);
            services.AddSingleton(typeof(HttpBowQueryParser), new HttpBowQueryParser(httpParser));
            services.AddSingleton(typeof(IQueryFormatter), new QueryFormatter());
            services.AddSingleton(typeof(IWriter), new StoreWriter(sessionFactory));
            services.AddSingleton(typeof(IReader), new StoreReader(sessionFactory, httpParser, httpBowParser));
        }
Exemplo n.º 3
0
        public void OnApplicationStartup(
            IServiceCollection services, ServiceProvider serviceProvider, IConfigurationProvider config)
        {
            var tokenizer      = new UnicodeTokenizer();
            var httpParser     = new HttpQueryParser(new TermQueryParser(), tokenizer);
            var httpBowParser  = new HttpBowQueryParser(tokenizer, httpParser);
            var sessionFactory = new SessionFactory(config.Get("data_dir"), tokenizer, config);

            services.AddSingleton(typeof(ITokenizer), tokenizer);
            services.AddSingleton(typeof(SessionFactory), sessionFactory);
            services.AddSingleton(typeof(HttpQueryParser), httpParser);
            services.AddSingleton(typeof(HttpBowQueryParser), new HttpBowQueryParser(tokenizer, httpParser));
            services.AddSingleton(typeof(IQueryFormatter), new QueryFormatter());
            services.AddSingleton(typeof(IWriter), new StoreWriter(sessionFactory, tokenizer));
            services.AddSingleton(typeof(IReader), new StoreReader(sessionFactory, httpParser, httpBowParser, tokenizer));
        }
Exemplo n.º 4
0
        public StoreReader(
            SessionFactory sessionFactory, HttpQueryParser httpQueryParser, HttpBowQueryParser httpDocumentQueryParser, ITokenizer tokenizer, IEnumerable <IWriter> storeWriters)
        {
            _sessionFactory     = sessionFactory;
            _httpQueryParser    = httpQueryParser;
            _tokenizer          = tokenizer;
            _httpBowQueryParser = httpDocumentQueryParser;

            foreach (var writer in storeWriters)
            {
                if (writer is StoreWriter)
                {
                    _storeWriter = (StoreWriter)writer;
                    break;
                }
            }
        }