DefaultPooledObject

This wrapper is used to track the additional information, such as state, for the pooled objects. <p> This class is intended to be thread-safe. </p>

@param <T> the type of object in the pool

Constructors

this
this(T object)

Create a new instance that wraps the provided object so that the pool can track the state of the pooled object.

Members

Functions

allocate
bool allocate()

Allocates the object.

deallocate
bool deallocate()

Deallocates the object and sets it {@link PooledObjectState#IDLE IDLE} if it is currently {@link PooledObjectState#ALLOCATED ALLOCATED}.

endEvictionTest
bool endEvictionTest(Deque!(IPooledObject) idleQueue)
Undocumented in source. Be warned that the author may not have intended to support it.
getActiveTimeMillis
long getActiveTimeMillis()
Undocumented in source. Be warned that the author may not have intended to support it.
getBorrowedCount
long getBorrowedCount()

Get the number of times this object has been borrowed. @return The number of times this object has been borrowed.

getCreateTime
long getCreateTime()
Undocumented in source. Be warned that the author may not have intended to support it.
getIdleTimeMillis
long getIdleTimeMillis()
Undocumented in source. Be warned that the author may not have intended to support it.
getLastBorrowTime
long getLastBorrowTime()
Undocumented in source. Be warned that the author may not have intended to support it.
getLastReturnTime
long getLastReturnTime()
Undocumented in source. Be warned that the author may not have intended to support it.
getLastUsedTime
long getLastUsedTime()

Return an estimate of the last time this object was used. If the class of the pooled object implements {@link TrackedUse}, what is returned is the maximum of {@link TrackedUse#getLastUsed()} and {@link #getLastBorrowTime()}; otherwise this method gives the same value as {@link #getLastBorrowTime()}.

getObject
T getObject()
Undocumented in source. Be warned that the author may not have intended to support it.
getState
PooledObjectState getState()

Returns the state of this object. @return state

invalidate
void invalidate()

Sets the state to {@link PooledObjectState#INVALID INVALID}

markAbandoned
void markAbandoned()

Marks the pooled object as abandoned.

markReturning
void markReturning()

Marks the object as returning to the pool.

objectToString
string objectToString()
Undocumented in source. Be warned that the author may not have intended to support it.
objectType
TypeInfo objectType()
Undocumented in source. Be warned that the author may not have intended to support it.
opCmp
int opCmp(IPooledObject other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(Object obj)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(IPooledObject obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setLogAbandoned
void setLogAbandoned(bool logAbandoned)
Undocumented in source. Be warned that the author may not have intended to support it.
setRequireFullStackTrace
void setRequireFullStackTrace(bool requireFullStackTrace)

Configures 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
bool startEvictionTest()
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
use
void use()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta