Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Licensed to the Apache Software Foundation (ASF) under one or more
   * contributor license agreements.  See the NOTICE file distributed with
   * this work for additional information regarding copyright ownership.
   * The ASF licenses this file to You under the Apache License, Version 2.0
   * (the "License"); you may not use this file except in compliance with
   * the License.  You may obtain a copy of the License at
   *
   *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package org.apache.commons.pool.impl;
 
A factory for creating GenericObjectPool instances.

Parameters:
<T> the type of objects held in this pool
Author(s):
Rodney Waldhoff
Version:
$Revision: 1222396 $ $Date: 2011-12-22 14:02:25 -0500 (Thu, 22 Dec 2011) $
Since:
Pool 1.0
See also:
GenericObjectPool
org.apache.commons.pool.ObjectPoolFactory
 
 public class GenericObjectPoolFactory<T> implements ObjectPoolFactory<T> {
    
Create a new GenericObjectPoolFactory.

Parameters:
factory the PoolableObjectFactory used by created pools.
See also:
GenericObjectPool.GenericObjectPool.(org.apache.commons.pool.PoolableObjectFactory)
 
     public GenericObjectPoolFactory(PoolableObjectFactory<T> factory) {
     }

    
Create a new GenericObjectPoolFactory.

Parameters:
factory the PoolableObjectFactory used by created pools.
config a non-null GenericObjectPool.Config describing the configuration.
Throws:
java.lang.NullPointerException when config is null.
See also:
GenericObjectPool.GenericObjectPool.(org.apache.commons.pool.PoolableObjectFactory,org.apache.commons.pool.impl.GenericObjectPool.Config)
 
         this(factory,config.maxActive,config.whenExhaustedAction,config.maxWait,config.maxIdle,config.minIdle,config.testOnBorrow,config.testOnReturn,config.timeBetweenEvictionRunsMillis,config.numTestsPerEvictionRun,config.minEvictableIdleTimeMillis,config.testWhileIdle,config.softMinEvictableIdleTimeMillisconfig.lifo);
     }

    
Create a new GenericObjectPoolFactory.

Parameters:
factory the PoolableObjectFactory used by created pools.
maxActive maximum number of objects that can be borrowed from created pools at one time.
See also:
GenericObjectPool.GenericObjectPool.(org.apache.commons.pool.PoolableObjectFactory,int)
 
     public GenericObjectPoolFactory(PoolableObjectFactory<T> factoryint maxActive) {
     }

    
Create a new GenericObjectPoolFactory.

Parameters:
factory the PoolableObjectFactory used by created pools.
maxActive maximum number of objects that can be borrowed from created pools at one time.
whenExhaustedAction the action to take when the pool is exhausted.
maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
See also:
GenericObjectPool.GenericObjectPool.(org.apache.commons.pool.PoolableObjectFactory,int,byte,long)
 
     public GenericObjectPoolFactory(PoolableObjectFactory<T> factoryint maxActivebyte whenExhaustedActionlong maxWait) {
     }

    
Create a new GenericObjectPoolFactory.

Parameters:
factory the PoolableObjectFactory used by created pools.
maxActive maximum number of objects that can be borrowed from created pools at one time.
whenExhaustedAction the action to take when the pool is exhausted.
maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
testOnBorrow whether to validate objects before they are returned by the borrowObject.
testOnReturn whether to validate objects after they are returned to the returnObject.
See also:
GenericObjectPool.GenericObjectPool.(org.apache.commons.pool.PoolableObjectFactory,int,byte,long,boolean,boolean)
 
     public GenericObjectPoolFactory(PoolableObjectFactory<T> factoryint maxActivebyte whenExhaustedActionlong maxWaitboolean testOnBorrowboolean testOnReturn) {
     }

    
Create a new GenericObjectPoolFactory.

