|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.sadun.util.pool2.BasePooledObject
A base implementation of a pooled object employing file serialization for passivation purposes.
This class offer support for handling the passivability and passivation state, and for object passivation/activation.
| Constructor Summary | |
protected |
BasePooledObject(ObjectPool objectPool,
java.lang.Object original)
|
| Method Summary | |
void |
_activate()
Activate the object. |
java.lang.Object |
_getOriginal()
Activate the object, if necessary, and returns the original object. |
boolean |
_isPassivable()
Return the invariant passivable.state, as determined by the passivation manager associated to this pooled object. |
boolean |
_isPassivableNow()
Return the current passivable.state. |
boolean |
_isPassivated()
Returns the passivated state. |
void |
_passivate()
This method passivates objects via serialization. |
void |
_releaseOriginal()
Release the original, marking it as passivable. |
ObjectPool |
getObjectPool()
Returns the objectPool. |
protected java.lang.Object |
getOriginal()
Returns the original. |
java.io.File |
getSerializedFile()
Return the serialized File, or null if the object is not passivated. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
protected BasePooledObject(ObjectPool objectPool,
java.lang.Object original)
| Method Detail |
public final java.lang.Object _getOriginal()
throws ActivationException
PooledObjectreleaseOriginal().
_getOriginal in interface PooledObjectActivationExceptionPooledObject._getOriginal()public final void _releaseOriginal()
PooledObject
_releaseOriginal in interface PooledObjectPooledObject._releaseOriginal()
public final void _activate()
throws ActivationException
_activate in interface PooledObjectActivationExceptionPooledObject._activate()
public final void _passivate()
throws PassivationException
The original object must be Serializable.
The object is assigned an unique file name in a directory whose name is the class name of the original object; it is then serialized using an ObjectOutputStream.
_passivate in interface PooledObjectPassivationExceptionPooledObject._passivate()public boolean _isPassivableNow()
_isPassivableNow in interface PooledObjectpublic boolean _isPassivable()
For example, a passivation manager may require that an object be serializable or implement a specific interface.
_isPassivable in interface PooledObjectBasePassivationManager.canPassivate(java.lang.Class)public boolean _isPassivated()
_isPassivated in interface PooledObjectpublic java.io.File getSerializedFile()
public java.lang.String toString()
protected java.lang.Object getOriginal()
public final ObjectPool getObjectPool()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||