org.firebirdsql.pool
Class BasicAbstractConnectionPool

java.lang.Object
  extended by org.firebirdsql.ds.RootCommonDataSource
      extended by org.firebirdsql.pool.AbstractConnectionPool
          extended by org.firebirdsql.pool.BasicAbstractConnectionPool
All Implemented Interfaces:
java.io.Serializable, javax.naming.Referenceable, javax.sql.CommonDataSource, javax.sql.ConnectionPoolDataSource, ConnectionPoolConfiguration, PooledObjectListener
Direct Known Subclasses:
AbstractDriverConnectionPoolDataSource, AbstractFBConnectionPoolDataSource

Deprecated.

@Deprecated
public abstract class BasicAbstractConnectionPool
extends AbstractConnectionPool
implements ConnectionPoolConfiguration, javax.sql.ConnectionPoolDataSource, java.io.Serializable, javax.naming.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
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.firebirdsql.pool.AbstractConnectionPool
AbstractConnectionPool.UserPasswordPair
 
Constructor Summary
protected BasicAbstractConnectionPool()
          Deprecated. Create instance of this class.
 
Method Summary
protected abstract  BasicAbstractConnectionPool createObjectInstance()
          Deprecated.  
static java.lang.Object deserialize(byte[] data)
          Deprecated.  
 int getBlockingTimeout()
          Deprecated. Get time during which ConnectionPoolDataSource.getPooledConnection() can block.
 ConnectionPoolConfiguration getConfiguration()
          Deprecated. Get configuration of this data source.
 javax.naming.Reference getDefaultReference()
          Deprecated. Get default JNDI reference for this datasource.
 int getIdleTimeout()
          Deprecated. non-standard name, use getMaxIdleTime()
abstract  int getLoginTimeout()
          Deprecated.  
abstract  java.io.PrintWriter getLogWriter()
          Deprecated.  
 int getMaxConnections()
          Deprecated. non-standard name, use getMaxPoolSize()
 int getMaxIdleTime()
          Deprecated. Get time after which idle connections will be deallocated.
 int getMaxPoolSize()
          Deprecated. Get maximum number of physical connections that can be simultaneously open.
 int getMaxStatements()
          Deprecated.  
 int getMinConnections()
          Deprecated. non-standard name, use getMinPoolSize()
 int getMinPoolSize()
          Deprecated. Get minimum number of open JDBC connections that will be created when pool is started.
 java.lang.Object getObjectInstance(java.lang.Object obj)
          Deprecated. Get object instance for the specified name in the specified context.
 int getPingInterval()
          Deprecated. Get time interval after which connection should be pinged.
 java.lang.String getPingStatement()
          Deprecated. Get SQL statement that will be used to ping connection.
abstract  javax.sql.PooledConnection getPooledConnection()
          Deprecated.  
abstract  javax.sql.PooledConnection getPooledConnection(java.lang.String user, java.lang.String password)
          Deprecated.  
protected  java.lang.String getRefAddr(javax.naming.Reference ref, java.lang.String type)
          Deprecated.  
 javax.naming.Reference getReference()
          Deprecated. Get JDNI reference.
 int getRetryInterval()
          Deprecated. Get interval of getting connections retries.
 boolean isKeepStatements()
          Deprecated.  
 boolean isPingable()
          Deprecated. Check if this pool supports pingable connections.
 boolean isPooling()
          Deprecated. Check if this connection pool uses connection pooling, or just implements JDBC 2.0 SE interfaces.
 boolean isStatementPooling()
          Deprecated. Check if this connection pool provides also prepared statement pooling.
static byte[] serialize(java.lang.Object obj)
          Deprecated.  
 void setBlockingTimeout(int blockingTimeout)
          Deprecated.  
 void setIdleTimeout(int idleTimeout)
          Deprecated. non-standard name, use setMaxIdleTime(int)
 void setKeepStatements(boolean keepStatements)
          Deprecated.  
abstract  void setLoginTimeout(int seconds)
          Deprecated.  
abstract  void setLogWriter(java.io.PrintWriter printWriter)
          Deprecated.  
 void setMaxConnections(int maxConnections)
          Deprecated. non-standard name, use setMaxPoolSize(int)
 void setMaxIdleTime(int maxIdleTime)
          Deprecated.  
 void setMaxPoolSize(int maxPoolSize)
          Deprecated.  
 void setMaxStatements(int maxStatements)
          Deprecated.  
 void setMinConnections(int minConnections)
          Deprecated. non-standard name, use setMinPoolSize(int)
 void setMinPoolSize(int minPoolSize)
          Deprecated.  
 void setPingInterval(int pingInterval)
          Deprecated.  
 void setPingStatement(java.lang.String pingStatement)
          Deprecated.  
 void setPooling(boolean pooling)
          Deprecated.  
 void setReference(javax.naming.Reference reference)
          Deprecated. Set JNDI reference for this data source.
 void setRetryInterval(int retryInterval)
          Deprecated.  
 void setStatementPooling(boolean statementPooling)
          Deprecated.  
 
