org.firebirdsql.pool

Class BasicAbstractConnectionPool

Implemented Interfaces:
ConnectionPoolConfiguration, ConnectionPoolDataSource, Referenceable, Serializable, PooledObjectListener
Known Direct Subclasses:
AbstractDriverConnectionPoolDataSource, AbstractFBConnectionPoolDataSource

public abstract class BasicAbstractConnectionPool
extends AbstractConnectionPool
implements ConnectionPoolConfiguration, ConnectionPoolDataSource, Serializable, Referenceable

Base class for connection pool implementations. Main feature of this class is that it implements ConnectionPoolConfiguration interface and releives developers from creating getters and setters for pool configuration parameters. Additionally this class provides basic functionality for JNDI-enabled connection pools. No other functionality is available.
Author:
Roman Rokytskyy

Nested Class Summary

Nested classes/interfaces inherited from class org.firebirdsql.pool.AbstractConnectionPool

AbstractConnectionPool.UserPasswordPair

Constructor Summary

BasicAbstractConnectionPool()
Create instance of this class.

Method Summary

protected abstract BasicAbstractConnectionPool
createObjectInstance()
static Object
deserialize(byte[] data)
int
getBlockingTimeout()
ConnectionPoolConfiguration
getConfiguration()
Get configuration of this data source.
Reference
getDefaultReference()
Get default JNDI reference for this datasource.
int
getIdleTimeout()
Deprecated. non-standard name, use getMaxIdleTime()
abstract PrintWriter
getLogWriter()
abstract int
getLoginTimeout()
int
getMaxConnections()
Deprecated. non-standard name, use getMaxPoolSize()
int
getMaxIdleTime()
int
getMaxPoolSize()
int
getMaxStatements()
int
getMinConnections()
Deprecated. non-standard name, use getMinPoolSize()
int
getMinPoolSize()
Object
getObjectInstance(Object obj)
Get object instance for the specified name in the specified context.
int
getPingInterval()
String
getPingStatement()
abstract PooledConnection
getPooledConnection()
abstract PooledConnection
getPooledConnection(String user, String password)
protected String
getRefAddr(Reference ref, String type)
Reference
getReference()
Get JDNI reference.
int
getRetryInterval()
boolean
isKeepStatements()
boolean
isPingable()
boolean
isPooling()
boolean
isStatementPooling()
static byte[]
serialize(Object obj)
void
setBlockingTimeout(int blockingTimeout)
void
setIdleTimeout(int idleTimeout)
Deprecated. non-standard name, use setMaxIdleTime(int)
void
setKeepStatements(boolean keepStatements)
abstract void
setLogWriter(PrintWriter printWriter)
abstract void
setLoginTimeout(int seconds)
void
setMaxConnections(int maxConnections)
Deprecated. non-standard name, use setMaxPoolSize(int)
void
setMaxIdleTime(int maxIdleTime)
void
setMaxPoolSize(int maxPoolSize)
void
setMaxStatements(int maxStatements)
void
setMinConnections(int minConnections)
Deprecated. non-standard name, use setMinPoolSize(int)
void
setMinPoolSize(int minPoolSize)
void
setPingInterval(int pingInterval)
void
setPingStatement(String pingStatement)
void
setPooling(boolean pooling)
void
setReference(Reference reference)
Set JNDI reference for this data source.
void
setRetryInterval(int retryInterval)
void
setStatementPooling(boolean statementPooling)

Methods inherited from class org.firebirdsql.pool.AbstractConnectionPool

finalize, getConfiguration, getConnectionManager, getFreeSize, getLogger, getPoolName, getPooledConnection, getQueue, getTotalSize, getWorkingSize, physicalConnectionDeallocated, pooledObjectReleased, restart, shutdown

Constructor Details

BasicAbstractConnectionPool

protected BasicAbstractConnectionPool()
Create instance of this class. Default constructor introduced to make it available to subclasses.

Method Details

createObjectInstance

protected abstract BasicAbstractConnectionPool createObjectInstance()

deserialize

public static Object deserialize(byte[] data)

getBlockingTimeout

public int getBlockingTimeout()
Specified by:
getBlockingTimeout in interface ConnectionPoolConfiguration

getConfiguration

public ConnectionPoolConfiguration getConfiguration()
Get configuration of this data source.
Overrides:
getConfiguration in interface AbstractConnectionPool
Returns:
instance of ConnectionPoolConfiguration describing this data source.

