Methods Summary |
---|
public void | clear()Clear the cache
cache.clearAll();
|
public void | destroy()Clean up
cache.clearAll();
|
public java.lang.Object | get(java.lang.Object key)Get an item from the cache
if (key instanceof Serializable) {
return cache.get( (Serializable) key );
}
else {
throw new CacheException("Keys must implement Serializable");
}
|
public long | getElementCountInMemory()
return -1;
|
public long | getElementCountOnDisk()
return -1;
|
public java.lang.String | getRegionName()
return regionName;
|
public long | getSizeInMemory()
return -1;
|
public int | getTimeout()Get a reasonable "lock timeout"
return 600;
|
public void | lock(java.lang.Object key)If this is a clustered cache, lock the item
throw new UnsupportedOperationException("SwarmCache does not support locking (use nonstrict-read-write)");
|
public long | nextTimestamp()Generate a (coarse) timestamp
return System.currentTimeMillis() / 100;
|
public void | put(java.lang.Object key, java.lang.Object value)Add an item to the cache
if (key instanceof Serializable) {
cache.put( (Serializable) key, value );
}
else {
throw new CacheException("Keys must implement Serializable");
}
|
public java.lang.Object | read(java.lang.Object key)
return get(key);
|
public void | remove(java.lang.Object key)Remove an item from the cache
if (key instanceof Serializable) {
cache.clear( (Serializable) key );
}
else {
throw new CacheException("Keys must implement Serializable");
}
|
public java.util.Map | toMap()
throw new UnsupportedOperationException();
|
public java.lang.String | toString()
return "SwarmCache(" + regionName + ')";
|
public void | unlock(java.lang.Object key)If this is a clustered cache, unlock the item
throw new UnsupportedOperationException("SwarmCache does not support locking (use nonstrict-read-write)");
|
public void | update(java.lang.Object key, java.lang.Object value)Add an item to the cache
put(key, value);
|