org.logicalcobwebs.proxool
Class SimpoolAdapter

java.lang.Object
  extended by org.logicalcobwebs.proxool.SimpoolAdapter
All Implemented Interfaces:
ConnectionAdapterIF

public class SimpoolAdapter
extends java.lang.Object
implements ConnectionAdapterIF

This is the simplest pool you can get. It isn�t thread safe. It isn't robust. But it is fast. We use it as our bench mark on how could we should strive to be. Provides Simpool connections to the ScriptFacade

Since:
Proxool 0.5
Version:
$Revision: 1.11 $, $Date: 2003/03/04 10:24:40 $
Author:
Bill Horsman (bill@logicalcobwebs.co.uk), $Author: billhorsman $ (current maintainer)

Field Summary
private  java.sql.Connection[] connections
           
private  int index
           
private static Log LOG
           
 
Constructor Summary
SimpoolAdapter()
           
 
Method Summary
 void closeConnection(java.sql.Connection connection)
          This gives the adapter the flexibilty of closing the connection for real or just putting it back in a pool.
 java.sql.Connection getConnection()
          Simply get a connection (using the definitions defined in ConnectionAdapterIF.setup(java.lang.String, java.lang.String, java.util.Properties)
 java.lang.String getName()
          Convenient name so we can identify this adapter in logs.
 void setup(java.lang.String driver, java.lang.String url, java.util.Properties info)
          Setup the adapter.
 void tearDown()
          Reclaim resources used by the adapter (for instance, close any open connections)
 
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

connections

private java.sql.Connection[] connections

index

private int index
Constructor Detail

SimpoolAdapter

public SimpoolAdapter()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: ConnectionAdapterIF
Convenient name so we can identify this adapter in logs.

Specified by:
getName in interface ConnectionAdapterIF
Returns:
name

setup

public void setup(java.lang.String driver,
                  java.lang.String url,
                  java.util.Properties info)
           throws java.sql.SQLException
Description copied from interface: ConnectionAdapterIF
Setup the adapter. Define the connection. Prototype any connections as necessary.

Specified by:
setup in interface ConnectionAdapterIF
Parameters:
driver - the name of the class
url - the url to pass to the driver
info - the properties to pass to the driver
Throws:
java.sql.SQLException - if anything goes wrong

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Description copied from interface: ConnectionAdapterIF
Simply get a connection (using the definitions defined in ConnectionAdapterIF.setup(java.lang.String, java.lang.String, java.util.Properties)

Specified by:
getConnection in interface ConnectionAdapterIF
Returns:
the connection
Throws:
java.sql.SQLException - if anything goes wrong

closeConnection

public void closeConnection(java.sql.Connection connection)
Description copied from interface: ConnectionAdapterIF
This gives the adapter the flexibilty of closing the connection for real or just putting it back in a pool.

Specified by:
closeConnection in interface ConnectionAdapterIF
Parameters:
connection - the connection to "close"

tearDown

public void tearDown()
Description copied from interface: ConnectionAdapterIF
Reclaim resources used by the adapter (for instance, close any open connections)

Specified by:
tearDown in interface ConnectionAdapterIF