public class OSCache extends Object implements Cache
Constructor and Description |
---|
OSCache(int refreshPeriod,
String cron,
String region) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the cache
|
void |
destroy()
Clean up
|
Object |
get(Object key)
Get an item from the cache, nontransactionally
|
long |
getElementCountInMemory()
The count of entries currently contained in the regions in-memory store.
|
long |
getElementCountOnDisk()
The count of entries currently contained in the regions disk store.
|
String |
getRegionName()
Get the name of the cache region
|
long |
getSizeInMemory()
The number of bytes is this cache region currently consuming in memory.
|
int |
getTimeout()
Get a reasonable "lock timeout"
|
void |
lock(Object key)
If this is a clustered cache, lock the item
|
long |
nextTimestamp()
Generate a timestamp
|
void |
put(Object key,
Object value)
Add an item to the cache, nontransactionally, with
failfast semantics
|
Object |
read(Object key)
Get an item from the cache
|
void |
remove(Object key)
Remove an item from the cache
|
void |
setCacheCapacity(int cacheCapacity) |
Map |
toMap()
optional operation
|
String |
toString() |
void |
unlock(Object key)
If this is a clustered cache, unlock the item
|
void |
update(Object key,
Object value)
Add an item to the cache
|
public void setCacheCapacity(int cacheCapacity)
public Object get(Object key) throws CacheException
Cache
get
in interface Cache
CacheException
public Object read(Object key) throws CacheException
Cache
read
in interface Cache
CacheException
public void update(Object key, Object value) throws CacheException
Cache
update
in interface Cache
CacheException
public void put(Object key, Object value) throws CacheException
Cache
put
in interface Cache
CacheException
public void remove(Object key) throws CacheException
Cache
remove
in interface Cache
CacheException
public void clear() throws CacheException
Cache
clear
in interface Cache
CacheException
public void destroy() throws CacheException
Cache
destroy
in interface Cache
CacheException
public void lock(Object key) throws CacheException
Cache
lock
in interface Cache
CacheException
public void unlock(Object key) throws CacheException
Cache
unlock
in interface Cache
CacheException
public long nextTimestamp()
Cache
nextTimestamp
in interface Cache
public int getTimeout()
Cache
getTimeout
in interface Cache
public String getRegionName()
Cache
getRegionName
in interface Cache
public long getSizeInMemory()
Cache
getSizeInMemory
in interface Cache
public long getElementCountInMemory()
Cache
getElementCountInMemory
in interface Cache
public long getElementCountOnDisk()
Cache
getElementCountOnDisk
in interface Cache
Copyright © 2014. All rights reserved.