Example #1
0
 public SqlQueryExecutor(IJsonCollectionFactory json_collection_factory,
                         ICache <IConnectionProvider> cache)
     : base(json_collection_factory)
 {
     cache_  = cache;
     logger_ = RestQLLogger.ForCurrentProcess;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AbstractSqlQueryExecutor"/> class
 /// using the specified collection of providers.
 /// </summary>
 /// <param name="json_collection_factory">
 /// A <see cref="IJsonCollectionFactory"/> object that can be used to
 /// create instances of the <see cref="IJsonCollection"/> class.
 /// </param>
 protected AbstractSqlQueryExecutor(
   IJsonCollectionFactory json_collection_factory) {
   if (json_collection_factory == null) {
     throw new ArgumentNullException("json_collection_factory");
   }
   json_collection_factory_ = json_collection_factory;
   logger_ = RestQLLogger.ForCurrentProcess;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="AbstractSqlQueryExecutor"/> class
 /// using the specified collection of providers.
 /// </summary>
 /// <param name="json_collection_factory">
 /// A <see cref="IJsonCollectionFactory"/> object that can be used to
 /// create instances of the <see cref="IJsonCollection"/> class.
 /// </param>
 protected AbstractSqlQueryExecutor(
     IJsonCollectionFactory json_collection_factory)
 {
     if (json_collection_factory == null)
     {
         throw new ArgumentNullException("json_collection_factory");
     }
     json_collection_factory_ = json_collection_factory;
     logger_ = RestQLLogger.ForCurrentProcess;
 }
        /// <summary>
        /// Creates a instance of the <see cref="IQueryExecutor"/> class by using
        /// the specified application settings.
        /// </summary>
        /// <param name="options">
        /// A <see cref="IDictionary{TKey,TValue}"/> containing the specific
        /// options configured for the query processor.
        /// </param>
        /// <returns>
        /// An instance of the <see cref="IQueryExecutor"/> class.
        /// </returns>
        public IQueryExecutor CreateQueryExecutor(
            IDictionary <string, string> options)
        {
            ICacheProvider cache_provider      = GetCacheProvider();
            ICache <IConnectionProvider> cache = new CacheBuilder <IConnectionProvider>()
                                                 .ExpireAfterAccess(settings_.QueryCacheDuration * 3, TimeUnit.Seconds)
                                                 .Build(cache_provider);
            IJsonCollectionFactory json_collection_factory =
                GetJsonCollectionFactory();

            return(new SqlQueryExecutor(json_collection_factory, cache));
        }
Example #5
0
 public SqlQueryExecutor(IJsonCollectionFactory json_collection_factory,
   ICache<IConnectionProvider> cache)
   : base(json_collection_factory) {
   cache_ = cache;
   logger_ = RestQLLogger.ForCurrentProcess;
 }