public abstract class AbstractSerializationCache extends SerializationMap implements ObservableMap
AbstractKeySetBasedMap.EntrySet, AbstractKeySetBasedMap.KeyIterator, AbstractKeySetBasedMap.KeySet, AbstractKeySetBasedMap.ValuesCollection
AbstractKeyBasedMap.DeferredCacheEvent<K,V>
Base.LoggingWriter, Base.StackFrame
Constructor and Description |
---|
AbstractSerializationCache(BinaryStore store)
Construct a serialization cache on top of a BinaryStore.
|
AbstractSerializationCache(BinaryStore store,
boolean fBinaryMap)
Construct a serialization cache on top of a BinaryStore, optionally
storing only Binary keys and values.
|
AbstractSerializationCache(BinaryStore store,
ClassLoader loader)
Construct a serialization cache on top of a BinaryStore, using the
passed ClassLoader for deserialization.
|
Modifier and Type | Method and Description |
---|---|
void |
addMapListener(MapListener listener)
Add a standard map listener that will receive all events (inserts,
updates, deletes) that occur against the map, with the key, old-value
and new-value included.
|
void |
addMapListener(MapListener listener,
Filter filter,
boolean fLite)
Add a map listener that receives events based on a filter evaluation.
|
void |
addMapListener(MapListener listener,
Object oKey,
boolean fLite)
Add a map listener for a specific key.
|
void |
clear()
Clear all key/value mappings.
|
protected void |
dispatchEvent(CacheEvent evt)
Dispatch the passed event.
|
protected void |
dispatchPendingEvent(Object oKey,
int nId,
Object oNewValue,
boolean fSynthetic)
Dispatch an event that has not yet occurred, allowing the cache to
potentially avoid reading of the "original value" information.
|
abstract void |
evict()
Flush items that have expired.
|
protected String |
getDescription()
Assemble a human-readable description.
|
protected MapListenerSupport |
getMapListenerSupport()
Accessor for the MapListenerSupport for sub-classes.
|
protected boolean |
hasListeners()
Determine if this map has any listeners at all.
|
Object |
put(Object oKey,
Object oValue)
Associates the specified value with the specified key in this map.
|
void |
putAll(Map map)
Copies all of the mappings from the specified map to this map.
|
Object |
remove(Object oKey)
Removes the mapping for this key from this map if present.
|
protected boolean |
removeBlind(Object oKey)
Removes the mapping for this key from this map if present.
|
void |
removeMapListener(MapListener listener)
Remove a standard map listener that previously signed up for all
events.
|
void |
removeMapListener(MapListener listener,
Filter filter)
Remove a map listener that previously signed up for events based on a
filter evaluation.
|
void |
removeMapListener(MapListener listener,
Object oKey)
Remove a map listener that previously signed up for events about a
specific key.
|
containsValue, eraseStore, fromBinary, get, getBinaryStore, getCacheStatistics, getClassLoader, getInternalKeySet, getKeyMap, instantiateKeyMap, isBinaryMap, registerKey, setBinaryMap, setBinaryStore, setClassLoader, toBinary, toString, unregisterKey
containsKey, instantiateEntrySet, instantiateKeyIterator, instantiateKeySet, instantiateValues, isEmpty, isInternalKeySetIteratorMutable, iterateKeys, size
clone, entrySet, equals, getAll, hashCode, keySet, values
azzert, azzert, azzert, azzertFailed, breakLines, breakLines, capitalize, checkNotEmpty, checkNotNull, checkRange, computeSafeWaitTime, decimalValue, dup, dup, ensureBigDecimal, ensureClassLoader, ensureRuntimeException, ensureRuntimeException, equals, equalsDeep, err, err, err, err, err, escape, formatDateTime, getCallerStackFrame, getCommonMonitor, getCommonMonitor, getCommonMonitor, getContextClassLoader, getContextClassLoader, getDeepMessage, getErr, getLastSafeTimeMillis, getLog, getMaxDecDigits, getMaxHexDigits, getOriginalException, getOut, getProcessRandom, getRandom, getRandomBinary, getRandomBinary, getRandomString, getSafeTimeMillis, getStackFrame, getStackFrames, getStackTrace, getStackTrace, getThreadFactory, getTimeZone, getUpTimeMillis, hashCode, hexValue, indentString, indentString, isDecimal, isHex, isLogEcho, isOctal, log, log, log, log, log, makeInteger, makeLong, makeThread, mod, mod, octalValue, out, out, out, out, out, pad, parseBandwidth, parseBandwidth, parseDelimitedString, parseHex, parseHex, parseMemorySize, parseMemorySize, parsePercentage, parseTime, parseTime, parseTimeNanos, parseTimeNanos, printStackTrace, randomize, randomize, randomize, randomize, read, read, read, read, read, read, read, replace, setErr, setLog, setLogEcho, setOut, sleep, toBandwidthString, toBandwidthString, toCharEscape, toCrc, toCrc, toCrc, toCrc, toCrc, toDecString, toDelimitedString, toDelimitedString, toDelimitedString, toDelimitedString, toHex, toHex, toHexDump, toHexEscape, toHexEscape, toHexEscape, toHexEscape, toHexString, toMemorySizeString, toMemorySizeString, toQuotedCharEscape, toQuotedStringEscape, toSqlString, toString, toString, toStringEscape, toUnicodeEscape, trace, trace, trace, trace, trace, trace, trace, trace, trace, truncateString, truncateString, wait
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putIfAbsent, remove, replace, replace, replaceAll, size, values
public AbstractSerializationCache(BinaryStore store)
store
- the BinaryStore to use to write the serialized objects topublic AbstractSerializationCache(BinaryStore store, ClassLoader loader)
store
- the BinaryStore to use to write the serialized objects toloader
- the ClassLoader to use for deserializationpublic AbstractSerializationCache(BinaryStore store, boolean fBinaryMap)
store
- the BinaryStore to use to write the serialized
objects tofBinaryMap
- true indicates that this map will only manage
binary keys and valuespublic void clear()
clear
in interface Map
clear
in class SerializationMap
public Object put(Object oKey, Object oValue)
put
in interface Map
put
in class SerializationMap
oKey
- key with which the specified value is to be associatedoValue
- value to be associated with the specified keypublic void putAll(Map map)
AbstractKeyBasedMap.put(K, V)
on this map once for each mapping in the passed map. The behavior of
this operation is unspecified if the passed map is modified while the
operation is in progress.putAll
in interface Map
putAll
in class SerializationMap
map
- the Map containing the key/value pairings to put into this
Mappublic Object remove(Object oKey)
remove
in interface Map
remove
in class SerializationMap
oKey
- key whose mapping is to be removed from the mapprotected boolean removeBlind(Object oKey)
removeBlind
in class SerializationMap
oKey
- key whose mapping is to be removed from the mappublic void addMapListener(MapListener listener)
addMapListener(listener, (Filter) null, false);
addMapListener
in interface ObservableMap
listener
- the MapEvent
listener to addpublic void removeMapListener(MapListener listener)
removeMapListener(listener, (Filter) null);
removeMapListener
in interface ObservableMap
listener
- the listener to removepublic void addMapListener(MapListener listener, Object oKey, boolean fLite)
The listeners will receive MapEvent objects, but if fLite is passed as true, they might not contain the OldValue and NewValue properties.
To unregister the MapListener, use the
ObservableMap.removeMapListener(MapListener, Object)
method.
addMapListener
in interface ObservableMap
listener
- the MapEvent
listener to addoKey
- the key that identifies the entry for which to raise
eventsfLite
- true to indicate that the MapEvent
objects do
not have to include the OldValue and NewValue
property values in order to allow optimizationspublic void removeMapListener(MapListener listener, Object oKey)
removeMapListener
in interface ObservableMap
listener
- the listener to removeoKey
- the key that identifies the entry for which to raise
eventspublic void addMapListener(MapListener listener, Filter filter, boolean fLite)
The listeners will receive MapEvent objects, but if fLite is passed as true, they might not contain the OldValue and NewValue properties.
To unregister the MapListener, use the
ObservableMap.removeMapListener(MapListener, Filter)
method.
addMapListener
in interface ObservableMap
listener
- the MapEvent
listener to addfilter
- a filter that will be passed MapEvent objects to select
from; a MapEvent will be delivered to the listener only
if the filter evaluates to true for that MapEvent (see
MapEventFilter
);
null is equivalent to a filter that alway returns truefLite
- true to indicate that the MapEvent
objects do
not have to include the OldValue and NewValue
property values in order to allow optimizationspublic void removeMapListener(MapListener listener, Filter filter)
removeMapListener
in interface ObservableMap
listener
- the listener to removefilter
- the filter that was passed into the corresponding
addMapListener() callpublic abstract void evict()
protected String getDescription()
getDescription
in class SerializationMap
protected MapListenerSupport getMapListenerSupport()
protected boolean hasListeners()
protected void dispatchPendingEvent(Object oKey, int nId, Object oNewValue, boolean fSynthetic)
oKey
- the key which the event is related tonId
- the event IDoNewValue
- the new valuefSynthetic
- true if the event is syntheticprotected void dispatchEvent(CacheEvent evt)
evt
- a CacheEvent object