org.logicalcobwebs.proxool
Interface ProxyConnectionIF
- Comparable, ConnectionInfoIF
- ProxyConnection
public interface ProxyConnectionIF
Contains most of the functionality that we require to manipilate the
connection. The subclass of this defines how we delegate to the
real connection.
$Revision: 1.7 $, $Date: 2005/10/07 08:18:24 $- bill
- $Author: billhorsman $ (current maintainer)
void | close() - Doesn't really close the connection, just puts it back in the pool.
|
Connection | getConnection() - The real, delegate connection that we are using
|
ConnectionPoolDefinitionIF | getDefinition()
|
String | getLastSqlCall() - Get the most recent of all the
getSqlCalls()
|
String | getReasonForMark() - Why this connection is marked (for instance, if a thread has
marked it for expiry then it's nice to know why)
|
boolean | isActive()
|
boolean | isAvailable()
|
boolean | isMarkedForExpiry() - Whether this connection is due for expiry
|
boolean | isNull()
|
boolean | isOffline()
|
boolean | isReallyClosed() - Find out if the delegated connection is close.
|
void | markForExpiry(String reason) - Mark this connection for expiry (destruction) as soon as it stops
being active.
|
void | reallyClose() - Really close the connection, as opposed to just putting it back
in the pool.
|
void | registerClosedStatement(Statement statement) - Notify that a statement has been closed and won't need closing
when the connection is returned to the poo.
|
void | setRequester(String requester)
|
boolean | setStatus(int newStatus) - Forces the new status regardless of the old state
|
boolean | setStatus(int oldStatus, int newStatus) - Changes the status and lets the ConnectionPool know so that it
can keep count of how many connections are at each status.
|
getAge , getBirthDate , getBirthTime , getDelegateHashcode , getDelegateUrl , getId , getMark , getProxyHashcode , getRequester , getSqlCalls , getStatus , getTimeLastStartActive , getTimeLastStopActive |
close
public void close()
throws SQLException
Doesn't really close the connection, just puts it back in the pool. And tries to
reset all the methods that need resetting.
getConnection
public Connection getConnection()
The real, delegate connection that we are using
getLastSqlCall
public String getLastSqlCall()
Get the most recent of all the getSqlCalls()
- the SQL (could be a batch of SQLs)
getReasonForMark
public String getReasonForMark()
Why this connection is marked (for instance, if a thread has
marked it for expiry then it's nice to know why)
isActive
public boolean isActive()
- true if the status is active
isAvailable
public boolean isAvailable()
- true if the status is available
isMarkedForExpiry
public boolean isMarkedForExpiry()
Whether this connection is due for expiry
- true if it is due for expiry
isNull
public boolean isNull()
- true if the status is null
isOffline
public boolean isOffline()
- true if the status is offline
isReallyClosed
public boolean isReallyClosed()
throws SQLException
Find out if the delegated connection is close. Just calling isClosed() on the
proxied connection will only indicate whether it is in the pool or not.
- true if the connection is really closed, or if the connection is null
markForExpiry
public void markForExpiry(String reason)
Mark this connection for expiry (destruction) as soon as it stops
being active.
reason
- why we are marking this connection
reallyClose
public void reallyClose()
throws SQLException
Really close the connection, as opposed to just putting it back
in the pool.
registerClosedStatement
public void registerClosedStatement(Statement statement)
Notify that a statement has been closed and won't need closing
when the connection is returned to the poo.
statement
- the statement that has just been closed
setRequester
public void setRequester(String requester)
setStatus
public boolean setStatus(int newStatus)
Forces the new status regardless of the old state
newStatus
- the status to change to
- true if status changed successfully, or false if no change made (should
always return true)
setStatus
public boolean setStatus(int oldStatus,
int newStatus)
Changes the status and lets the ConnectionPool know so that it
can keep count of how many connections are at each status.
This method obtains a write lock.
oldStatus
- the expected existing status. if the existing
status is not this value then no change is made and false is returned.newStatus
- the status to change to
- true if status changed successfully, or false if no change made
(because of unexpected existing status).