Implementations of this class are required to be thread-safe.
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public int | compareTo(PooledObject<T>
the object to be compared. other)Redeclares java. |
| public boolean | |
| public boolean | Returns: Currently not used.The queue of idle objects to which the object should be
returned. idleQueue)Notifies the object that the eviction test has ended. |
| public boolean | |
| public default Duration | Returns: The duration last spent in the active state.Gets the amount of time this object last spent in the active state (it may still be active in which case subsequent calls will return an increased value). |
| public default Duration | Returns: The duration last spent in the active state.
Deprecated
Use
Gets the amount of time this object last spent in the active state (it may still be active in which case
subsequent calls will return an increased value).
getActiveDuration().
|
| public long | Returns: The time in milliseconds last spent in the active state.
Deprecated
Use
Gets the amount of time in milliseconds this object last spent in the
active state (it may still be active in which case subsequent calls will
return an increased value).
getActiveTime() which offers the best precision.
|
| public default long | Returns: -1 by default for implementations prior to release 2.7.0.Gets the number of times this object has been borrowed. |
| public default Instant | Returns: The creation time for the wrapped object.Gets the time (using the same basis as |
| public long | Returns: The creation time for the wrapped object.
Deprecated
Use
Gets the time (using the same basis as
getCreateInstant() which offers the best precision.
java.) that this object was created.
|
| public default Duration | Returns: The duration since this object was created.Gets the duration since this object was created (using |
| public default Duration | Returns: The amount of time in last spent in the idle state.Gets the amount of time that this object last spend in the idle state (it may still be idle in which case subsequent calls will return an increased value). |
| public default Duration | Returns: The amount of time in last spent in the idle state.
Deprecated
Use
Gets the amount of time that this object last spend in the
idle state (it may still be idle in which case subsequent calls will
return an increased value).
getIdleDuration().
|
| public long | Returns: The time in milliseconds last spent in the idle state.
Deprecated
Use
Gets the amount of time in milliseconds that this object last spend in the
idle state (it may still be idle in which case subsequent calls will
return an increased value).
getIdleTime() which offers the best precision.
|
| public default Instant | Returns: The time the object was last borrowed.Gets the time the wrapped object was last borrowed. |
| public long | Returns: The time the object was last borrowed.
Deprecated
Use
Gets the time the wrapped object was last borrowed.
getLastBorrowInstant() which offers the best precision.
|
| public default Instant | Returns: The time the object was last borrowed.Gets the time the wrapped object was last borrowed. |
| public long | Returns: The time the object was last returned.
Deprecated
Use
Gets the time the wrapped object was last returned.
getLastReturnInstant() which offers the best precision.
|
| public default Instant | Returns: the last time this object was usedGets an estimate of the last time this object was used. |
| public long | Returns: the last time this object was used.
Deprecated
Use
Gets an estimate of the last time this object was used.
getLastUsedInstant() which offers the best precision.
|
| public T | Returns: The wrapped object.Gets the underlying object that is wrapped by this instance of
|
| public PooledObjectState | |
| public int | |
| public void | |
| public static boolean | Returns: whether the given PooledObject is null or contains a null.the PooledObject to test. pooledObject)Tests whether the given PooledObject is null or contains a null. |
| public void | |
| public void | |
| public void | printStackTrace(PrintWriter
The destination for the debug output. writer)Prints the stack trace of the code that borrowed this pooled object and the stack trace of the last code to use this object (if available) to the supplied writer. |
| public void | setLogAbandoned(boolean
The new configuration setting for abandoned
object tracking. logAbandoned)Sets whether to use abandoned object tracking. |
| public default void | setRequireFullStackTrace(final boolean
the new configuration setting for abandoned object logging. requireFullStackTrace)Sets the stack trace generation strategy based on whether or not fully detailed stack traces are required. |
| public boolean | |
| public String | |
| public void |
| allocate | back to summary |
|---|---|
| public boolean allocate() Allocates the object.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(PooledObject<T> other) Redeclares java. Doc from java. Orders instances based on idle time - i.e. the length of time since the instance was returned to the pool. Used by the GKOP idle object evictor. Note This class has a natural ordering that is inconsistent with equals if distinct objects have the same identity hash code. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| deallocate | back to summary |
|---|---|
| public boolean deallocate() Deallocates the object and sets it
| |
| endEvictionTest | back to summary |
|---|---|
| public boolean endEvictionTest(Deque<PooledObject<T>> idleQueue) Notifies the object that the eviction test has ended.
| |
| equals | back to summary |
|---|---|
public boolean equals(Object obj)
| |
| getActiveDuration | back to summary |
|---|---|
| public default Duration getActiveDuration() Gets the amount of time this object last spent in the active state (it may still be active in which case subsequent calls will return an increased value).
| |
| getActiveTime | back to summary |
|---|---|
| public default Duration getActiveTime()
Deprecated Use Gets the amount of time this object last spent in the active state (it may still be active in which case subsequent calls will return an increased value).
| |
| getActiveTimeMillis | back to summary |
|---|---|
| public long getActiveTimeMillis()
Deprecated Use Gets the amount of time in milliseconds this object last spent in the active state (it may still be active in which case subsequent calls will return an increased value).
| |
| getBorrowedCount | back to summary |
|---|---|
| public default long getBorrowedCount() Gets the number of times this object has been borrowed.
| |
| getCreateInstant | back to summary |
|---|---|
| public default Instant getCreateInstant() Gets the time (using the same basis as
| |
| getCreateTime | back to summary |
|---|---|
| public long getCreateTime()
Deprecated Use Gets the time (using the same basis as
| |
| getFullDuration | back to summary |
|---|---|
| public default Duration getFullDuration() Gets the duration since this object was created (using
| |
| getIdleDuration | back to summary |
|---|---|
| public default Duration getIdleDuration() Gets the amount of time that this object last spend in the idle state (it may still be idle in which case subsequent calls will return an increased value).
| |
| getIdleTime | back to summary |
|---|---|
| public default Duration getIdleTime()
Deprecated Use Gets the amount of time that this object last spend in the idle state (it may still be idle in which case subsequent calls will return an increased value).
| |
| getIdleTimeMillis | back to summary |
|---|---|
| public long getIdleTimeMillis()
Deprecated Use Gets the amount of time in milliseconds that this object last spend in the idle state (it may still be idle in which case subsequent calls will return an increased value).
| |
| getLastBorrowInstant | back to summary |
|---|---|
| public default Instant getLastBorrowInstant() Gets the time the wrapped object was last borrowed.
| |
| getLastBorrowTime | back to summary |
|---|---|
| public long getLastBorrowTime()
Deprecated Use Gets the time the wrapped object was last borrowed.
| |
| getLastReturnInstant | back to summary |
|---|---|
| public default Instant getLastReturnInstant() Gets the time the wrapped object was last borrowed.
| |
| getLastReturnTime | back to summary |
|---|---|
| public long getLastReturnTime()
Deprecated Use Gets the time the wrapped object was last returned.
| |
| getLastUsedInstant | back to summary |
|---|---|
| public default Instant getLastUsedInstant() Gets an estimate of the last time this object was used. If the class of the pooled object implements
| |
| getLastUsedTime | back to summary |
|---|---|
| public long getLastUsedTime()
Deprecated Use Gets an estimate of the last time this object was used. If the class
of the pooled object implements
| |
| getObject | back to summary |
|---|---|
| public T getObject() Gets the underlying object that is wrapped by this instance of
| |
| getState | back to summary |
|---|---|
| public PooledObjectState getState() Gets the state of this object.
| |
| hashCode | back to summary |
|---|---|
public int hashCode()
| |
| invalidate | back to summary |
|---|---|
| public void invalidate() Sets the state to | |
| isNull | back to summary |
|---|---|
| public static boolean isNull(final PooledObject<?> pooledObject) Tests whether the given PooledObject is null or contains a null.
| |
| markAbandoned | back to summary |
|---|---|
| public void markAbandoned() Marks the pooled object as abandoned. | |
| markReturning | back to summary |
|---|---|
| public void markReturning() Marks the object as returning to the pool. | |
| printStackTrace | back to summary |
|---|---|
| public void printStackTrace(PrintWriter writer) Prints the stack trace of the code that borrowed this pooled object and the stack trace of the last code to use this object (if available) to the supplied writer.
| |
| setLogAbandoned | back to summary |
|---|---|
| public void setLogAbandoned(boolean logAbandoned) Sets whether to use abandoned object tracking. If this is true the implementation will need to record the stack trace of the last caller to borrow this object.
| |
| setRequireFullStackTrace | back to summary |
|---|---|
| public default void setRequireFullStackTrace(final boolean requireFullStackTrace) Sets the stack trace generation strategy based on whether or not fully detailed stack traces are required. When set to false, abandoned logs may only include caller class information rather than method names, line numbers, and other normal metadata available in a full stack trace.
| |
| startEvictionTest | back to summary |
|---|---|
| public boolean startEvictionTest() Attempts to place the pooled object in the
| |
| toString | back to summary |
|---|---|
| public String toString() Gets a String form of the wrapper for debug purposes. The format is not fixed and may change at any time.
| |
| use | back to summary |
|---|---|
| public void use() Records the current stack trace as the last time the object was used. | |