public class AbandonedTrace extends java.lang.Object implements TrackedUse, java.lang.AutoCloseable
The JDBC Connection, Statement, and ResultSet classes extend this class.
| Constructor and Description |
|---|
AbandonedTrace()
Creates a new AbandonedTrace without config and without doing abandoned tracing.
|
AbandonedTrace(AbandonedTrace parent)
Constructs a new AbandonedTrace with a parent object.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addTrace(AbandonedTrace trace)
Adds an object to the list of objects being traced.
|
protected void |
clearTrace()
Clears the list of objects being traced by this object.
|
void |
close()
Subclasses can implement this nop.
|
protected void |
close(java.util.function.Consumer<java.lang.Exception> exceptionHandler)
Closes this resource and if an exception is caught, then calls
exceptionHandler. |
long |
getLastUsed()
Deprecated.
|
java.time.Instant |
getLastUsedInstant()
Gets the last Instant this object was used.
|
protected java.util.List<AbandonedTrace> |
getTrace()
Gets a list of objects being traced by this object.
|
protected void |
removeThisTrace(java.lang.Object source)
Removes this object the source object is tracing.
|
protected void |
removeTrace(AbandonedTrace trace)
Removes a child object this object is tracing.
|
protected void |
setLastUsed()
Sets the time this object was last used to the current time in milliseconds.
|
protected void |
setLastUsed(java.time.Instant lastUsedInstant)
Sets the instant this object was last used.
|
protected void |
setLastUsed(long lastUsedMillis)
Deprecated.
|
public AbandonedTrace()
public AbandonedTrace(AbandonedTrace parent)
parent - AbandonedTrace parent object.protected void addTrace(AbandonedTrace trace)
trace - AbandonedTrace object to add.protected void clearTrace()
public void close()
throws java.sql.SQLException
close in interface java.lang.AutoCloseablejava.sql.SQLException - Ignored here, for subclasses.protected void close(java.util.function.Consumer<java.lang.Exception> exceptionHandler)
exceptionHandler.exceptionHandler - Consumes exception thrown closing this resource.@Deprecated public long getLastUsed()
getLastUsed in interface TrackedUsepublic java.time.Instant getLastUsedInstant()
TrackedUse
Starting with Java 9, the JRE SystemClock precision is increased usually down to microseconds, or tenth
of microseconds, depending on the OS, Hardware, and JVM implementation.
getLastUsedInstant in interface TrackedUseprotected java.util.List<AbandonedTrace> getTrace()
protected void removeThisTrace(java.lang.Object source)
source - The object tracingprotected void removeTrace(AbandonedTrace trace)
trace - AbandonedTrace object to remove.protected void setLastUsed()
protected void setLastUsed(java.time.Instant lastUsedInstant)
lastUsedInstant - instant.@Deprecated protected void setLastUsed(long lastUsedMillis)
setLastUsed(Instant)lastUsedMillis - time in milliseconds.Copyright © 2000-2024 Apache Software Foundation.
Apache Tomcat, Tomcat, Apache, the Apache Tomcat logo and the Apache logo are either registered trademarks or trademarks of the Apache Software Foundation.