V
- public class ObjectIdentityMemCache<V extends IdentityCacheable> extends Object implements ObjectIdentityCache<V>
Modifier and Type | Field and Description |
---|---|
protected ConcurrentHashMap<String,V> |
map |
Constructor and Description |
---|
ObjectIdentityMemCache() |
ObjectIdentityMemCache(int cap,
float load,
int conc) |
Modifier and Type | Method and Description |
---|---|
void |
close()
close/release any associated resources
|
void |
dirtyKey(String key)
force the persistent backend, if any, to eventually be updated with
live object state for the given key
|
V |
get(String key)
get the object under the given key/name -- but should not mutate
object state
|
Map<String,V> |
getMap()
Offer raw map access for convenience of checkpoint/recovery.
|
V |
getOrUse(String key,
Supplier<V> supplierOrNull)
get the object under the given key/name, using (and remembering)
the object supplied by the supplier if no prior mapping exists
-- but should not mutate object state
|
Set<String> |
keySet()
set of all keys
|
int |
size()
count of name-to-object contained
|
void |
sync()
force the persistent backend, if any, to be updated with all
live object state
|
protected ConcurrentHashMap<String,V extends IdentityCacheable> map
public ObjectIdentityMemCache()
public ObjectIdentityMemCache(int cap, float load, int conc)
public void close()
ObjectIdentityCache
close
in interface Closeable
close
in interface AutoCloseable
close
in interface ObjectIdentityCache<V extends IdentityCacheable>
public V get(String key)
ObjectIdentityCache
get
in interface ObjectIdentityCache<V extends IdentityCacheable>
public V getOrUse(String key, Supplier<V> supplierOrNull)
ObjectIdentityCache
getOrUse
in interface ObjectIdentityCache<V extends IdentityCacheable>
public int size()
ObjectIdentityCache
size
in interface ObjectIdentityCache<V extends IdentityCacheable>
public Set<String> keySet()
ObjectIdentityCache
keySet
in interface ObjectIdentityCache<V extends IdentityCacheable>
public void sync()
ObjectIdentityCache
sync
in interface ObjectIdentityCache<V extends IdentityCacheable>
public void dirtyKey(String key)
ObjectIdentityCache
dirtyKey
in interface ObjectIdentityCache<V extends IdentityCacheable>
Copyright © 2003-2014 Internet Archive. All Rights Reserved.