public class Prototyper extends Object
| 构造器和说明 |
|---|
Prototyper(org.logicalcobwebs.proxool.ConnectionPool connectionPool) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected ProxyConnection |
buildConnection(int status,
String creator)
Build a new connection
|
void |
cancel()
Cancel all current prototyping
|
protected void |
checkSimultaneousBuildThrottle()
Checks whether we are currently already building too many connections
|
protected void |
connectionRemoved()
This needs to be called _everytime_ a connection is removed.
|
String |
getAlias()
The alias of the pool we are prototyping for
|
long |
getConnectionCount()
The total number of connections, including those being built right
now
|
protected boolean |
isSweepNeeded() |
void |
quickRefuse()
Give a quick answer to whether we should attempt to build a connection.
|
protected boolean |
sweep()
Trigger prototyping immediately
|
protected void |
triggerSweep() |
protected boolean isSweepNeeded()
protected void triggerSweep()
protected boolean sweep()
protected ProxyConnection buildConnection(int status, String creator) throws SQLException, ProxoolException
status - the initial status it will be created as (this allows us
to create it as ACTIVE and avoid
another thread grabbing it before we can)creator - for log auditSQLExceptionProxoolExceptionprotected void connectionRemoved()
protected void checkSimultaneousBuildThrottle()
throws SQLException
SQLException - if the throttle has been reachedpublic long getConnectionCount()
public void cancel()
public String getAlias()
public void quickRefuse()
throws SQLException
SQLException - if it is a waste of time even trying to get a connaction. Just because this method
doesn't throw an exception it doesn't guarantee that one will be available. There is a slight
risk that we might tell the client to give up when a connection could become available in the next few
milliseconds but our policy is to refuse connections quickly when overloaded.Copyright © 2024. All rights reserved.