Methods inherited from class org.firebirdsql.pool.AbstractConnectionPool
finalize, getConnectionManager, getFreeSize, getLogger, getPooledConnection, getPoolName, getQueue, getTotalSize, getWorkingSize, physicalConnectionDeallocated, pooledObjectReleased, restart, shutdown
 
Methods inherited from class org.firebirdsql.ds.RootCommonDataSource
getParentLogger
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAbstractConnectionPool

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

Method Detail

getLoginTimeout

public abstract int getLoginTimeout()
                             throws java.sql.SQLException
Deprecated. 
Specified by:
getLoginTimeout in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

setLoginTimeout

public abstract void setLoginTimeout(int seconds)
                              throws java.sql.SQLException
Deprecated. 
Specified by:
setLoginTimeout in interface javax.sql.CommonDataSource
Throws:
java.sql.SQLException

getLogWriter

public abstract java.io.PrintWriter getLogWriter()
                                          throws java.sql.SQLException
Deprecated. 
Specified by:
getLogWriter in interface javax.sql.CommonDataSource
Overrides:
getLogWriter in class RootCommonDataSource
Throws:
java.sql.SQLException

setLogWriter

public abstract void setLogWriter(java.io.PrintWriter printWriter)
                           throws java.sql.SQLException
Deprecated. 
Specified by:
setLogWriter in interface javax.sql.CommonDataSource
Overrides:
setLogWriter in class RootCommonDataSource
Throws:
java.sql.SQLException

getPooledConnection

public abstract javax.sql.PooledConnection getPooledConnection()
                                                        throws java.sql.SQLException
Deprecated. 
Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Throws:
java.sql.SQLException

getPooledConnection

public abstract javax.sql.PooledConnection getPooledConnection(java.lang.String user,
                                                               java.lang.String password)
                                                        throws java.sql.SQLException
Deprecated. 
Specified by:
getPooledConnection in interface javax.sql.ConnectionPoolDataSource
Throws:
java.sql.SQLException

getConfiguration

public ConnectionPoolConfiguration getConfiguration()
Deprecated. 
Description copied from class: AbstractConnectionPool
Get configuration of this data source.

Specified by:
getConfiguration in class AbstractConnectionPool
Returns:
instance of ConnectionPoolConfiguration describing this data source.

getBlockingTimeout

public int getBlockingTimeout()
Deprecated. 
Description copied from interface: ConnectionPoolConfiguration
Get time during which ConnectionPoolDataSource.getPooledConnection() can block. By default method blocks forever.

Specified by:
getBlockingTimeout in interface ConnectionPoolConfiguration
Returns:
pool blocking timeout in milliseconds, Integer.MAX_VALUE indicates blocking forever.

setBlockingTimeout

public void setBlockingTimeout(int blockingTimeout)
Deprecated. 

getIdleTimeout

public int getIdleTimeout()
Deprecated. non-standard name, use getMaxIdleTime()

Description copied from interface: ConnectionPoolConfiguration
Get time after which idle connections will be deallocated.

Specified by:
getIdleTimeout in interface ConnectionPoolConfiguration
Returns:
idle timeout in milliseconds, Integer.MAX_VALUE indicates that idle connections are not removed.

setIdleTimeout

public void setIdleTimeout(int idleTimeout)
Deprecated. non-standard name, use setMaxIdleTime(int)


getMaxIdleTime

public int getMaxIdleTime()
Deprecated. 
Description copied from interface: ConnectionPoolConfiguration
Get time after which idle connections will be deallocated.

Specified by:
getMaxIdleTime in interface ConnectionPoolConfiguration
Returns:
idle timeout in milliseconds, Integer.MAX_VALUE indicates that idle connections are not removed.

setMaxIdleTime

public void setMaxIdleTime(int maxIdleTime)
Deprecated. 

getMaxConnections

public int getMaxConnections()
Deprecated. non-standard name, use getMaxPoolSize()

Description copied from interface: ConnectionPoolConfiguration
Get maximum number of physical connections that can be simultaneously open.

Specified by:
getMaxConnections in interface ConnectionPoolConfiguration
Returns:
maximum number of simultaneously open physical database connections, 0 if no limit exists.

setMaxConnections

public void setMaxConnections(int maxConnections)
Deprecated. non-standard name, use setMaxPoolSize(int)


getMaxPoolSize

public int getMaxPoolSize()
Deprecated. 
Description copied from interface: ConnectionPoolConfiguration
Get maximum number of physical connections that can be simultaneously open.

Specified by:
getMaxPoolSize in interface ConnectionPoolConfiguration
Returns:
maximum number of simultaneously open physical database connections, 0 if no limit exists.

setMaxPoolSize

public void setMaxPoolSize(int maxPoolSize)
Deprecated. 

getMinConnections

public int getMinConnections()
Deprecated. non-standard name, use getMinPoolSize()

Description copied from interface: ConnectionPoolConfiguration
Get minimum number of open JDBC connections that will be created when pool is started.