Parameters:
factory the PoolableObjectFactory used by created pools.
maxActive maximum number of objects that can be borrowed from created pools at one time.
whenExhaustedAction the action to take when the pool is exhausted.
maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
maxIdle the maximum number of idle objects in my pool.
See also:
GenericObjectPool.GenericObjectPool.(org.apache.commons.pool.PoolableObjectFactory,int,byte,long,int)
    public GenericObjectPoolFactory(PoolableObjectFactory<T> factoryint maxActivebyte whenExhaustedActionlong maxWaitint maxIdle) {
    }

    
Create a new GenericObjectPoolFactory.

Parameters:
factory the PoolableObjectFactory used by created pools.
maxActive maximum number of objects that can be borrowed from created pools at one time.
whenExhaustedAction the action to take when the pool is exhausted.
maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
maxIdle the maximum number of idle objects in my pool.
testOnBorrow whether to validate objects before they are returned by the borrowObject.
testOnReturn whether to validate objects after they are returned to the returnObject.
See also:
GenericObjectPool.GenericObjectPool.(org.apache.commons.pool.PoolableObjectFactory,int,byte,long,int,boolean,boolean)
    public GenericObjectPoolFactory(PoolableObjectFactory<T> factoryint maxActivebyte whenExhaustedActionlong maxWaitint maxIdleboolean testOnBorrowboolean testOnReturn) {
    }

    
Create a new GenericObjectPoolFactory.

Parameters:
factory the PoolableObjectFactory used by created pools.
maxActive maximum number of objects that can be borrowed from created pools at one time.
whenExhaustedAction the action to take when the pool is exhausted.
maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
maxIdle the maximum number of idle objects in my pool.
testOnBorrow whether to validate objects before they are returned by the borrowObject.
testOnReturn whether to validate objects after they are returned to the returnObject.
timeBetweenEvictionRunsMillis the number of milliseconds to sleep between examining idle objects for eviction.
numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread.
minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.
testWhileIdle whether or not to validate objects in the idle object eviction thread.
See also:
GenericObjectPool.GenericObjectPool.(org.apache.commons.pool.PoolableObjectFactory,int,byte,long,int,boolean,boolean,long,int,long,boolean)
    public GenericObjectPoolFactory(PoolableObjectFactory<T> factoryint maxActivebyte whenExhaustedActionlong maxWaitint maxIdleboolean testOnBorrowboolean testOnReturnlong timeBetweenEvictionRunsMillisint numTestsPerEvictionRunlong minEvictableIdleTimeMillisboolean testWhileIdle) {
        this(factory,maxActive,whenExhaustedAction,maxWait,maxIdle,.,testOnBorrow,testOnReturn,timeBetweenEvictionRunsMillis,numTestsPerEvictionRun,minEvictableIdleTimeMillis,testWhileIdle.);
    }

    
Create a new GenericObjectPoolFactory.

Parameters:
factory the PoolableObjectFactory used by created pools.
maxActive maximum number of objects that can be borrowed from created pools at one time.
whenExhaustedAction the action to take when the pool is exhausted.
maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
maxIdle the maximum number of idle objects in my pool.
minIdle the minimum number of idle objects in my pool.
testOnBorrow whether to validate objects before they are returned by the borrowObject.
testOnReturn whether to validate objects after they are returned to the returnObject.
timeBetweenEvictionRunsMillis the number of milliseconds to sleep between examining idle objects for eviction.
numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread.
minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.
testWhileIdle whether or not to validate objects in the idle object eviction thread.
See also:
GenericObjectPool.GenericObjectPool.(org.apache.commons.pool.PoolableObjectFactory,int,byte,long,int,int,boolean,boolean,long,int,long,boolean)
    public GenericObjectPoolFactory(PoolableObjectFactory<T> factoryint maxActivebyte whenExhaustedActionlong maxWaitint maxIdleint minIdleboolean testOnBorrowboolean testOnReturnlong timeBetweenEvictionRunsMillisint numTestsPerEvictionRunlong minEvictableIdleTimeMillisboolean testWhileIdle) {
        this(factory,maxActive,whenExhaustedAction,maxWait,maxIdle,minIdle,testOnBorrow,testOnReturn,timeBetweenEvictionRunsMillis,numTestsPerEvictionRun,minEvictableIdleTimeMillis,testWhileIdle.);
    }

    
