Class PooledSoftReference<T>
java.lang.Object
org.apache.tomcat.dbcp.pool2.impl.DefaultPooledObject<T>
org.apache.tomcat.dbcp.pool2.impl.PooledSoftReference<T>
- Type Parameters:
- T- the type of the underlying object that the wrapped SoftReference refers to.
- All Implemented Interfaces:
- Comparable<PooledObject<T>>,- PooledObject<T>
Extension of 
DefaultPooledObject to wrap pooled soft references.
 This class is intended to be thread-safe.
- Since:
- 2.0
- 
Constructor SummaryConstructorsConstructorDescriptionPooledSoftReference(SoftReference<T> reference) Creates a new PooledSoftReference wrapping the provided reference.
- 
Method SummaryModifier and TypeMethodDescriptionGets the object that the wrapped SoftReference refers to.Gets the SoftReference wrapped by this object.voidsetReference(SoftReference<T> reference) Sets the wrapped reference.toString()Gets a String form of the wrapper for debug purposes.Methods inherited from class org.apache.tomcat.dbcp.pool2.impl.DefaultPooledObjectallocate, compareTo, deallocate, endEvictionTest, getActiveTimeMillis, getBorrowedCount, getCreateInstant, getCreateTime, getIdleDuration, getIdleTime, getIdleTimeMillis, getLastBorrowInstant, getLastBorrowTime, getLastReturnInstant, getLastReturnTime, getLastUsedInstant, getLastUsedTime, getState, invalidate, markAbandoned, markReturning, printStackTrace, setLogAbandoned, setRequireFullStackTrace, startEvictionTest, useMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.tomcat.dbcp.pool2.PooledObjectequals, getActiveDuration, getActiveTime, getFullDuration, hashCode
- 
Constructor Details- 
PooledSoftReferenceCreates a new PooledSoftReference wrapping the provided reference.- Parameters:
- reference- SoftReference to be managed by the pool
 
 
- 
- 
Method Details- 
getObjectGets the object that the wrapped SoftReference refers to.Note that if the reference has been cleared, this method will return null. - Specified by:
- getObjectin interface- PooledObject<T>
- Overrides:
- getObjectin class- DefaultPooledObject<T>
- Returns:
- Object referred to by the SoftReference
 
- 
getReferenceGets the SoftReference wrapped by this object.- Returns:
- underlying SoftReference
 
- 
setReferenceSets the wrapped reference.This method exists to allow a new, non-registered reference to be held by the pool to track objects that have been checked out of the pool. The actual parameter should be a reference to the same object that getObject()returns before calling this method.- Parameters:
- reference- new reference
 
- 
toStringDescription copied from interface:PooledObjectGets a String form of the wrapper for debug purposes. The format is not fixed and may change at any time.- Specified by:
- toStringin interface- PooledObject<T>
- Overrides:
- toStringin class- DefaultPooledObject<T>
 
 
-