getDefaultReference

public Reference getDefaultReference()
Get default JNDI reference for this datasource. This method is called if datasource is used in non-JCA environment.
Returns:
instance of Reference containing all information that allows to reconstruct the datasource.

getIdleTimeout

public int getIdleTimeout()

Deprecated. non-standard name, use getMaxIdleTime()

Specified by:
getIdleTimeout in interface ConnectionPoolConfiguration

getLogWriter

public abstract PrintWriter getLogWriter()
            throws SQLException

getLoginTimeout

public abstract int getLoginTimeout()
            throws SQLException

getMaxConnections

public int getMaxConnections()

Deprecated. non-standard name, use getMaxPoolSize()

Specified by:
getMaxConnections in interface ConnectionPoolConfiguration

getMaxIdleTime

public int getMaxIdleTime()
Specified by:
getMaxIdleTime in interface ConnectionPoolConfiguration

getMaxPoolSize

public int getMaxPoolSize()
Specified by:
getMaxPoolSize in interface ConnectionPoolConfiguration

getMaxStatements

public int getMaxStatements()

getMinConnections

public int getMinConnections()

Deprecated. non-standard name, use getMinPoolSize()

Specified by:
getMinConnections in interface ConnectionPoolConfiguration

getMinPoolSize

public int getMinPoolSize()
Specified by:
getMinPoolSize in interface ConnectionPoolConfiguration

getObjectInstance

public Object getObjectInstance(Object obj)
            throws Exception
Get object instance for the specified name in the specified context. This method constructs new datasource if obj represents Reference, whose factory class is equal to this class.

getPingInterval

public int getPingInterval()
Specified by:
getPingInterval in interface ConnectionPoolConfiguration

getPingStatement

public String getPingStatement()
Specified by:
getPingStatement in interface ConnectionPoolConfiguration

getPooledConnection

public abstract PooledConnection getPooledConnection()
            throws SQLException

getPooledConnection

public abstract PooledConnection getPooledConnection(String user,
                                                     String password)
            throws SQLException

getRefAddr

protected String getRefAddr(Reference ref,
                            String type)

getReference

public Reference getReference()
Get JDNI reference.
Returns:
instance of Reference.

getRetryInterval

public int getRetryInterval()
Specified by:
getRetryInterval in interface ConnectionPoolConfiguration

isKeepStatements

public boolean isKeepStatements()

isPingable

public boolean isPingable()
Specified by:
isPingable in interface ConnectionPoolConfiguration

isPooling

public boolean isPooling()
Specified by:
isPooling in interface ConnectionPoolConfiguration

isStatementPooling

public boolean isStatementPooling()
Specified by:
isStatementPooling in interface ConnectionPoolConfiguration

serialize

public static byte[] serialize(Object obj)

setBlockingTimeout

public void setBlockingTimeout(int blockingTimeout)

setIdleTimeout

public void setIdleTimeout(int idleTimeout)

Deprecated. non-standard name, use setMaxIdleTime(int)


setKeepStatements

public void setKeepStatements(boolean keepStatements)

setLogWriter

public abstract void setLogWriter(PrintWriter printWriter)
            throws SQLException

setLoginTimeout

public abstract void setLoginTimeout(int seconds)
            throws SQLException

setMaxConnections

public void setMaxConnections(int maxConnections)

Deprecated. non-standard name, use setMaxPoolSize(int)


setMaxIdleTime

public void setMaxIdleTime(int maxIdleTime)

setMaxPoolSize

public void setMaxPoolSize(int maxPoolSize)

setMaxStatements

public void setMaxStatements(int maxStatements)

setMinConnections

public void setMinConnections(int minConnections)

Deprecated. non-standard name, use setMinPoolSize(int)


setMinPoolSize

public void setMinPoolSize(int minPoolSize)

setPingInterval

public void setPingInterval(int pingInterval)

setPingStatement

public void setPingStatement(String pingStatement)

setPooling

public void setPooling(boolean pooling)

setReference

public void setReference(Reference reference)
Set JNDI reference for this data source.
Parameters:
reference - JNDI reference.

setRetryInterval

public void setRetryInterval(int retryInterval)

setStatementPooling

public void setStatementPooling(boolean statementPooling)

Copyright B) 2001 David Jencks and other authors. All rights reserved.