org.logicalcobwebs.proxool
Class PrototyperController

java.lang.Object
  extended byorg.logicalcobwebs.proxool.PrototyperController

public class PrototyperController
extends java.lang.Object

Controls the prototypers

Since:
Proxool 0.8
Version:
$Revision: 1.5 $, $Date: 2003/03/10 23:43:11 $
Author:
bill, $Author: billhorsman $ (current maintainer)

Field Summary
private static boolean keepSweeping
           
private static Log LOG
           
private static PrototyperThread prototyperThread
           
 
Constructor Summary
PrototyperController()
           
 
Method Summary
protected static ProxyConnectionIF buildConnection(java.lang.String alias, int state, java.lang.String creator)
          Build a new connection
static void cancel(java.lang.String alias)
          Cancel this prototyper and stop all prototyping immediately.
protected static void checkSimultaneousBuildThrottle(java.lang.String alias)
          Checks whether we are currently already building too many connections
protected static void connectionRemoved(java.lang.String alias)
           
private static ConnectionPool getConnectionPool(java.lang.String alias)
           
static boolean isKeepSweeping()
           
static void sweepStarted()
           
protected static void triggerSweep(java.lang.String alias)
          Trigger prototyping immediately.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

private static final Log LOG

prototyperThread

private static PrototyperThread prototyperThread

keepSweeping

private static boolean keepSweeping
Constructor Detail

PrototyperController

public PrototyperController()
Method Detail

triggerSweep

protected static void triggerSweep(java.lang.String alias)
Trigger prototyping immediately. Runs inside a new Thread so control returns as quick as possible. You should call this whenever you suspect that building more connections might be a good idea.

Parameters:
alias -

buildConnection

protected static ProxyConnectionIF buildConnection(java.lang.String alias,
                                                   int state,
                                                   java.lang.String creator)
                                            throws java.sql.SQLException,
                                                   ProxoolException
Build a new connection

Parameters:
alias - identifies the pool
state - the initial state 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
Returns:
the new connection
Throws:
java.sql.SQLException - if there was a problem building the connection
ProxoolException - if the alias doesn't exist

getConnectionPool

private static ConnectionPool getConnectionPool(java.lang.String alias)
                                         throws ProxoolException
Throws:
ProxoolException

checkSimultaneousBuildThrottle

protected static void checkSimultaneousBuildThrottle(java.lang.String alias)
                                              throws java.sql.SQLException,
                                                     ProxoolException
Checks whether we are currently already building too many connections

Parameters:
alias - identifies the pool
Throws:
java.sql.SQLException - if the throttle has been reached
ProxoolException

cancel

public static void cancel(java.lang.String alias)
Cancel this prototyper and stop all prototyping immediately.

Parameters:
alias - identifies the pool

connectionRemoved

protected static void connectionRemoved(java.lang.String alias)

isKeepSweeping

public static boolean isKeepSweeping()

sweepStarted

public static void sweepStarted()