com.cafesoft.core.jdbc
Class StandardPoolableConnectionFactory

java.lang.Object
  |
  +--com.cafesoft.core.jdbc.StandardPoolableConnectionFactory
All Implemented Interfaces:
Debuggable, LoggerClient, PoolableConnectionFactory

public class StandardPoolableConnectionFactory
extends Object
implements PoolableConnectionFactory

Standard implementation of the PoolableConnectionFactory

Since:
10/31/02
See Also:
PoolableConnectionFactory

Method Summary
 void activate(Connection conn)
          Activate the Connection
 Connection create(ConnectionConfig config)
          Create a new Connection
 void destroy(Connection conn)
          Destroy the Connection Object
static PoolableConnectionFactory getInstance()
          Static accessor method
 void passivate(Connection conn)
          Passivate the Connection
 void setConnectionPool(ConnectionPool connPool)
          Set the ConnectionPool this Factory belongs to
 boolean setDebug(boolean enable)
          Enable or disable debugging.
 void setLogger(Logger logger)
          Sets the logger.
 boolean validate(Connection conn)
          Validate the Connection object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static final PoolableConnectionFactory getInstance()
Static accessor method

Returns:
the singleton instance of the PoolableConnectionFactory

setLogger

public void setLogger(Logger logger)
Sets the logger.

Specified by:
setLogger in interface LoggerClient
Parameters:
logger - logs messages

setDebug

public boolean setDebug(boolean enable)
Enable or disable debugging.

Specified by:
setDebug in interface Debuggable
Parameters:
enable - if true, enable debugging, else disable debugging.
Returns:
the previous value of the debug flag, which is useful for restoring the debug state if temporarily changed.

setConnectionPool

public void setConnectionPool(ConnectionPool connPool)
Set the ConnectionPool this Factory belongs to

Parameters:
connPool - the ConnectionPool this factory creates Connections for

create

public Connection create(ConnectionConfig config)
                  throws SQLException
Create a new Connection

Specified by:
create in interface PoolableConnectionFactory
Parameters:
config - the Configuration object for this Connection
Returns:
a new Connection
Throws:
SQLException - thrown if error occurs creating a Connection

destroy

public void destroy(Connection conn)
             throws SQLException
Destroy the Connection Object

Specified by:
destroy in interface PoolableConnectionFactory
Parameters:
conn - the Connection to destroy
Throws:
SQLException - thrown if error occurs destroying Connection

activate

public void activate(Connection conn)
Activate the Connection

Specified by:
activate in interface PoolableConnectionFactory
Parameters:
conn - the Connection to activate

passivate

public void passivate(Connection conn)
               throws SQLException
Passivate the Connection

Specified by:
passivate in interface PoolableConnectionFactory
Parameters:
conn - the Connection object to Passivate
Throws:
SQLException - thrown if error occurs passivating the Connection

validate

public boolean validate(Connection conn)
Validate the Connection object

Specified by:
validate in interface PoolableConnectionFactory
Parameters:
conn - the Connection object to validate
Returns:
true if Connection object is valid, false otherwise


Generated on 5:16:42 PM May 12, 2008, © 1996-2005 Cafésoft LLC. All rights reserved.