Package io.ebean.datasource
Interface DataSourcePool
-
- All Superinterfaces:
CommonDataSource,DataSource,Wrapper
public interface DataSourcePool extends DataSource
DataSource pool API.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description SQLExceptiongetDataSourceDownReason()Returns the reason, why the dataSource is down.StringgetName()Return the dataSource name.PoolStatusgetStatus(boolean reset)Return the current status of the connection pool.intgetWarningSize()Return the warning size.booleanisAutoCommit()Return true if the pool defaults to using autocommit.booleanisDataSourceUp()Returns false when the dataSource is down.booleanisOnline()Return true if the DataSource is online.voidoffline()Take the DataSource offline closing all connections and stopping heart beat checking.voidonline()Bring the DataSource online ensuring min connections and start heart beat checking.voidsetMaxSize(int max)Set a new maximum size.voidsetWarningSize(int warningSize)Set a new maximum size.voidshutdown()Shutdown the pool.intsize()Return the current size of the pool.-
Methods inherited from interface javax.sql.CommonDataSource
createShardingKeyBuilder, getParentLogger
-
Methods inherited from interface javax.sql.DataSource
createConnectionBuilder, getConnection, getConnection, getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
-
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
-
-
-
-
Method Detail
-
size
int size()
Return the current size of the pool. This includes both busy and idle connections.
-
isAutoCommit
boolean isAutoCommit()
Return true if the pool defaults to using autocommit.
-
isOnline
boolean isOnline()
Return true if the DataSource is online.Effectively the same as (synonym for)
isDataSourceUp().
-
online
void online() throws SQLException
Bring the DataSource online ensuring min connections and start heart beat checking.- Throws:
SQLException
-
offline
void offline()
Take the DataSource offline closing all connections and stopping heart beat checking.
-
shutdown
void shutdown()
Shutdown the pool.This is functionally the same as
offline()but generally we expect to only shutdown the pool once where as we can expect to making many calls to offline() and online().
-
getStatus
PoolStatus getStatus(boolean reset)
Return the current status of the connection pool.This is cheaper than getStatistics() in that it just the counts of free, busy, wait etc and does not included times (total connection time etc).
If you pass reset = true then the counters are reset.
-
isDataSourceUp
boolean isDataSourceUp()
Returns false when the dataSource is down.Effectively the same as (synonym for)
isOnline().
-
getDataSourceDownReason
SQLException getDataSourceDownReason()
Returns the reason, why the dataSource is down.
-
setMaxSize
void setMaxSize(int max)
Set a new maximum size. The pool should respect this new maximum immediately and not require a restart. You may want to increase the maxConnections if the pool gets large and hits the warning level.
-
setWarningSize
void setWarningSize(int warningSize)
Set a new maximum size. The pool should respect this new maximum immediately and not require a restart. You may want to increase the maxConnections if the pool gets large and hits the warning and or alert levels.
-
getWarningSize
int getWarningSize()
Return the warning size. When the pool hits this size it can send a notify message to an administrator.
-
-