com.jolbox.bonecp
Class DefaultConnectionStrategy

java.lang.Object
  extended by com.jolbox.bonecp.AbstractConnectionStrategy
      extended by com.jolbox.bonecp.DefaultConnectionStrategy
All Implemented Interfaces:
ConnectionStrategy

public class DefaultConnectionStrategy
extends AbstractConnectionStrategy

The normal getConnection() strategy class in use. Attempts to get a connection from one or more configured partitions.

Author:
wallacew

Field Summary
 
Fields inherited from class com.jolbox.bonecp.AbstractConnectionStrategy
pool, terminationLock
 
Method Summary
protected  Connection getConnectionInternal()
          Actual call that returns a connection
static DefaultConnectionStrategy getInstance(BoneCP pool)
          Singleton pattern.
 ConnectionHandle pollConnection()
          Obtains a connection using the configured strategy without blocking.
 void terminateAllConnections()
          Closes off all connections in all partitions.
 
Methods inherited from class com.jolbox.bonecp.AbstractConnectionStrategy
getConnection, postConnection, preConnection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static DefaultConnectionStrategy getInstance(BoneCP pool)
Singleton pattern.

Parameters:
pool -
Returns:
DefaultConnectionStrategy

pollConnection

public ConnectionHandle pollConnection()
Description copied from interface: ConnectionStrategy
Obtains a connection using the configured strategy without blocking.

Specified by:
pollConnection in interface ConnectionStrategy
Overrides:
pollConnection in class AbstractConnectionStrategy
Returns:
Connection

getConnectionInternal

protected Connection getConnectionInternal()
                                    throws SQLException
Description copied from class: AbstractConnectionStrategy
Actual call that returns a connection

Specified by:
getConnectionInternal in class AbstractConnectionStrategy
Returns:
Connection
Throws:
SQLException

terminateAllConnections

public void terminateAllConnections()
Closes off all connections in all partitions.



Copyright © 2009-2012 JolBox. All Rights Reserved.