com.mchange.v1.db.sql
Class ConnectionBundlePoolImpl

java.lang.Object
  extended by com.mchange.v1.util.AbstractResourcePool
      extended by com.mchange.v1.db.sql.ConnectionBundlePoolImpl
All Implemented Interfaces:
ConnectionBundlePool, ClosableResource

public abstract class ConnectionBundlePoolImpl
extends AbstractResourcePool
implements ConnectionBundlePool


Nested Class Summary
 
Nested classes/interfaces inherited from class com.mchange.v1.util.AbstractResourcePool
AbstractResourcePool.TimeoutException
 
Constructor Summary
protected ConnectionBundlePoolImpl(int start, int max, int inc)
           
  ConnectionBundlePoolImpl(String jdbcUrl, String username, String pwd, int start, int max, int inc)
           
 
Method Summary
protected  Object acquireResource()
           
 void checkinBundle(ConnectionBundle bndl)
           
 ConnectionBundle checkoutBundle()
           
 void close()
          forces the release of any resources that might be associated with this object.
protected  void destroyResource(Object resc)
           
protected  void init(String jdbcUrl, String username, String pwd)
           
protected  void refurbishResource(Object resc)
          Called on checkout!
protected abstract  void setConnectionOptions(Connection con)
           
 
Methods inherited from class com.mchange.v1.util.AbstractResourcePool
checkinResource, checkoutResource, checkoutResource, init, markBad
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionBundlePoolImpl

public ConnectionBundlePoolImpl(String jdbcUrl,
                                String username,
                                String pwd,
                                int start,
                                int max,
                                int inc)
                         throws SQLException
Throws:
SQLException

ConnectionBundlePoolImpl

protected ConnectionBundlePoolImpl(int start,
                                   int max,
                                   int inc)
Method Detail

init

protected void init(String jdbcUrl,
                    String username,
                    String pwd)
             throws SQLException
Throws:
SQLException

checkoutBundle

public ConnectionBundle checkoutBundle()
                                throws SQLException,
                                       BrokenObjectException,
                                       InterruptedException
Specified by:
checkoutBundle in interface ConnectionBundlePool
Throws:
SQLException
BrokenObjectException
InterruptedException

checkinBundle

public void checkinBundle(ConnectionBundle bndl)
                   throws BrokenObjectException
Specified by:
checkinBundle in interface ConnectionBundlePool
Throws:
BrokenObjectException

close

public void close()
           throws SQLException
Description copied from interface: ClosableResource
forces the release of any resources that might be associated with this object.

Specified by:
close in interface ConnectionBundlePool
Specified by:
close in interface ClosableResource
Overrides:
close in class AbstractResourcePool
Throws:
SQLException

acquireResource

protected Object acquireResource()
                          throws Exception
Specified by:
acquireResource in class AbstractResourcePool
Throws:
Exception

refurbishResource

protected void refurbishResource(Object resc)
                          throws BrokenObjectException
Description copied from class: AbstractResourcePool
Called on checkout!

Specified by:
refurbishResource in class AbstractResourcePool
Throws:
BrokenObjectException

destroyResource

protected void destroyResource(Object resc)
                        throws Exception
Specified by:
destroyResource in class AbstractResourcePool
Throws:
Exception

setConnectionOptions

protected abstract void setConnectionOptions(Connection con)
                                      throws SQLException
Throws:
SQLException