public class BinaryStoreCacheStore<K,V> extends AbstractCacheStore<K,V> implements CacheStore<K,V>, IterableCacheLoader<K,V>
Base.LoggingWriter, Base.StackFrame
Constructor and Description |
---|
BinaryStoreCacheStore(BinaryStore store)
Create a CacheStore that delegates to a BinaryStore.
|
BinaryStoreCacheStore(BinaryStore store,
boolean fBinaryOnly)
Create a CacheStore that delegates to a BinaryStore, optionally
storing only Binary keys and values.
|
BinaryStoreCacheStore(BinaryStore store,
ClassLoader loader)
Create a CacheStore that delegates to a BinaryStore, using the passed
ClassLoader for deserialization.
|
Modifier and Type | Method and Description |
---|---|
void |
erase(K key)
Remove the specified key from the underlying store if present.
|
protected Object |
fromBinary(Binary bin)
Translate the passed Binary object into an Object object.
|
BinaryStore |
getBinaryStore()
Returns the BinaryStore that this CacheStore uses for its storage.
|
ClassLoader |
getClassLoader()
Returns the ClassLoader that this CacheStore uses for deserialization,
if it has one.
|
boolean |
isBinaryOnly()
Determine if the keys and values in this CacheStore are known to be all
Binary.
|
Iterator<K> |
keys()
Iterate all keys in the underlying store.
|
V |
load(K key)
Return the value associated with the specified key, or null if the
key does not have an associated value in the underlying store.
|
protected void |
setBinaryStore(BinaryStore store)
Configures the BinaryStore that this CacheStore will use for its
storage.
|
protected void |
setClassLoader(ClassLoader loader)
Configure the ClassLoader that this CacheStore will use for
deserialization.
|
void |
store(K key,
V value)
Store the specified value under the specified key in the underlying
store.
|
protected Binary |
toBinary(Object o)
Translate the passed Object object into an Binary object.
|
eraseAll, storeAll
loadAll
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
eraseAll, storeAll
loadAll
public BinaryStoreCacheStore(BinaryStore store)
store
- the BinaryStore to use to write the serialized objects topublic BinaryStoreCacheStore(BinaryStore store, ClassLoader loader)
store
- the BinaryStore to use to write the serialized objects toloader
- the ClassLoader to use for deserializationpublic BinaryStoreCacheStore(BinaryStore store, boolean fBinaryOnly)
store
- the BinaryStore to use to write the serialized
objects tofBinaryOnly
- true indicates that this CacheStore will only
manage binary keys and valuespublic V load(K key)
load
in interface CacheLoader<K,V>
load
in class AbstractCacheLoader<K,V>
key
- key whose associated value is to be returnedpublic void store(K key, V value)
store
in interface CacheStore<K,V>
store
in class AbstractCacheStore<K,V>
key
- key to store the value undervalue
- value to be storedUnsupportedOperationException
- if this implementation or the
underlying store is read-onlypublic void erase(K key)
erase
in interface CacheStore<K,V>
erase
in class AbstractCacheStore<K,V>
key
- key to remove from the storeUnsupportedOperationException
- if this implementation or the
underlying store is read-onlypublic Iterator<K> keys()
keys
in interface IterableCacheLoader<K,V>
UnsupportedOperationException
- if the underlying store is not
iterableprotected Binary toBinary(Object o)
o
- the Object to serialize into a Binary objectprotected Object fromBinary(Binary bin)
bin
- the Binary object to deserializepublic BinaryStore getBinaryStore()
protected void setBinaryStore(BinaryStore store)
store
- the BinaryStore to usepublic ClassLoader getClassLoader()
protected void setClassLoader(ClassLoader loader)
loader
- the ClassLoader that this CacheStore should use for
deserializationpublic boolean isBinaryOnly()