Ejemplo n.º 1
0
        public GenericKeyedObjectPool(IKeyedPooledObjectFactory <K, T> factory, GenericKeyedObjectPoolConfig config)
            : base(config)
        {
            if (factory == null)
            {
                throw new Exception("factory may not be null");
            }
            this.factory = factory;

            SetConfig(config);
        }
Ejemplo n.º 2
0
 private void SetConfig(GenericKeyedObjectPoolConfig conf)
 {
     setLifo(conf.getLifo());
     SetMaxIdlePerKey(conf.GetMaxIdlePerKey());
     SetMaxTotalPerKey(conf.GetMaxTotalPerKey());
     SetMaxTotal(conf.GetMaxTotal());
     SetMinIdlePerKey(conf.GetMinIdlePerKey());
     SetMaxWaitMillis(conf.getMaxWaitMillis());
     SetBlockWhenExhausted(conf.getBlockWhenExhausted());
     SetTestOnCreate(conf.getTestOnCreate());
     SetTestOnBorrow(conf.getTestOnBorrow());
     SetTestOnReturn(conf.getTestOnReturn());
     SetTestWhileIdle(conf.getTestWhileIdle());
     SetNumTestsPerEvictionRun(conf.getNumTestsPerEvictionRun());
     SetMinEvictableIdleTimeMillis(conf.getMinEvictableIdleTimeMillis());
     SetSoftMinEvictableIdleTimeMillis(
         conf.getSoftMinEvictableIdleTimeMillis());
     SetTimeBetweenEvictionRunsMillis(
         conf.getTimeBetweenEvictionRunsMillis());
     SetEvictionPolicyClassName(conf.getEvictionPolicyClassName());
 }