Package org.apache.tomcat.dbcp.pool2
Interface TrackedUse
-
- All Known Implementing Classes:
AbandonedTrace
,DelegatingCallableStatement
,DelegatingConnection
,DelegatingPreparedStatement
,DelegatingResultSet
,DelegatingStatement
,ManagedConnection
,PoolableCallableStatement
,PoolableConnection
,PoolableManagedConnection
,PoolablePreparedStatement
,PoolingConnection
public interface TrackedUse
Allows pooled objects to make information available about when and how they were used available to the object pool. The object pool may, but is not required, to use this information to make more informed decisions when determining the state of a pooled object - for instance whether or not the object has been abandoned.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description long
getLastUsed()
Deprecated.UsegetLastUsedInstant()
which offers the best precision.default java.time.Instant
getLastUsedInstant()
Gets the last Instant this object was used.
-
-
-
Method Detail
-
getLastUsed
@Deprecated long getLastUsed()
Deprecated.UsegetLastUsedInstant()
which offers the best precision.Gets the last time this object was used in milliseconds.- Returns:
- the last time this object was used in milliseconds.
-
getLastUsedInstant
default java.time.Instant getLastUsedInstant()
Gets the last Instant this object was used.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.- Returns:
- the last Instant this object was used.
- Since:
- 2.11.0
-
-