Specified by:
getMinConnections in interface ConnectionPoolConfiguration
Returns:
minimum number of open JDBC connections to open at startup.

setMinConnections

public void setMinConnections(int minConnections)
Deprecated. non-standard name, use setMinPoolSize(int)


getMinPoolSize

public int getMinPoolSize()
Deprecated. 
Description copied from interface: ConnectionPoolConfiguration
Get minimum number of open JDBC connections that will be created when pool is started.

Specified by:
getMinPoolSize in interface ConnectionPoolConfiguration
Returns:
minimum number of open JDBC connections to open at startup.

setMinPoolSize

public void setMinPoolSize(int minPoolSize)
Deprecated. 

getPingInterval

public int getPingInterval()
Deprecated. 
Description copied from interface: ConnectionPoolConfiguration
Get time interval after which connection should be pinged.

Specified by:
getPingInterval in interface ConnectionPoolConfiguration
Returns:
number of milliseconds in the ping interval.

setPingInterval

public void setPingInterval(int pingInterval)
Deprecated. 

getPingStatement

public java.lang.String getPingStatement()
Deprecated. 
Description copied from interface: ConnectionPoolConfiguration
Get SQL statement that will be used to ping connection. Ping SQL statement returns exactly one row without throwing an exception. Ping SQL statement must not influence the outcome of a transaction.

Examples of ping SQL statements:

Specified by:
getPingStatement in interface ConnectionPoolConfiguration
Returns:
SQL statement that will be used to ping connection.

setPingStatement

public void setPingStatement(java.lang.String pingStatement)
Deprecated. 

getRetryInterval

public int getRetryInterval()
Deprecated. 
Description copied from interface: ConnectionPoolConfiguration
Get interval of getting connections retries. It might happen that pool contains no free connection. In order not to wait until connection is returned into the pool, pool will try to obtain connection again and again with the interval returned by this method. Default value is 1000 (1 sec).

Specified by:
getRetryInterval in interface ConnectionPoolConfiguration
Returns:
retry interval in milliseconds.

setRetryInterval

public void setRetryInterval(int retryInterval)
Deprecated. 

isPingable

public boolean isPingable()
Deprecated. 
Description copied from interface: ConnectionPoolConfiguration
Check if this pool supports pingable connections. Pingable connections are used to correctly check if connection is still alive or not.

Specified by:
isPingable in interface ConnectionPoolConfiguration
Returns:
true if this pool supports pingable connections.

isPooling

public boolean isPooling()
Deprecated. 
Description copied from interface: ConnectionPoolConfiguration
Check if this connection pool uses connection pooling, or just implements JDBC 2.0 SE interfaces. By default pooling is on. It might make sense to set pooling off to check performance degradation in test environment. It could be also used in the environment where physical connection must be closed right after usage, however using JDBC 2.0 SE interfaces is either a requirement or is simpler than standard java.sql.Driver.

Specified by:
isPooling in interface ConnectionPoolConfiguration
Returns:
true if pooling is enabled.

setPooling

public void setPooling(boolean pooling)
Deprecated. 

isStatementPooling

public boolean isStatementPooling()
Deprecated. 
Description copied from interface: ConnectionPoolConfiguration
Check if this connection pool provides also prepared statement pooling. By default prepared statement pooling is enabled, however there might be situations where statement pooling is not desired, for example in environments where database can quickly run out of handles and fast handle reuse is required.

Specified by:
isStatementPooling in interface ConnectionPoolConfiguration
Returns:
true if prepared statement pooling is enabled.

setStatementPooling

public void setStatementPooling(boolean statementPooling)
Deprecated. 

isKeepStatements

public boolean isKeepStatements()
Deprecated. 

setKeepStatements

public void setKeepStatements(boolean keepStatements)
Deprecated. 

getMaxStatements

public int getMaxStatements()
Deprecated. 

setMaxStatements

public void setMaxStatements(int maxStatements)
Deprecated. 

createObjectInstance

protected abstract BasicAbstractConnectionPool createObjectInstance()
Deprecated. 

getObjectInstance

public java.lang.Object getObjectInstance(java.lang.Object obj)
                                   throws java.lang.Exception
Deprecated. 
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.

Throws:
java.lang.Exception

getRefAddr

protected java.lang.String getRefAddr(javax.naming.Reference ref,
                                      java.lang.String type)
Deprecated. 

getReference

public javax.naming.Reference getReference()
Deprecated. 
Get JDNI reference.

Specified by:
getReference in interface javax.naming.Referenceable
Returns:
instance of Reference.

setReference

public void setReference(javax.naming.Reference reference)
Deprecated. 
Set JNDI reference for this data source.

Parameters:
reference - JNDI reference.

getDefaultReference

public javax.naming.Reference getDefaultReference()
Deprecated. 
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.

serialize

public static byte[] serialize(java.lang.Object obj)
Deprecated. 

deserialize

public static java.lang.Object deserialize(byte[] data)
Deprecated. 


Copyright © 2001-2019 Jaybird (Firebird JDBC/JCA) team. All rights reserved.