Create a new GenericObjectPoolFactory.

Parameters:
factory the PoolableObjectFactory used by created pools.
maxActive maximum number of objects that can be borrowed from created pools at one time.
whenExhaustedAction the action to take when the pool is exhausted.
maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
maxIdle the maximum number of idle objects in my pool.
minIdle the minimum number of idle objects in my pool.
testOnBorrow whether to validate objects before they are returned by the borrowObject.
testOnReturn whether to validate objects after they are returned to the returnObject.
timeBetweenEvictionRunsMillis the number of milliseconds to sleep between examining idle objects for eviction.
numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread.
minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.
testWhileIdle whether or not to validate objects in the idle object eviction thread.
softMinEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction with the extra condition that at least "minIdle" amount of object remain in the pool.
Since:
Pool 1.3
See also:
GenericObjectPool.GenericObjectPool.(org.apache.commons.pool.PoolableObjectFactory,int,byte,long,int,int,boolean,boolean,long,int,long,boolean,long)
    public GenericObjectPoolFactory(PoolableObjectFactory<T> factoryint maxActivebyte whenExhaustedActionlong maxWaitint maxIdleint minIdleboolean testOnBorrowboolean testOnReturnlong timeBetweenEvictionRunsMillisint numTestsPerEvictionRunlong minEvictableIdleTimeMillisboolean testWhileIdlelong softMinEvictableIdleTimeMillis) {
        this(factory,maxActive,whenExhaustedAction,maxWait,maxIdle,minIdle,testOnBorrow,testOnReturn,timeBetweenEvictionRunsMillis,numTestsPerEvictionRun,minEvictableIdleTimeMillis,testWhileIdle,softMinEvictableIdleTimeMillis.);
    }

    
Create a new GenericObjectPoolFactory.

Parameters:
factory the PoolableObjectFactory used by created pools.
maxActive maximum number of objects that can be borrowed from created pools at one time.
whenExhaustedAction the action to take when the pool is exhausted.
maxWait the maximum amount of time to wait for an idle object when the pool is exhausted.
maxIdle the maximum number of idle objects in my pool.
minIdle the minimum number of idle objects in my pool.
testOnBorrow whether to validate objects before they are returned by the borrowObject.
testOnReturn whether to validate objects after they are returned to the returnObject.
timeBetweenEvictionRunsMillis the number of milliseconds to sleep between examining idle objects for eviction.
numTestsPerEvictionRun the number of idle objects to examine per run within the idle object eviction thread.
minEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction.
testWhileIdle whether or not to validate objects in the idle object eviction thread.
softMinEvictableIdleTimeMillis the minimum number of milliseconds an object can sit idle in the pool before it is eligible for eviction with the extra condition that at least "minIdle" amount of object remain in the pool.
lifo whether or not objects are returned in last-in-first-out order from the idle object pool.
Since:
Pool 1.4
See also:
GenericObjectPool.GenericObjectPool.(org.apache.commons.pool.PoolableObjectFactory,int,byte,long,int,int,boolean,boolean,long,int,long,boolean,long,boolean)
    public GenericObjectPoolFactory(PoolableObjectFactory<T> factoryint maxActivebyte whenExhaustedActionlong maxWaitint maxIdleint minIdleboolean testOnBorrowboolean testOnReturnlong timeBetweenEvictionRunsMillisint numTestsPerEvictionRunlong minEvictableIdleTimeMillisboolean testWhileIdlelong softMinEvictableIdleTimeMillisboolean lifo) {
         = maxIdle;
         = minIdle;
         = maxActive;
         = maxWait;
         = whenExhaustedAction;
         = testOnBorrow;
         = testOnReturn;
         = testWhileIdle;
         = timeBetweenEvictionRunsMillis;
         = numTestsPerEvictionRun;
         = minEvictableIdleTimeMillis;
         = softMinEvictableIdleTimeMillis;
         = lifo;
         = factory;
    }

    
    public ObjectPool<T> createPool() {
    }

    
    

