|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
com.tangosol.util.Base
com.tangosol.coherence.hibernate.CoherenceCache
public class CoherenceCache
Provides a cache wrapper for storing Hibernate objects in Coherence NamedCache instances.
Field Summary | |
---|---|
protected static int |
DEFAULT_LOCK_LEASE_MILLIS The default lock lease millis |
protected static int |
DEFAULT_LOCK_OBTAIN_MILLIS The default lock attempt millis |
static String |
LOCK_LEASE_TIMEOUT The system property specifying the lock lease timeout |
static String |
LOCK_OBTAIN_TIMEOUT The system property specifying the lock acquisition timeout |
Constructor Summary | |
---|---|
CoherenceCache(NamedCache cache, Properties properties) Construct a Hibernate cache instance. |
Method Summary | |
---|---|
void |
clear() Clear the entire cache. |
void |
destroy() Release local (JVM) resources associated with this cache. |
Object |
get(Object oKey) Get an object from the cache. |
long |
getElementCountInMemory() Get the size of the cache in memory (object count) Not supported (returns total cache size, including disk). |
long |
getElementCountOnDisk() Get the size of the cache on disk (object count) Not supported (returns -1). |
protected int |
getLockLeaseTimeout() Get the timeout (in millis) for lock leases. |
protected int |
getLockObtainTimeout() Get the timeout (in millis) for lock acquisition attempts. |
String |
getRegionName() Get the region (cache) name. |
long |
getSizeInMemory() Get the size of the cache in memory (byte count) Not supported (returns -1). |
int |
getTimeout() Get the lock timeout (lease duration, not lock acquisition). |
protected long |
getTimeProperty(Properties properties, String sPropertyName, long cDefaultMillis, long cMaxMillis) Get an adjusted time (duration) property |
void |
lock(Object oKey) Lock a key. |
long |
nextTimestamp() Get the current timestamp (in millis). |
void |
put(Object oKey, Object oValue) Put an object into the cache. |
Object |
read(Object oKey) Get an object from the cache. |
void |
remove(Object oKey) Remove an object from the cache. |
Map |
toMap() Get a Map instance representing the contents of the cache. |
void |
unlock(Object oKey) Unlock a key. |
void |
update(Object oKey, Object oValue) Update an item in the cache. |
Field Detail |
---|
public static final String LOCK_OBTAIN_TIMEOUT
protected static final int DEFAULT_LOCK_OBTAIN_MILLIS
public static final String LOCK_LEASE_TIMEOUT
protected static final int DEFAULT_LOCK_LEASE_MILLIS
Constructor Detail |
---|
public CoherenceCache(NamedCache cache, Properties properties)
cache
- the Coherence NamedCache instance that provides the actual data storageproperties
- the configuration propertiesMethod Detail |
---|
public Object get(Object oKey)
oKey
- the cache keypublic Object read(Object oKey)
oKey
- the cache keypublic void put(Object oKey, Object oValue)
oKey
- the cache keyoValue
- the cache valuepublic void remove(Object oKey)
oKey
- the cache keypublic void clear()
public void destroy()
public int getTimeout()
public long nextTimestamp()
public void lock(Object oKey)
oKey
- the cache keyCacheException
- if lock acquisition times outpublic void unlock(Object oKey)
oKey
- the cache keypublic void update(Object oKey, Object oValue)
oKey
- the cache keyoValue
- the cache valuepublic String getRegionName()
public long getSizeInMemory()
Not supported (returns -1).
Note: Used only by the Cache Statistics package
public long getElementCountInMemory()
Not supported (returns total cache size, including disk).
Note: Used only by the Cache Statistics package
public long getElementCountOnDisk()
Not supported (returns -1).
Note: Used only by the Cache Statistics package
public Map toMap()
This implementation simply returns the Coherence NamedCache instance.
protected int getLockObtainTimeout()
protected int getLockLeaseTimeout()
protected long getTimeProperty(Properties properties, String sPropertyName, long cDefaultMillis, long cMaxMillis)
properties
- the property set containing the propertysPropertyName
- the name of the propertycDefaultMillis
- the default value (in milliseconds)cMaxMillis
- the maximum value (saturating, in milliseconds)
|
Oracle® Coherence Java API Reference Release 3.6.0.0 E15725-01 |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |