org.logicalcobwebs.proxool
接口 ProxyConnectionIF

所有超级接口:
Comparable, ConnectionInfoIF
所有已知实现类:
ProxyConnection

public interface ProxyConnectionIF
extends ConnectionInfoIF

Contains most of the functionality that we require to manipilate the connection. The subclass of this defines how we delegate to the real connection.

从以下版本开始:
Proxool 0.7
版本:
$Revision: 1.8 $, $Date: 2007/01/25 23:38:24 $
作者:
bill, $Author: billhorsman $ (current maintainer)

字段摘要
 
从接口 org.logicalcobwebs.proxool.ConnectionInfoIF 继承的字段
MARK_FOR_EXPIRY, MARK_FOR_USE, STATUS_ACTIVE, STATUS_AVAILABLE, STATUS_NULL, STATUS_OFFLINE
 
方法摘要
 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 ConnectionInfoIF.getSqlCalls()
 int getReasonCode()
          Get the reason why this connection is marked
 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.
 
从接口 org.logicalcobwebs.proxool.ConnectionInfoIF 继承的方法
getAge, getBirthDate, getBirthTime, getDelegateHashcode, getDelegateUrl, getId, getMark, getProxyHashcode, getRequester, getSqlCalls, getStatus, getTimeLastStartActive, getTimeLastStopActive
 
从接口 java.lang.Comparable 继承的方法
compareTo
 

方法详细信息

setStatus

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).

setStatus

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(int, int)

markForExpiry

void markForExpiry(String reason)
Mark this connection for expiry (destruction) as soon as it stops being active.

参数:
reason - why we are marking this connection
另请参见:
isMarkedForExpiry()

isMarkedForExpiry

boolean isMarkedForExpiry()
Whether this connection is due for expiry

返回:
true if it is due for expiry
另请参见:
markForExpiry(java.lang.String)

getReasonForMark

String getReasonForMark()
Why this connection is marked (for instance, if a thread has marked it for expiry then it's nice to know why)

返回:
reasonForMark

getConnection

Connection getConnection()
The real, delegate connection that we are using

返回:
connection

isNull

boolean isNull()
返回:
true if the status is null

isAvailable

boolean isAvailable()
返回:
true if the status is available

isActive

boolean isActive()
返回:
true if the status is active

isOffline

boolean isOffline()
返回:
true if the status is offline

reallyClose

void reallyClose()
                 throws SQLException
Really close the connection, as opposed to just putting it back in the pool.

抛出:
SQLException

setRequester

void setRequester(String requester)
另请参见:
ConnectionInfoIF.getRequester()

close

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.

抛出:
SQLException
另请参见:
Connection.close()

registerClosedStatement

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

isReallyClosed

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
抛出:
SQLException - if anything went wrong

getDefinition

ConnectionPoolDefinitionIF getDefinition()

getLastSqlCall

String getLastSqlCall()
Get the most recent of all the ConnectionInfoIF.getSqlCalls()

返回:
the SQL (could be a batch of SQLs)

getReasonCode

int getReasonCode()
Get the reason why this connection is marked

返回:
ConnectionListenerIF.MAXIMUM_ACTIVE_TIME_EXPIRED, ConnectionListenerIF.HOUSE_KEEPER_TEST_FAIL, ConnectionListenerIF.FATAL_SQL_EXCEPTION_DETECTED, ConnectionListenerIF.MANUAL_EXPIRY, ConnectionListenerIF.MAXIMUM_CONNECTION_LIFETIME_EXCEEDED, ConnectionListenerIF.RESET_FAIL, ConnectionListenerIF.SHUTDOWN, or ConnectionListenerIF.VALIDATION_FAIL


Copyright © 2014. All rights reserved.