Returns:
the maxIdle setting for pools created by this factory.
Since:
1.5.5
    public int getMaxIdle() {
        return ;
    }

    

Returns:
the minIdle setting for pools created by this factory.
Since:
1.5.5
    public int getMinIdle() {
        return ;
    }

    

Returns:
the maxActive setting for pools created by this factory.
Since:
1.5.5
    public int getMaxActive() {
        return ;
    }

    

Returns:
the maxWait setting for pools created by this factory.
Since:
1.5.5
    public long getMaxWait() {
        return ;
    }

    

Returns:
the whenExhaustedAction setting for pools created by this factory.
Since:
1.5.5
    public byte getWhenExhaustedAction() {
        return ;
    }

    

Returns:
the testOnBorrow setting for pools created by this factory.
Since:
1.5.5
    public boolean getTestOnBorrow() {
        return ;
    }

    

Returns:
the testOnReturn setting for pools created by this factory.
Since:
1.5.5
    public boolean getTestOnReturn() {
        return ;
    }

    

Returns:
the testWhileIdle setting for pools created by this factory.
Since:
1.5.5
    public boolean getTestWhileIdle() {
        return ;
    }

    

Returns:
the timeBetweenEvictionRunsMillis setting for pools created by this factory.
Since:
1.5.5
    public long getTimeBetweenEvictionRunsMillis() {
        return ;
    }

    

Returns:
the numTestsPerEvictionRun setting for pools created by this factory.
Since:
1.5.5
    public int getNumTestsPerEvictionRun() {
        return ;
    }

    

Returns:
the minEvictableIdleTimeMillis setting for pools created by this factory.
Since:
1.5.5
    public long getMinEvictableIdleTimeMillis() {
        return ;
    }

    

Returns:
the softMinEvicatableIdleTimeMillis setting for pools created by this factory.
Since:
1.5.5
    public long getSoftMinEvictableIdleTimeMillis() {
        return ;
    }

    

Returns:
the lifo setting for pools created by this factory.
Since:
1.5.5
    public boolean getLifo() {
        return ;
    }

    

Returns:
the org.apache.commons.pool.PoolableObjectFactory used by pools created by this factory
    public PoolableObjectFactory<T> getFactory() {
        return ;
    }
  
    
The maxIdle setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getMaxIdle().
    @Deprecated
    protected int _maxIdle = .;
    
    
The minIdle setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getMinIdle().
    @Deprecated
    protected int _minIdle = .;
    
    
The maxActive setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getMaxActive().
    @Deprecated
    protected int _maxActive = .;
    
    
The maxWait setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getMaxWait().
    @Deprecated
    protected long _maxWait = .;
    
    
The whenExhaustedAction setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getWhenExhaustedAction().
    @Deprecated
    protected byte _whenExhaustedAction = .;
    
    
The testOnBorrow setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getTestOnBorrow().
    @Deprecated
    protected boolean _testOnBorrow = .;
    
    
The testOnReturn setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getTestOnReturn().
    @Deprecated
    protected boolean _testOnReturn = .;
    
    
The testWhileIdle setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getTestWhileIdle().
    @Deprecated
    protected boolean _testWhileIdle = .;
    
    
The timeBetweenEvictionRunsMillis setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getTimeBetweenEvictionRunsMillis().
    @Deprecated
The numTestsPerEvictionRun setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getNumTestsPerEvictionRun().
    @Deprecated
The minEvictableIdleTimeMillis setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getMinEvictableIdleTimeMillis().
    @Deprecated
The softMinEvictableIdleTimeMillis setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getSoftMinEvictableIdleTimeMillis().
    @Deprecated
The lifo setting for pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getLifo().
    @Deprecated
    protected boolean _lifo = .;
    
    
The org.apache.commons.pool.PoolableObjectFactory used by pools created by this factory.

Deprecated:
to be removed in pool 2.0. Use getFactory().
    @Deprecated
    protected PoolableObjectFactory<T> _factory = null;
New to GrepCode? Check out our FAQ X