org.logicalcobwebs.proxool
Class Prototyper
java.lang.Object
org.logicalcobwebs.proxool.Prototyper
public class Prototyper
extends java.lang.Object
Responsible for prototyping connections for all pools
$Revision: 1.14 $, $Date: 2006/03/23 11:44:57 $- bill
- $Author: billhorsman $ (current maintainer)
Prototyper(org.logicalcobwebs.proxool.ConnectionPool connectionPool)
|
Prototyper
public Prototyper(org.logicalcobwebs.proxool.ConnectionPool connectionPool)
buildConnection
protected ProxyConnection buildConnection(int status,
String creator)
throws SQLException,
ProxoolException
Build a new connection
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 audit
cancel
public void cancel()
Cancel all current prototyping
checkSimultaneousBuildThrottle
protected void checkSimultaneousBuildThrottle()
throws SQLException
Checks whether we are currently already building too many connections
connectionRemoved
protected void connectionRemoved()
This needs to be called _everytime_ a connection is removed.
getAlias
public String getAlias()
The alias of the pool we are prototyping for
getConnectionCount
public long getConnectionCount()
The total number of connections, including those being built right
now
isSweepNeeded
protected boolean isSweepNeeded()
quickRefuse
public void quickRefuse()
throws SQLException
Give a quick answer to whether we should attempt to build a connection. This can be quicker
if we are massively overloaded rather than cycling through each connection in the pool to
see if it's free
sweep
protected boolean sweep()
Trigger prototyping immediately
- true if something was prototyped
triggerSweep
protected void triggerSweep()