|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.firebirdsql.pool.AbstractConnectionPool
org.firebirdsql.pool.BasicAbstractConnectionPool
org.firebirdsql.pool.AbstractDriverConnectionPoolDataSource
public abstract class AbstractDriverConnectionPoolDataSource
Generic implementation of ConnectionPoolDataSource that
uses DriverManager to open physical connections to the
database.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.firebirdsql.pool.AbstractConnectionPool |
|---|
AbstractConnectionPool.UserPasswordPair |
| Field Summary | |
|---|---|
protected static String |
DRIVER_CLASS_NAME
|
static AbstractConnectionPool.UserPasswordPair |
EMPTY_USER_PASSWORD
|
protected static String |
JDBC_URL
|
protected static String |
PROPERTIES
|
| Constructor Summary | |
|---|---|
AbstractDriverConnectionPoolDataSource()
Create instance of this class. |
|
| Method Summary | |
|---|---|
void |
connectionClosed(ConnectionEvent connectionEvent)
Notify about connection being closed. |
void |
connectionErrorOccurred(ConnectionEvent event)
Notify about serious error when using the connection. |
protected BasicAbstractConnectionPool |
createObjectInstance()
Create instance of this data source. |
protected PooledConnectionManager |
getConnectionManager()
Get connection manager that will allocate physical connections to the database. |
Reference |
getDefaultReference()
Get default JNDI reference for this instance. |
String |
getDriverClassName()
|
int |
getFreeSize()
Get number of free connections in this pool. |
String |
getIsolation()
|
String |
getJdbcUrl()
|
protected Logger |
getLogger()
Get logger for this instance. |
int |
getLoginTimeout()
Get login timeout. |
PrintWriter |
getLogWriter()
|
PooledConnection |
getPooledConnection()
Get pooled connection. |
protected PooledObject |
getPooledConnection(org.firebirdsql.pool.PooledConnectionQueue queue)
Get pooled connection from the pooled queue. |
PooledConnection |
getPooledConnection(String user,
String password)
Get pooled connection for the specified user name and password. |
protected String |
getPoolName()
Get name of this connection pool. |
Properties |
getProperties()
|
String |
getProperty(String name)
|
int |
getTotalSize()
Get total size of physical connections opened to the database. |
int |
getTransactionIsolationLevel()
|
int |
getWorkingSize()
Get number of connections that are in use. |
void |
physicalConnectionClosed(ConnectionEvent connectionEvent)
Notify about physical connection being closed. |
void |
physicalConnectionDeallocated(ConnectionEvent connectionEvent)
Notify about the deallocation of the physical connection. |
protected Object |
processObjectInstance(AbstractDriverConnectionPoolDataSource ds,
Object obj)
|
void |
setDriverClassName(String driverClassName)
|
void |
setIsolation(String isolation)
|
void |
setJdbcUrl(String jdbcUrl)
|
void |
setLoginTimeout(int seconds)
Set login timeout for new connection. |
void |
setLogWriter(PrintWriter out)
|
void |
setProperties(Properties properties)
Set JDBC properties that will be passed when opening a connection. |
void |
setProperty(String name,
String value)
|
void |
setTransactionIsolationLevel(int transactionIsolation)
|
| Methods inherited from class org.firebirdsql.pool.AbstractConnectionPool |
|---|
finalize, getQueue, physicalConnectionDeallocated, pooledObjectReleased, restart, shutdown |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final AbstractConnectionPool.UserPasswordPair EMPTY_USER_PASSWORD
protected static final String PROPERTIES
protected static final String DRIVER_CLASS_NAME
protected static final String JDBC_URL
| Constructor Detail |
|---|
public AbstractDriverConnectionPoolDataSource()
| Method Detail |
|---|
public String getJdbcUrl()
public void setJdbcUrl(String jdbcUrl)
public String getDriverClassName()
public void setDriverClassName(String driverClassName)
public String getProperty(String name)
public void setProperty(String name,
String value)
public Properties getProperties()
public void setProperties(Properties properties)
properties - instance of Properties containing properties
of a connection to open.getProperties()protected Logger getLogger()
AbstractConnectionPool
getLogger in class AbstractConnectionPoolLogger.public PrintWriter getLogWriter()
getLogWriter in interface CommonDataSourcegetLogWriter in class BasicAbstractConnectionPoolpublic void setLogWriter(PrintWriter out)
setLogWriter in interface CommonDataSourcesetLogWriter in class BasicAbstractConnectionPoolpublic int getLoginTimeout()
getLoginTimeout in interface CommonDataSourcegetLoginTimeout in class BasicAbstractConnectionPoolsetLoginTimeout(int) method or 0.public void setLoginTimeout(int seconds)
setLoginTimeout in interface CommonDataSourcesetLoginTimeout in class BasicAbstractConnectionPoolseconds - how long pool should wait until new connection is
granted.public int getTransactionIsolationLevel()
public void setTransactionIsolationLevel(int transactionIsolation)
public String getIsolation()
public void setIsolation(String isolation)
throws SQLException
SQLException
protected PooledConnectionManager getConnectionManager()
throws SQLException
getConnectionManager in class AbstractConnectionPoolPooledConnectionManager class.
SQLException - if connection manager cannot be obtained.protected String getPoolName()
getPoolName in class AbstractConnectionPool
protected PooledObject getPooledConnection(org.firebirdsql.pool.PooledConnectionQueue queue)
throws SQLException
getPooledConnection in class AbstractConnectionPoolqueue - instance of PooledConnectionQueue where connection
will be obtained.
PooledObject.
SQLException - if pooled connection cannot be obtained.
public PooledConnection getPooledConnection()
throws SQLException
getPooledConnection in interface ConnectionPoolDataSourcegetPooledConnection in class BasicAbstractConnectionPoolPooledConnection.
SQLException - if pooled connection cannot be obtained.
public PooledConnection getPooledConnection(String user,
String password)
throws SQLException
getPooledConnection in interface ConnectionPoolDataSourcegetPooledConnection in class BasicAbstractConnectionPooluser - user name.password - password corresponding to specified user name.
PooledConnection for the specified
credentials.
SQLException - always, this method is not yet implemented.public void connectionClosed(ConnectionEvent connectionEvent)
connectionClosed in interface ConnectionEventListenerconnectionEvent - instance of ConnectionEvent.public void physicalConnectionClosed(ConnectionEvent connectionEvent)
physicalConnectionClosed in interface PooledConnectionEventListenerconnectionEvent - instance of ConnectionEvent.public void physicalConnectionDeallocated(ConnectionEvent connectionEvent)
physicalConnectionDeallocated in interface PooledConnectionEventListenerconnectionEvent - instance of ConnectionEvent.public void connectionErrorOccurred(ConnectionEvent event)
connectionErrorOccurred in interface ConnectionEventListenerevent - instance of ConnectionEvent containing
information about an error.
public int getFreeSize()
throws SQLException
AbstractConnectionPoolgetMaxSize() != 0 && getMaxSize() == getWorkingSize(),
meaning that we have allocated maximum number of connections and all
of them are in use.
getFreeSize in class AbstractConnectionPoolSQLException
public int getTotalSize()
throws SQLException
AbstractConnectionPool
getTotalSize in class AbstractConnectionPoolSQLException
public int getWorkingSize()
throws SQLException
AbstractConnectionPool
getWorkingSize in class AbstractConnectionPoolSQLExceptionprotected BasicAbstractConnectionPool createObjectInstance()
createObjectInstance in class BasicAbstractConnectionPoolpublic Reference getDefaultReference()
getDefaultReference in class BasicAbstractConnectionPoolReference containing all information
that allows to reconstruct the datasource.
protected Object processObjectInstance(AbstractDriverConnectionPoolDataSource ds,
Object obj)
throws Exception
Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||