public final class FastConnectionPool extends Thread implements BeeConnectionPool, FastConnectionPoolMBean
Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| 构造器和说明 |
|---|
FastConnectionPool() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear(boolean forceCloseUsing)
Closes all connections and removes them from pool.
|
void |
clear(boolean forceCloseUsing,
BeeDataSourceConfig config)
Closes all connections and removes them from pool,then re-initialize pool with new configuration.
|
void |
close()
Closes all connections in pool and shutdown all work threads in pool,then pool state change to closed from working,
disable all operation on pool.
|
Connection |
getConnection()
Attempts to get a connection from pool.
|
int |
getConnectionCreatingCount()
Get connection count in creating
|
int |
getConnectionCreatingTimeoutCount()
Get connection count in creating timeout
|
int |
getIdleSize() |
BeeConnectionPoolMonitorVo |
getPoolMonitorVo()
Gets monitor object of pool runtime info.
|
String |
getPoolName() |
int |
getSemaphoreAcquiredSize() |
int |
getSemaphoreWaitingSize() |
int |
getStateCodeOnRelease() |
int |
getTotalSize() |
int |
getTransferWaitingSize() |
int |
getUsingSize() |
XAConnection |
getXAConnection()
Attempts to get a XAConnection from pool.
|
void |
init(BeeDataSourceConfig config)
Pool initializes,if success,pool state become to be ready for working,then borrowers can get connections from it.
|
Thread[] |
interruptConnectionCreating(boolean onlyInterruptTimeout)
interrupt threads creating connections
|
boolean |
isAlive(org.stone.beecp.pool.PooledConnection p) |
boolean |
isClosed()
Query pool state whether is closed.
|
void |
run() |
void |
setPrintRuntimeLog(boolean indicator)
Changes switch of log print.
|
boolean |
tryCatch(org.stone.beecp.pool.PooledConnection p) |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldpublic void init(BeeDataSourceConfig config) throws SQLException
BeeConnectionPoolinit 在接口中 BeeConnectionPoolconfig - is a configuration object,some items of it are used in initializationSQLException - when initializes failedpublic Connection getConnection() throws SQLException
BeeConnectionPoolgetConnection 在接口中 BeeConnectionPoolSQLException - when pool creates a connection failedConnectionGetTimeoutException - when borrower wait time out in poolConnectionGetInterruptedException - if interrupted while waiting in poolpublic XAConnection getXAConnection() throws SQLException
BeeConnectionPoolgetXAConnection 在接口中 BeeConnectionPoolSQLException - when pool creates a xa connection failedConnectionGetTimeoutException - when borrower wait time out in poolConnectionGetInterruptedException - if interrupted while waiting in poolpublic int getStateCodeOnRelease()
public boolean tryCatch(org.stone.beecp.pool.PooledConnection p)
public void clear(boolean forceCloseUsing)
throws SQLException
BeeConnectionPoolclear 在接口中 BeeConnectionPoolforceCloseUsing - is an indicator that close borrowed connections immediately,or that close them when them return to poolSQLException - when pool closed or in cleaningpublic void clear(boolean forceCloseUsing,
BeeDataSourceConfig config)
throws SQLException
BeeConnectionPoolclear 在接口中 BeeConnectionPoolforceCloseUsing - is an indicator that close borrowed connections immediately,or that close them when them return to poolconfig - is a new configuration objectSQLException - when pool closed or in cleaningpublic boolean isClosed()
BeeConnectionPoolisClosed 在接口中 BeeConnectionPoolpublic void close()
BeeConnectionPoolclose 在接口中 BeeConnectionPoolpublic void setPrintRuntimeLog(boolean indicator)
BeeConnectionPoolsetPrintRuntimeLog 在接口中 BeeConnectionPoolsetPrintRuntimeLog 在接口中 FastConnectionPoolMBeanindicator - is true that prints logs of pool work,false that disable printpublic int getTotalSize()
getTotalSize 在接口中 FastConnectionPoolMBeanpublic int getIdleSize()
getIdleSize 在接口中 FastConnectionPoolMBeanpublic int getUsingSize()
getUsingSize 在接口中 FastConnectionPoolMBeanpublic String getPoolName()
getPoolName 在接口中 FastConnectionPoolMBeanpublic int getSemaphoreWaitingSize()
public int getSemaphoreAcquiredSize()
public int getTransferWaitingSize()
public int getConnectionCreatingCount()
BeeConnectionPoolgetConnectionCreatingCount 在接口中 BeeConnectionPoolpublic int getConnectionCreatingTimeoutCount()
BeeConnectionPoolgetConnectionCreatingTimeoutCount 在接口中 BeeConnectionPoolpublic Thread[] interruptConnectionCreating(boolean onlyInterruptTimeout)
BeeConnectionPoolinterruptConnectionCreating 在接口中 BeeConnectionPoolonlyInterruptTimeout - is true,attempt to interrupt creation timeout threadspublic boolean isAlive(org.stone.beecp.pool.PooledConnection p)
public BeeConnectionPoolMonitorVo getPoolMonitorVo()
BeeConnectionPoolgetPoolMonitorVo 在接口中 BeeConnectionPoolCopyright © 2024. All rights reserved.