|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Cached
Interface for cached objects to implement.
| Method Summary | |
|---|---|
void |
expire()
Forcibly expire the object regardless of its internal state. |
long |
getCreationTime()
Returns the time (in milliseconds) the object was created. |
long |
getExpirationLimit()
Get the expiration limit (in milliseconds). |
long |
getLastUseTime()
Returns the last time (in milliseconds) this object was used or accessed. |
long |
getUnusedExpirationLimit()
Get the expiration limit (in milliseconds). |
boolean |
isExpired()
Is the implementation expired (should it be removed from a cache or discarded)? |
boolean |
isExpired(long expirationVal,
long unusedExpirationVal)
Is the implementation expired (should it be removed from a cache or discarded) based on the supplied criteria? |
void |
renew()
Renew an object (at least removing a forcible expiration, possibly resetting internal state). |
void |
setExpirationLimit(long expirationVal)
Set the expiration limit (in milliseconds). |
void |
setLastUseTime()
Notify the implementation that it should mark the last use time using the current time. |
void |
setLastUseTime(long lastUseTime)
Set the last use time for the implementation using the specified value (in milliseconds). |
void |
setUnusedExpirationLimit(long expirationVal)
Set the unused expiration limit (in milliseconds). |
| Method Detail |
|---|
long getCreationTime()
long getLastUseTime()
void setLastUseTime()
void setLastUseTime(long lastUseTime)
lastUseTime - the milliseconds value to use.boolean isExpired()
boolean isExpired(long expirationVal,
long unusedExpirationVal)
expirationVal - the amount of milliseconds that can pass since
the creation time before the implementation is considered
expired. A value of -1 is considered a "disabled"
value and such values should then be ignored (that is
the implementation should never expire on the creation
time).unusedExpirationVal - the amount of milliseconds that can pass since
the last use time before the implementation is considered
expired. A value of -1 is considered a "disabled"
value and such values should then be ignored (that is
the implementation should never expire on the last use
time).
void expire()
void renew()
long getExpirationLimit()
void setExpirationLimit(long expirationVal)
expirationVal - the amount of milliseconds that can pass since
the creation time before the implementation is considered
expired. A value of -1 is considered a "disabled"
value and such values should then be ignored (that is
the implementation should never expire on the creation
time).long getUnusedExpirationLimit()
void setUnusedExpirationLimit(long expirationVal)
expirationVal - the amount of milliseconds that can pass since
the last use time before the implementation is considered
expired. A value of -1 is considered a "disabled"
value and such values should then be ignored (that is
the implementation should never expire on the last use
time).
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||