nf.fr.eraasoft.pool
Class PoolSettings<T>

java.lang.Object
  extended by nf.fr.eraasoft.pool.PoolSettings<T>
Type Parameters:
T -

public class PoolSettings<T>
extends java.lang.Object

Classe used to configure your object pooling. Instance of this classes must be used in a Singleton context (static variable).

Author:
eddie

Field Summary
static int DEFAUL_MAX_WAIT
          Wait (in second) before
static int DEFAULT_MAX
           
static int DEFAULT_MIN
           
static int DEFAULT_TIME_BETWEEN_TWO_CONTROLE
          Control thread
 
Constructor Summary
PoolSettings(PoolableObject<T> poolableObject)
          Create a new PoolSetting instance with a Poolable object
 
Method Summary
 void clearCurrentPool()
           
 boolean debug()
           
 PoolSettings<T> debug(boolean debug)
           
 int max()
           
 PoolSettings<T> max(int max)
          if
 int maxIdle()
           
 PoolSettings<T> maxIdle(int maxIdle)
           
 int maxWait()
           
 PoolSettings<T> maxWait(int maxWait)
           
 int min()
           
 PoolSettings<T> min(int min)
          Define the minimum number of element in the pool
 ObjectPool<T> pool()
           
static void shutdown()
           
static int timeBetweenTwoControls()
           
static void timeBetweenTwoControls(int time)
           
 boolean validateWhenReturn()
           
 PoolSettings<T> validateWhenReturn(boolean validateWhenReturn)
          if true invoke PoolableObject.validate() method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAUL_MAX_WAIT

public static final int DEFAUL_MAX_WAIT
Wait (in second) before

See Also:
Constant Field Values

DEFAULT_MIN

public static final int DEFAULT_MIN
See Also:
Constant Field Values

DEFAULT_MAX

public static final int DEFAULT_MAX
See Also:
Constant Field Values

DEFAULT_TIME_BETWEEN_TWO_CONTROLE

public static final int DEFAULT_TIME_BETWEEN_TWO_CONTROLE
Control thread

See Also:
Constant Field Values
Constructor Detail

PoolSettings

public PoolSettings(PoolableObject<T> poolableObject)
Create a new PoolSetting instance with a Poolable object

Parameters:
poolableObject -
Method Detail

timeBetweenTwoControls

public static void timeBetweenTwoControls(int time)

timeBetweenTwoControls

public static int timeBetweenTwoControls()

pool

public ObjectPool<T> pool()

maxIdle

public PoolSettings<T> maxIdle(int maxIdle)

maxIdle

public int maxIdle()

maxWait

public PoolSettings<T> maxWait(int maxWait)

min

public PoolSettings<T> min(int min)
Define the minimum number of element in the pool

Parameters:
min -
Returns:

max

public PoolSettings<T> max(int max)
if

Parameters:
max -
Returns:

min

public int min()

maxWait

public int maxWait()

max

public int max()

shutdown

public static void shutdown()

validateWhenReturn

public PoolSettings<T> validateWhenReturn(boolean validateWhenReturn)
if true invoke PoolableObject.validate() method

Parameters:
validateWhenReturn -
Returns:

validateWhenReturn

public boolean validateWhenReturn()

debug

public PoolSettings<T> debug(boolean debug)

debug

public boolean debug()

clearCurrentPool

public void clearCurrentPool()


Copyright © 2013. All Rights Reserved.