|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.spy.SpyObject
net.spy.pool.PoolAble
public abstract class PoolAble
PoolAble is the object container that is used to store objects in the pool.
The system property net.spy.pool.debug can be set to a file where the debugging output will go.
| Field Summary | |
|---|---|
static int |
MAY_CLEAN
Minimum value returned from pruneStatus() if we may clean the object. |
static int |
MUST_CLEAN
Minimum value returned from pruneStatus() if we must clean the object. |
| Constructor Summary | |
|---|---|
PoolAble(java.lang.Object o,
int h)
Get a PoolAble representation for an object. |
|
PoolAble(java.lang.Object o,
long a,
int h)
Get a PoolAble representation for an object, including a given maximum lifetime the object can have. |
|
| Method Summary | |
|---|---|
void |
activate()
Activate this PoolAble object. |
void |
checkIn()
Check the object back in. |
void |
checkOut()
Check the object out. |
protected void |
debug(java.lang.String msg)
Debugging info. |
void |
discard()
Discard the object. |
java.lang.Object |
getObject()
Get the object we're pooling. |
int |
getObjectID()
Get the object ID of this object. |
protected java.lang.Object |
intGetObject()
Internal version of getObject(). |
boolean |
isAlive()
Find out of the PoolAble represents a usable object. |
boolean |
isAvailable()
Find out if the object is available for a requestor |
boolean |
isCheckedOut()
Find out if the object is checked out. |
int |
pruneStatus()
Find out if an object is prunable |
protected void |
setAvailable()
Mark this object as available. |
void |
setMaxAge(long to)
Set the maximum age of this PoolAble. |
void |
setObjectID(int id)
Set the internal object ID. |
void |
setPoolName(java.lang.String to)
Set the pool name this thing sits in. |
protected void |
setUnavailable()
Mark this object as unavailable. |
java.lang.String |
toString()
Return a string representation of this object. |
| Methods inherited from class net.spy.SpyObject |
|---|
getLogger |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int MAY_CLEAN
public static final int MUST_CLEAN
| Constructor Detail |
|---|
public PoolAble(java.lang.Object o,
int h)
public PoolAble(java.lang.Object o,
long a,
int h)
maxAge - the amount of time, in milliseconds, that the object
will be valid. Objects will not be checked out if they are older
than their maximum lifetime.| Method Detail |
|---|
public void setMaxAge(long to)
public boolean isAlive()
Objects implementing isAlive() should turn off object availability if they determine the object no longer isAlive().
public java.lang.Object getObject()
throws PoolException
PoolException - if something bad happens (i.e. the object is
not checked out)protected java.lang.Object intGetObject()
public void setObjectID(int id)
id - ObjectId of this object.public void setPoolName(java.lang.String to)
public int getObjectID()
public void activate()
public void checkIn()
checkIn also does some checks such as making sure the item is not too old, and that it is still alive.
protected void setAvailable()
protected void setUnavailable()
public void checkOut()
public boolean isCheckedOut()
public boolean isAvailable()
public int pruneStatus()
public void discard()
protected final void debug(java.lang.String msg)
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||