|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.pool2.impl.DefaultPooledObject<T>
org.apache.commons.pool2.impl.PooledSoftReference<T>
T - the type of the underlying object that the wrapped SoftReference
refers to.public class PooledSoftReference<T>
Extension of DefaultPooledObject to wrap pooled soft references.
This class is intended to be thread-safe.
| Constructor Summary | |
|---|---|
PooledSoftReference(SoftReference<T> reference)
Creates a new PooledSoftReference wrapping the provided reference. |
|
| Method Summary | |
|---|---|
T |
getObject()
Returns the object that the wrapped SoftReference refers to. |
SoftReference<T> |
getReference()
Returns the SoftReference wrapped by this object. |
void |
setReference(SoftReference<T> reference)
Sets the wrapped reference. |
String |
toString()
Provides a String form of the wrapper for debug purposes. |
| Methods inherited from class org.apache.commons.pool2.impl.DefaultPooledObject |
|---|
allocate, compareTo, deallocate, endEvictionTest, getActiveTimeMillis, getCreateTime, getIdleTimeMillis, getLastBorrowTime, getLastReturnTime, getLastUsedTime, getState, invalidate, markAbandoned, markReturning, printStackTrace, setLogAbandoned, startEvictionTest, use |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.commons.pool2.PooledObject |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public PooledSoftReference(SoftReference<T> reference)
reference - SoftReference to be managed by the pool| Method Detail |
|---|
public T getObject()
Note that if the reference has been cleared, this method will return null.
getObject in interface PooledObject<T>getObject in class DefaultPooledObject<T>public String toString()
toString in interface PooledObject<T>toString in class DefaultPooledObject<T>public SoftReference<T> getReference()
public void setReference(SoftReference<T> 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.
reference - new reference
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||