|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.idevlab.rjc.ds.PoolableDataSourceFactory
public class PoolableDataSourceFactory
| Field Summary | |
|---|---|
protected int |
initialSize
The initial number of connections that are created when the pool is started. |
protected int |
maxActive
The maximum number of active connections that can be allocated from this pool at the same time, or negative for no limit. |
protected int |
maxIdle
The maximum number of connections that can remain idle in the pool, without extra ones being released, or negative for no limit. |
protected long |
maxWait
The maximum number of milliseconds that the pool will wait (when there are no available connections) for a connection to be returned before throwing an exception, or <= 0 to wait indefinitely. |
protected long |
minEvictableIdleTimeMillis
The minimum amount of time an object may sit idle in the pool before it is eligable for eviction by the idle object evictor (if any). |
protected int |
minIdle
The minimum number of active connections that can remain idle in the pool, without extra ones being created, or 0 to create none. |
protected int |
numTestsPerEvictionRun
The number of objects to examine during each run of the idle object evictor thread (if any). |
protected boolean |
testOnBorrow
The indication of whether objects will be validated before being borrowed from the pool. |
protected boolean |
testOnReturn
The indication of whether objects will be validated before being returned to the pool. |
protected boolean |
testWhileIdle
The indication of whether objects will be validated by the idle object evictor (if any). |
protected long |
timeBetweenEvictionRunsMillis
The number of milliseconds to sleep between runs of the idle object evictor thread. |
| Constructor Summary | |
|---|---|
PoolableDataSourceFactory()
|
|
| Method Summary | |
|---|---|
DataSource |
create(String host,
int port)
Creates Redis data source |
int |
getInitialSize()
Returns the initial size of the connection pool. |
int |
getMaxActive()
Returns the maximum number of active connections that can be allocated at the same time. |
int |
getMaxIdle()
Returns the maximum number of connections that can remain idle in the pool. |
long |
getMaxWait()
Returns the maximum number of milliseconds that the pool will wait for a connection to be returned before throwing an exception. |
long |
getMinEvictableIdleTimeMillis()
Returns the minEvictableIdleTimeMillis property. |
int |
getMinIdle()
Returns the minimum number of idle connections in the pool |
int |
getNumTestsPerEvictionRun()
Returns the value of the numTestsPerEvictionRun property. |
String |
getPassword()
|
boolean |
getTestOnBorrow()
Returns the testOnBorrow property. |
boolean |
getTestOnReturn()
Returns the value of the testOnReturn property. |
boolean |
getTestWhileIdle()
Returns the value of the testWhileIdle property. |
long |
getTimeBetweenEvictionRunsMillis()
Returns the value of the timeBetweenEvictionRunsMillis
property. |
int |
getTimeout()
|
boolean |
isInitAfterCreation()
|
void |
setInitAfterCreation(boolean initAfterCreation)
|
void |
setInitialSize(int initialSize)
Sets the initial size of the connection pool. |
void |
setMaxActive(int maxActive)
Sets the maximum number of active connections that can be allocated at the same time. |
void |
setMaxIdle(int maxIdle)
Sets the maximum number of connections that can remain idle in the pool. |
void |
setMaxWait(long maxWait)
Sets the maxWait property. |
void |
setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
Sets the minEvictableIdleTimeMillis property. |
void |
setMinIdle(int minIdle)
Sets the minimum number of idle connections in the pool. |
void |
setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
Sets the value of the numTestsPerEvictionRun property. |
void |
setPassword(String password)
|
void |
setTestOnBorrow(boolean testOnBorrow)
Sets the testOnBorrow property. |
void |
setTestOnReturn(boolean testOnReturn)
Sets the testOnReturn property. |
void |
setTestWhileIdle(boolean testWhileIdle)
Sets the testWhileIdle property. |
void |
setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
Sets the timeBetweenEvictionRunsMillis property. |
void |
setTimeout(int timeout)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int maxActive
protected int maxIdle
protected int minIdle
protected int initialSize
protected long maxWait
protected boolean testOnBorrow
protected boolean testOnReturn
protected long timeBetweenEvictionRunsMillis
protected int numTestsPerEvictionRun
protected long minEvictableIdleTimeMillis
protected boolean testWhileIdle
| Constructor Detail |
|---|
public PoolableDataSourceFactory()
| Method Detail |
|---|
public DataSource create(String host,
int port)
DataSourceFactory
create in interface DataSourceFactoryhost - Redis hostport - Redis port
public boolean isInitAfterCreation()
public void setInitAfterCreation(boolean initAfterCreation)
public int getTimeout()
public void setTimeout(int timeout)
public String getPassword()
public void setPassword(String password)
public int getMaxActive()
Returns the maximum number of active connections that can be allocated at the same time.
A negative number means that there is no limit.
public void setMaxActive(int maxActive)
maxActive - the new value for maxActivegetMaxActive()public int getMaxIdle()
Returns the maximum number of connections that can remain idle in the pool.
A negative value indicates that there is no limit
public void setMaxIdle(int maxIdle)
maxIdle - the new value for maxIdlegetMaxIdle()public int getMinIdle()
GenericObjectPool.getMinIdle()public void setMinIdle(int minIdle)
minIdle - the new value for minIdleGenericObjectPool.setMinIdle(int)public int getInitialSize()
public void setInitialSize(int initialSize)
Sets the initial size of the connection pool.
Note: this method currently has no effect once the pool has been
initialized. The pool is initialized the first time one of the
getConnection method is invoked.
initialSize - the number of connections created when the pool
is initializedpublic long getMaxWait()
Returns the maximum number of milliseconds that the pool will wait for a connection to be returned before throwing an exception.
A value less than or equal to zero means the pool is set to wait indefinitely.
public void setMaxWait(long maxWait)
Sets the maxWait property.
Use -1 to make the pool wait indefinitely.
maxWait - the new value for maxWaitgetMaxWait()public boolean getTestOnBorrow()
testOnBorrow property.
testOnBorrowpublic void setTestOnBorrow(boolean testOnBorrow)
testOnBorrow property. This property determines
whether or not the pool will validate objects before they are borrowed
from the pool. For a true value to have any effect, the
validationQuery property must be set to a non-null string.
testOnBorrow - new value for testOnBorrow propertypublic boolean getTestOnReturn()
testOnReturn property.
testOnReturnpublic void setTestOnReturn(boolean testOnReturn)
testOnReturn property. This property determines
whether or not the pool will validate objects before they are returned
to the pool. For a true value to have any effect, the
validationQuery property must be set to a non-null string.
testOnReturn - new value for testOnReturn propertypublic long getTimeBetweenEvictionRunsMillis()
timeBetweenEvictionRunsMillis
property.
timeBetweenEvictionRunsMillispublic void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
timeBetweenEvictionRunsMillis property.
timeBetweenEvictionRunsMillis - the new time between evictor runstimeBetweenEvictionRunsMillispublic int getNumTestsPerEvictionRun()
numTestsPerEvictionRun property.
numTestsPerEvictionRunpublic void setNumTestsPerEvictionRun(int numTestsPerEvictionRun)
numTestsPerEvictionRun property.
numTestsPerEvictionRun - the new numTestsPerEvictionRun
valuenumTestsPerEvictionRunpublic long getMinEvictableIdleTimeMillis()
minEvictableIdleTimeMillis property.
minEvictableIdleTimeMillis propertyminEvictableIdleTimeMillispublic void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
minEvictableIdleTimeMillis property.
minEvictableIdleTimeMillis - the minimum amount of time an object
may sit idle in the poolminEvictableIdleTimeMillispublic boolean getTestWhileIdle()
testWhileIdle property.
testWhileIdlepublic void setTestWhileIdle(boolean testWhileIdle)
testWhileIdle property. This property determines
whether or not the idle object evictor will validate connections. For a
true value to have any effect, the
validationQuery property must be set to a non-null string.
testWhileIdle - new value for testWhileIdle property
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||