|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.csdn.modules.thrift.pool.BaseObjectPool.Builder<K,V>
public static class BaseObjectPool.Builder<K,V>
| Constructor Summary | |
|---|---|
BaseObjectPool.Builder(PoolableObjectFactory<K,V> factory)
BaseObjectPool's builder constructor |
|
| Method Summary | |
|---|---|
BaseObjectPool.Builder<K,V> |
borrowValidation(boolean borrowValidation)
Set whether this pool should validate the object by PoolableObjectFactory.validateObject(K, V) before returning a borrowed object to the user
Default is false. |
ObjectPool<K,V> |
build()
Create an ObjectPool instance with this builder's properties |
BaseObjectPool.Builder<K,V> |
disposable(boolean disposable)
Set disposable property If this pool is bounded and doesn't have idle objects any more, temporary object will be returned to the user if disposable is true. |
BaseObjectPool.Builder<K,V> |
keepAliveTimeoutInSecs(long keepAliveTimeoutInSecs)
Set the KeepAliveTimeout of this pool This pool will schedule BaseObjectPool.EvictionTask with this interval. |
BaseObjectPool.Builder<K,V> |
max(int max)
Set maximum size of this pool Default is unbounded as Integer.MAX_VALUE. |
BaseObjectPool.Builder<K,V> |
min(int min)
Set minimum size of this pool Default is 5. |
BaseObjectPool.Builder<K,V> |
returnValidation(boolean returnValidation)
Set whether this pool should validate the object by PoolableObjectFactory.validateObject(K, V) before returning a borrowed object to the pool
Default is false. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BaseObjectPool.Builder(PoolableObjectFactory<K,V> factory)
factory - PoolableObjectFactory which is for creating, validating and destroying an object| Method Detail |
|---|
public BaseObjectPool.Builder<K,V> min(int min)
min - min size
public BaseObjectPool.Builder<K,V> max(int max)
Integer.MAX_VALUE.
max - max size
public BaseObjectPool.Builder<K,V> borrowValidation(boolean borrowValidation)
PoolableObjectFactory.validateObject(K, V) before returning a borrowed object to the user
Default is false.
borrowValidation - true if validation will be needed
public BaseObjectPool.Builder<K,V> returnValidation(boolean returnValidation)
PoolableObjectFactory.validateObject(K, V) before returning a borrowed object to the pool
Default is false.
returnValidation - true if validation will be needed
public BaseObjectPool.Builder<K,V> disposable(boolean disposable)
disposable is true.
The disposable object will be returned to the pool, it will be destroyed silently.
Default is false.
disposable - true if the pool allows disposable objects
public BaseObjectPool.Builder<K,V> keepAliveTimeoutInSecs(long keepAliveTimeoutInSecs)
BaseObjectPool.EvictionTask with this interval.
BaseObjectPool.EvictionTask will evict idle objects if this pool has more than min objects.
If the given parameter is negative, this pool never schedules BaseObjectPool.EvictionTask.
Default is 1800.
keepAliveTimeoutInSecs - KeepAliveTimeout in seconds
public ObjectPool<K,V> build()
ObjectPool instance with this builder's properties
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||