org.logicalcobwebs.proxool
Class Prototyper

java.lang.Object
  extended by org.logicalcobwebs.proxool.Prototyper

public class Prototyper
extends java.lang.Object

Responsible for prototyping connections for all pools

Since:
Proxool 0.8
Version:
$Revision: 1.12 $, $Date: 2006/01/16 23:10:41 $
Author:
bill, $Author: billhorsman $ (current maintainer)

Constructor Summary
Prototyper(org.logicalcobwebs.proxool.ConnectionPool connectionPool)
           
 
Method Summary
 void cancel()
          Cancel all current prototyping
 java.lang.String getAlias()
          The alias of the pool we are prototyping for
 long getConnectionCount()
          The total number of connections, including those being built right now
 boolean quickRefuse()
          Give a quick answer to whether we should attempt to build a connection.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Prototyper

public Prototyper(org.logicalcobwebs.proxool.ConnectionPool connectionPool)
Method Detail

getConnectionCount

public long getConnectionCount()
The total number of connections, including those being built right now

Returns:
connectionCount;

cancel

public void cancel()
Cancel all current prototyping


getAlias

public java.lang.String getAlias()
The alias of the pool we are prototyping for

Returns:
alias

quickRefuse

public boolean quickRefuse()
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

Returns:
true if it's okay to attempt to get a connection, false if we should give up now. Just because this method returns true 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.