|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
interface ReplacementPolicy
Interface that must be implemented by classes that provide a replacement
algorithm for ConcurrentCache
.
Nested Class Summary | |
---|---|
static interface |
ReplacementPolicy.Callback
The interface for the callback objects that ConcurrentCache
uses to notify the replacement algorithm about events such as look-ups
and removals. |
Method Summary | |
---|---|
void |
doShrink()
Try to shrink the cache if it has exceeded its maximum size. |
void |
insertEntry(CacheEntry entry)
Insert an entry into the ReplacementPolicy 's data
structure, possibly evicting another entry. |
Method Detail |
---|
void insertEntry(CacheEntry entry) throws StandardException
ReplacementPolicy
's data
structure, possibly evicting another entry. The entry should be
uninitialized when the method is called (that is, its
Cacheable
should be null
), and it should be
locked. When the method returns, the entry may have been initialized
with a Cacheable
which is ready to be reused. It is also
possible that the Cacheable
is still null
when
the method returns, in which case the caller must allocate one itself.
The entry will be associated with a Callback
object that it can
use to communicate back to the replacement policy events (for instance,
that it has been accessed or become invalid).
entry
- the entry to insert
StandardException
- if an error occurs while inserting the
entryCacheEntry.setCallback(ReplacementPolicy.Callback)
void doShrink()
|
Built on Thu 2012-03-29 21:53:33+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |