|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openanzo.common.rdb.container.ContainerConnectionPool
public class ContainerConnectionPool
Manages a pool of RDBConnection objects. Database connections and SQL prepared statements are allocated for each RDBConnection according to the ModelServiceProperties.
| Constructor Summary | |
|---|---|
ContainerConnectionPool(java.util.Properties properties,
LiteralIndexer literalIndexer)
Create new ContainerConnectionPool |
|
| Method Summary | |
|---|---|
RDBConnection |
acquireRDBConnection(int type)
Get a RDBConnection from the pool |
void |
clearNodeCaches()
Clear the caches in all connections |
void |
close()
Close a reference to the pool, and if last reference, close the pool |
CacheProvider |
getCacheProvider()
Get the cacheProvider |
java.lang.String |
getDatabaseDriver()
Get the database driver's class name |
java.lang.String |
getDatabasePassword()
Get the database password |
java.lang.String |
getDatabaseType()
Get the database type |
java.lang.String |
getDatabaseUrl()
Get the database connection URL |
java.lang.String |
getDatabaseUserName()
Get the database username |
boolean |
getIsStarted()
Determine if the pool is started |
int |
getQueryConnectionInactiveSize()
Get the number of inactive connections in the query pool |
int |
getQueryConnectionInUseSize()
Get the number of active connections in the query pool |
int |
getQueryConnectionMaxPoolSize()
Get the the max number of connections in the query pool |
int |
getQueryConnectionPoolMaxIdle()
Get the max idle connections in query pool |
long |
getQueryConnectionPoolMaxWaitTime()
Get the max time to wait for a connection in the query pool |
long |
getQueryConnectionPoolMinIdleTime()
Get the min idle time for connections in query pool |
java.lang.String |
getRepositoryInitFile()
Get the filename for initialization and query file for database |
int |
getWriteConnectionInactiveSize()
Get the number of inactive connections in the write pool |
int |
getWriteConnectionInUseSize()
Get the number of active connections in the write pool |
int |
getWriteConnectionMaxPoolSize()
Get the max number of connections in the write pool |
int |
getWriteConnectionPoolMaxIdle()
Get the max idle connections in write pool |
long |
getWriteConnectionPoolMaxWaitTime()
Get the max time to wait for a connection in the write pool |
long |
getWriteConnectionPoolMinIdleTime()
Get the min idle time for connections in write pool |
void |
prepareReleaseRDBConnections(int connectionsToPrepare)
Acquire and release a number of connections |
void |
purgeAndReset()
Close all existing pools, and reinitialize with current configuration settings |
void |
registerMBean(javax.management.ObjectName parentObjectName)
Register this pool with an MBean server |
void |
registerResetListener(IResetListener listener)
Register IResetListener with ContainerConnectionPool |
void |
releaseRDBConnection(RDBConnection connection)
Release a RDBConnection to the pool |
void |
reset(java.lang.Long id)
Notify all listeners about reset |
void |
setDatabaseDriver(java.lang.String dbDriver)
Set the name of the jdbc driver class |
void |
setDatabasePassword(java.lang.String password)
Set the database password |
void |
setDatabaseType(java.lang.String dbType)
Set the database type |
void |
setDatabaseUrl(java.lang.String jdbcUrl)
Set the database connection URL |
void |
setDatabaseUserName(java.lang.String userName)
Set the database username |
void |
setQueryConnectionMaxPoolSize(int size)
set the max size of the query pool |
void |
setQueryConnectionPoolMaxIdle(int max)
Set the max number of idle connections in the query pool |
void |
setQueryConnectionPoolMaxWaitTime(long maxWait)
Set the max time to wait for a connection in the query pool |
void |
setQueryConnectionPoolMinIdleTime(long minWait)
Set the minimum idle time for connections in the query pool |
void |
setRepositoryInitFile(java.lang.String dbInitFile)
Set the filename of the initialization and query file for database |
void |
setWriteConnectionMaxPoolSize(int size)
set the max size of the write pool |
void |
setWriteConnectionPoolMaxIdle(int max)
Set the max number of idle connections in the write pool |
void |
setWriteConnectionPoolMaxWaitTime(long maxWait)
Set the max time to wait for a connection in the write pool |
void |
setWriteConnectionPoolMinIdleTime(long minWait)
Set the minimum idle time for connections in the write pool |
void |
start()
Start the connection pools |
void |
stop()
Stop the connection pools |
void |
unregisterResetListener(IResetListener listener)
Unregister IResetListener from ContainerConnectionPool |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ContainerConnectionPool(java.util.Properties properties,
LiteralIndexer literalIndexer)
properties - Configuration propertiesliteralIndexer - optional literal indexer| Method Detail |
|---|
public void start()
throws AnzoException
AnzoException
public boolean getIsStarted()
throws AnzoException
AnzoExceptionpublic void stop()
public void registerMBean(javax.management.ObjectName parentObjectName)
parentObjectName - name of parent in MBean serverpublic void clearNodeCaches()
public void reset(java.lang.Long id)
id - of server that was reset
public void prepareReleaseRDBConnections(int connectionsToPrepare)
throws AnzoException
connectionsToPrepare - Number of connections to prepare and release
AnzoException
public RDBConnection acquireRDBConnection(int type)
throws AnzoException
type - Type of RDBConnection to acquire
AnzoExceptionpublic void releaseRDBConnection(RDBConnection connection)
connection - RDBConnection to releasepublic void close()
public void purgeAndReset()
public int getQueryConnectionInUseSize()
public int getQueryConnectionInactiveSize()
public int getQueryConnectionMaxPoolSize()
public int getWriteConnectionInUseSize()
public int getWriteConnectionInactiveSize()
public int getWriteConnectionMaxPoolSize()
public void setQueryConnectionMaxPoolSize(int size)
size - max size of the query poolpublic void setWriteConnectionMaxPoolSize(int size)
size - max size of the write poolpublic long getQueryConnectionPoolMaxWaitTime()
public long getWriteConnectionPoolMaxWaitTime()
public void setQueryConnectionPoolMaxWaitTime(long maxWait)
maxWait - timepublic void setWriteConnectionPoolMaxWaitTime(long maxWait)
maxWait - timepublic int getQueryConnectionPoolMaxIdle()
public long getQueryConnectionPoolMinIdleTime()
public int getWriteConnectionPoolMaxIdle()
public long getWriteConnectionPoolMinIdleTime()
public void setQueryConnectionPoolMaxIdle(int max)
max - number of idle connectionspublic void setQueryConnectionPoolMinIdleTime(long minWait)
minWait - idle time for connections in the query poolpublic void setWriteConnectionPoolMaxIdle(int max)
max - number of idle connectionspublic void setWriteConnectionPoolMinIdleTime(long minWait)
minWait - idle time for connections in the write poolpublic java.lang.String getDatabaseUrl()
public java.lang.String getDatabaseUserName()
public void setDatabaseUrl(java.lang.String jdbcUrl)
jdbcUrl - for connections in the poolpublic void setDatabaseUserName(java.lang.String userName)
userName - for database connectionspublic java.lang.String getDatabasePassword()
public void setDatabasePassword(java.lang.String password)
password - for database connectionspublic java.lang.String getDatabaseDriver()
public void setDatabaseDriver(java.lang.String dbDriver)
dbDriver - classname of jdbc driverpublic java.lang.String getDatabaseType()
public void setDatabaseType(java.lang.String dbType)
dbType - type of databasepublic java.lang.String getRepositoryInitFile()
public void setRepositoryInitFile(java.lang.String dbInitFile)
dbInitFile - initialization and query file for databasepublic void unregisterResetListener(IResetListener listener)
listener - Listener to unregisterpublic void registerResetListener(IResetListener listener)
listener - Listener to registerpublic CacheProvider getCacheProvider()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||