コード例 #1
0
        public GenericObjectPool(IPooledObjectFactory <T> factory,
                                 GenericObjectPoolConfig config) : base(config)
        {
            if (factory == null)
            {
                throw new Exception("factory may not be null");
            }
            this.factory = factory;

            idleObjects = new LinkedBlockingDeque <IPooledObject <T> >();

            SetConfig(config);

            // TODO startEvictor(getTimeBetweenEvictionRunsMillis());
        }
コード例 #2
0
 /**
  * Create a new ObjecDeque with the given fairness policy.
  * @param fairness true means client threads waiting to borrow / return instances
  * will be served as if waiting in a FIFO queue.
  */
 public ObjectDeque(bool fairness)
 {
     idleObjects = new LinkedBlockingDeque <IPooledObject <S> >();
 }