TrackedUse (Apache Commons Pool 2.11.1 API)

org.apache.commons.pool2

## Interface TrackedUse

-     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 and Description
    --- | ---
    `long` | `getLastUsed()` Deprecated. Use `getLastUsedInstant()` which offers the best precision.
    `default Instant` | `getLastUsedInstant()` Gets the last Instant this object was used.

- - ### Method Detail

    - #### getLastUsed

          @Deprecated
          long getLastUsed()

      Deprecated. Use `getLastUsedInstant()` 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 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

Copyright © 2001–2021 The Apache Software Foundation. All rights reserved.