org.apache.commons.dbcp
public class: AbandonedTrace [javadoc |
source]
java.lang.Object
org.apache.commons.dbcp.AbandonedTrace
Direct Known Subclasses:
PoolGuardConnectionWrapper, PoolGuardConnectionWrapper, PoolablePreparedStatement, DelegatingCallableStatement, DelegatingResultSet, DelegatingStatement, DelegatingPreparedStatement, DelegatingConnection, PoolablePreparedStatementStub, PooledTestObject, PoolingConnection, PoolableConnection
Deprecated! This - will be removed in a future version of DBCP.
Tracks db connection usage for recovering and reporting
abandoned db connections.
The JDBC Connection, Statement, and ResultSet classes
extend this class.
- author:
Glenn - L. Nielsen
- version:
$ - Revision: 482015 $ $Date: 2006-12-03 19:22:09 -0700 (Sun, 03 Dec 2006) $
| Method from org.apache.commons.dbcp.AbandonedTrace Detail: |
protected void addTrace(AbandonedTrace trace) {
synchronized (this) {
this.trace.add(trace);
}
setLastUsed();
} Deprecated!Add an object to the list of objects being
traced. |
protected synchronized void clearTrace() {
if (this.trace != null) {
this.trace.clear();
}
} Deprecated!Clear the list of objects being traced by this
object. |
protected AbandonedConfig getConfig() {
return config;
} Deprecated!Get the abandoned config for this object. |
protected long getLastUsed() {
if (parent != null) {
return parent.getLastUsed();
}
return lastUsed;
} Deprecated!Get the last time this object was used in ms. |
protected List getTrace() {
return trace;
} Deprecated!Get a list of objects being traced by this object. |
public void printStackTrace() {
if (createdBy != null) {
System.out.println(format.format(new Date(createdTime)));
createdBy.printStackTrace(System.out);
}
synchronized(this) {
Iterator it = this.trace.iterator();
while (it.hasNext()) {
AbandonedTrace at = (AbandonedTrace)it.next();
at.printStackTrace();
}
}
} Deprecated!If logAbandoned=true, print a stack trace of the code that
created this object. |
protected synchronized void removeTrace(AbandonedTrace trace) {
if (this.trace != null) {
this.trace.remove(trace);
}
} Deprecated!Remove a child object this object is tracing. |
protected void setLastUsed() {
if (parent != null) {
parent.setLastUsed();
} else {
lastUsed = System.currentTimeMillis();
}
} Deprecated!Set the time this object was last used to the
current time in ms. |
protected void setLastUsed(long time) {
if (parent != null) {
parent.setLastUsed(time);
} else {
lastUsed = time;
}
} Deprecated!Set the time in ms this object was last used. |
protected void setStackTrace() {
if (config == null) {
return;
}
if (config.getLogAbandoned()) {
createdBy = new Exception();
createdTime = System.currentTimeMillis();
}
if (parent != null) {
parent.addTrace(this);
}
} Deprecated!If logAbandoned=true generate a stack trace
for this object then add this object to the parent
object trace list. |