org.sadun.util.pool2
Interface PooledObject

All Known Implementing Classes:
BasePooledObject

public interface PooledObject

A pooled object is a stub for its original object, which is accessible via the same interface.

The original underlying object is not necessarily in core; if a passivation manager class is associated with the ObjectPool containing the object, and the object is passivable according to that manager, the original object may be passivated on some secondary storage.

Author:
Cristiano Sadun

Method Summary
 void _activate()
          Activate the object - retrieving it from secondary memory.
 java.lang.Object _getOriginal()
          Activate the object, if necessary, and returns the original object.
 boolean _isPassivable()
          Return the invariant passivable.state
 boolean _isPassivableNow()
          Return the current passivable.state
 boolean _isPassivated()
          Return the passivate.state
 void _passivate()
          Passivate the object - storing it on secondary storage and freeing core memory.
 void _releaseOriginal()
          Release the original, marking it as passivable.
 

Method Detail

_getOriginal

public java.lang.Object _getOriginal()
                              throws ActivationException
Activate the object, if necessary, and returns the original object. The object stays in core until is released by releaseOriginal().

Throws:
ActivationException

_releaseOriginal

public void _releaseOriginal()
Release the original, marking it as passivable.


_passivate

public void _passivate()
                throws PassivationException
Passivate the object - storing it on secondary storage and freeing core memory.

Throws:
PassivationException

_activate

public void _activate()
               throws ActivationException
Activate the object - retrieving it from secondary memory. The object is still passivable.

Throws:
ActivationException

_isPassivable

public boolean _isPassivable()
Return the invariant passivable.state

Returns:
boolean

_isPassivableNow

public boolean _isPassivableNow()
Return the current passivable.state

Returns:
boolean

_isPassivated

public boolean _isPassivated()
Return the passivate.state

Returns:
boolean