|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectorg.logicalcobwebs.proxool.ProxyConnection
public class ProxyConnection
Manages a connection. This is wrapped up inside a...
| 字段摘要 |
|---|
| 从接口 org.logicalcobwebs.proxool.ConnectionInfoIF 继承的字段 |
|---|
MARK_FOR_EXPIRY, MARK_FOR_USE, STATUS_ACTIVE, STATUS_AVAILABLE, STATUS_NULL, STATUS_OFFLINE |
| 构造方法摘要 | |
|---|---|
protected |
ProxyConnection(Connection connection,
long id,
String delegateUrl,
org.logicalcobwebs.proxool.ConnectionPool connectionPool,
ConnectionPoolDefinitionIF definition,
int status)
|
| 方法摘要 | |
|---|---|
protected void |
addOpenStatement(Statement statement)
By calling this we can keep track of any statements that are left open when this connection is returned to the pool. |
void |
addSqlCall(String sqlCall)
|
void |
close()
Doesn't really close the connection, just puts it back in the pool. |
int |
compareTo(Object o)
Compares using getId() |
boolean |
equals(Object obj)
Whether the underlying connections are equal |
long |
getAge()
The age in millseconds since this connection was built |
Date |
getBirthDate()
Like ConnectionInfoIF.getBirthTime() but in Date format |
long |
getBirthTime()
The time that this connection was created. |
Connection |
getConnection()
The real, delegate connection that we are using |
protected org.logicalcobwebs.proxool.ConnectionPool |
getConnectionPool()
The ConnectionPool that this connection belongs to |
ConnectionPoolDefinitionIF |
getDefinition()
Get the definition that was used to create this connection |
String |
getDelegateHashcode()
The hashcode (in hex) of the delegate connection object. |
String |
getDelegateUrl()
The URL that this connection is using (the definition might have changed since this connection was built). |
long |
getId()
A unique ID for this connection |
String |
getLastSqlCall()
Get the most recent of all the ConnectionInfoIF.getSqlCalls() |
int |
getMark()
Sometimes we want do something to a connection but can't because it is still active and we don't want to disrupt its use. |
String |
getProxyHashcode()
The hashcode (in hex) of the ProxyConnection object. |
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) |
String |
getRequester()
The name of the thread that asked for this connection. |
String[] |
getSqlCalls()
A log of the last SQL used on this connection. |
int |
getStatus()
The status of the connection. |
long |
getTimeLastStartActive()
When this connection was last given out. |
long |
getTimeLastStopActive()
When this connection was last given back (or zero if it is still active). |
boolean |
isActive()
|
boolean |
isAvailable()
|
boolean |
isClosed()
Whether this connection is available. |
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. |
protected void |
open()
This gets called /just/ before a connection is served. |
void |
reallyClose()
Close the connection for real |
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 |
setBirthTime(long birthTime)
|
void |
setId(long id)
|
protected void |
setNeedToReset(boolean needToReset)
The subclass should call this to indicate that a change has been made to the connection that might mean it needs to be reset (like setting autoCommit to false or something). |
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. |
void |
setTimeLastStartActive(long timeLastStartActive)
|
void |
setTimeLastStopActive(long timeLastStopActive)
|
String |
toString()
|
| 从类 java.lang.Object 继承的方法 |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 构造方法详细信息 |
|---|
protected ProxyConnection(Connection connection,
long id,
String delegateUrl,
org.logicalcobwebs.proxool.ConnectionPool connectionPool,
ConnectionPoolDefinitionIF definition,
int status)
throws SQLException
connection - the real connection that is usedid - unique IDdelegateUrl - connectionPool - the pool it is a member ofdefinition - the definition that was used to build it (could possibly be different from
the one held in the connectionPool)status - ConnectionInfoIF.STATUS_ACTIVE, ConnectionInfoIF.STATUS_AVAILABLE, STATUS_FORCE, ConnectionInfoIF.STATUS_NULL, or ConnectionInfoIF.STATUS_OFFLINE
SQLException| 方法详细信息 |
|---|
public boolean equals(Object obj)
Object 中的 equalsobj - the object (probably another connection) that we
are being compared to
public boolean isClosed()
protected void setNeedToReset(boolean needToReset)
needToReset - true if the connection might need resetting.protected org.logicalcobwebs.proxool.ConnectionPool getConnectionPool()
public ConnectionPoolDefinitionIF getDefinition()
ProxyConnectionIF 中的 getDefinitionprotected void addOpenStatement(Statement statement)
statement - the statement that we have just opened/created.registerClosedStatement(java.sql.Statement)public void registerClosedStatement(Statement statement)
ProxyConnectionIF 复制的描述
ProxyConnectionIF 中的 registerClosedStatementstatement - the statement that has just been closedProxyConnectionIF.registerClosedStatement(java.sql.Statement)
public void reallyClose()
throws SQLException
ProxyConnectionIF 中的 reallyCloseSQLException - if anything goes wrong
public boolean isReallyClosed()
throws SQLException
ProxyConnectionIF 复制的描述
ProxyConnectionIF 中的 isReallyClosedSQLException - if anything went wrongProxyConnectionIF.isReallyClosed()
public void close()
throws SQLException
ProxyConnectionIF 复制的描述
ProxyConnectionIF 中的 closeSQLExceptionProxyConnectionIF.close()protected void open()
open() then close()
public int getMark()
ConnectionInfoIF 复制的描述expire the
connection (if it is too old for instance). And this will happen if the
housekeeper decides it should but the connection is still active.
ConnectionInfoIF 中的 getMarkpublic int getStatus()
ConnectionInfoIF 复制的描述null,
available,
active or
offline.
ConnectionInfoIF 中的 getStatuspublic boolean setStatus(int newStatus)
ProxyConnectionIF 复制的描述
ProxyConnectionIF 中的 setStatusnewStatus - the status to change to
ProxyConnectionIF.setStatus(int)
public boolean setStatus(int oldStatus,
int newStatus)
ProxyConnectionIF 复制的描述
ProxyConnectionIF 中的 setStatusoldStatus - 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
ProxyConnectionIF.setStatus(int, int)public long getId()
ConnectionInfoIF 复制的描述
ConnectionInfoIF 中的 getIdpublic void setId(long id)
public long getBirthTime()
ConnectionInfoIF 复制的描述
ConnectionInfoIF 中的 getBirthTimeConnectionInfoIF.getBirthTime()public Date getBirthDate()
ConnectionInfoIF 复制的描述ConnectionInfoIF.getBirthTime() but in Date format
ConnectionInfoIF 中的 getBirthDateConnectionInfoIF.getBirthDate()public long getAge()
ConnectionInfoIF 复制的描述
ConnectionInfoIF 中的 getAgeConnectionInfoIF.getAge()public void setBirthTime(long birthTime)
ConnectionInfoIF.getBirthTime()public long getTimeLastStartActive()
ConnectionInfoIF 复制的描述
ConnectionInfoIF 中的 getTimeLastStartActiveConnectionInfoIF.getTimeLastStartActive()public void setTimeLastStartActive(long timeLastStartActive)
ConnectionInfoIF.getTimeLastStartActive()public long getTimeLastStopActive()
ConnectionInfoIF 复制的描述
ConnectionInfoIF 中的 getTimeLastStopActiveConnectionInfoIF.getTimeLastStopActive()public void setTimeLastStopActive(long timeLastStopActive)
ConnectionInfoIF.getTimeLastStopActive()public String getRequester()
ConnectionInfoIF 复制的描述
ConnectionInfoIF 中的 getRequesterConnectionInfoIF.getRequester()public void setRequester(String requester)
ProxyConnectionIF 中的 setRequesterConnectionInfoIF.getRequester()public boolean isNull()
ProxyConnectionIF 中的 isNullProxyConnectionIF.isNull()public boolean isAvailable()
ProxyConnectionIF 中的 isAvailableProxyConnectionIF.isAvailable()public boolean isActive()
ProxyConnectionIF 中的 isActiveProxyConnectionIF.isActive()public boolean isOffline()
ProxyConnectionIF 中的 isOfflineProxyConnectionIF.isOffline()public void markForExpiry(String reason)
ProxyConnectionIF 复制的描述
ProxyConnectionIF 中的 markForExpiryreason - why we are marking this connectionProxyConnectionIF.markForExpiry(java.lang.String)public boolean isMarkedForExpiry()
ProxyConnectionIF 复制的描述
ProxyConnectionIF 中的 isMarkedForExpiryProxyConnectionIF.isMarkedForExpiry()public String getReasonForMark()
ProxyConnectionIF 复制的描述
ProxyConnectionIF 中的 getReasonForMarkProxyConnectionIF.getReasonForMark()public Connection getConnection()
ProxyConnectionIF 复制的描述
ProxyConnectionIF 中的 getConnectionProxyConnectionIF.getConnection()public String toString()
Object 中的 toStringObject.toString()public String getDelegateUrl()
ConnectionInfoIF 复制的描述
ConnectionInfoIF 中的 getDelegateUrlConnectionInfoIF.getDelegateUrl()public String getProxyHashcode()
ConnectionInfoIF 复制的描述
ConnectionInfoIF 中的 getProxyHashcodeConnectionInfoIF.getProxyHashcode()public String getDelegateHashcode()
ConnectionInfoIF 复制的描述
ConnectionInfoIF 中的 getDelegateHashcodeConnectionInfoIF.getDelegateHashcode()public int compareTo(Object o)
getId()
Comparable 中的 compareToo - must be another ConnectionInfoIF implementation
Comparable.compareTo(Object)public String[] getSqlCalls()
ConnectionInfoIF 复制的描述ConnectionPoolDefinitionIF.isTrace()
is enabled.
ConnectionInfoIF 中的 getSqlCallspublic String getLastSqlCall()
ProxyConnectionIF 复制的描述ConnectionInfoIF.getSqlCalls()
ProxyConnectionIF 中的 getLastSqlCallpublic int getReasonCode()
ProxyConnectionIF 复制的描述marked
ProxyConnectionIF 中的 getReasonCodeConnectionListenerIF.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_FAILpublic void addSqlCall(String sqlCall)
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||