public class ClusteredConcurrentTimestampsRegionImpl extends TransactionalDataRegionAdapter implements TimestampsRegion
Maintains a local (authoritative) cache of timestamps along with the distributed cache held in JBoss Cache. Listens for changes in the distributed cache and updates the local cache accordingly. Ensures that any changes in the local cache represent either 1) an increase in the timestamp or 2) a stepback in the timestamp by the caller that initially increased it as part of a pre-invalidate call. This approach allows timestamp changes to be replicated asynchronously by JBoss Cache while still preventing invalid backward changes in timestamps.
NOTE: This is just a prototype!!! Only useful if we change the TimestampsRegion API.| Modifier and Type | Field and Description |
|---|---|
static String |
TYPE |
metadatacurrentView, internalFqn, invalidateState, invalidationMutex, ITEM, jbcCache, log, memberId, optimistic, regionFqn, regionName, regionRoot, regionRootMutex, replication, transactionManager| Constructor and Description |
|---|
ClusteredConcurrentTimestampsRegionImpl(org.jboss.cache.Cache jbcCache,
String regionName,
String regionPrefix,
Properties properties)
Create a new ClusteredConccurentTimestampsRegionImpl.
|
| Modifier and Type | Method and Description |
|---|---|
protected org.jboss.cache.Fqn<String> |
createRegionFqn(String regionName,
String regionPrefix) |
void |
destroy()
The "end state" contract of the region's lifecycle.
|
void |
evict(Object key)
Evict an item from the cache immediately (without regard for transaction
isolation).
|
void |
evictAll()
Evict all contents of this particular cache region (without regard for transaction
isolation).
|
Object |
get(Object key)
Get an item from the cache.
|
void |
invalidate(Object key,
Object value,
Object preInvalidateValue) |
void |
nodeModified(org.jboss.cache.notifications.event.NodeModifiedEvent event)
Monitors cache events and updates the local cache
|
void |
nodeRemoved(org.jboss.cache.notifications.event.NodeRemovedEvent event)
Monitors cache events and updates the local cache
|
void |
preInvalidate(Object key,
Object value) |
void |
put(Object key,
Object value)
Put an item into the cache.
|
getCacheDataDescription, isTransactionAwareactivateLocalClusterNode, checkValid, contains, deactivateLocalNode, ensureRegionRootExists, escapeRegionName, getCacheInstance, getElementCountInMemory, getElementCountOnDisk, getMemberId, getName, getNonLockingDataVersionOption, getRegionFqn, getSizeInMemory, getTimeout, getTypeFirstRegionFqn, getTypeLastRegionFqn, handleEvictAllInvalidation, handleEvictAllModification, nextTimestamp, nodeInvalidated, resume, suspend, suspendAndGet, toMap, viewChangedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcontains, getElementCountInMemory, getElementCountOnDisk, getName, getSizeInMemory, getTimeout, nextTimestamp, toMappublic static final String TYPE
public ClusteredConcurrentTimestampsRegionImpl(org.jboss.cache.Cache jbcCache,
String regionName,
String regionPrefix,
Properties properties)
jbcCache - regionName - regionPrefix - TODOmetadata - protected org.jboss.cache.Fqn<String> createRegionFqn(String regionName, String regionPrefix)
createRegionFqn in class BasicRegionAdapterpublic void evict(Object key) throws CacheException
GeneralDataRegionevict in interface GeneralDataRegionkey - The key of the item to removeCacheException - Indicates a problem accessing the item or region.public void evictAll()
throws CacheException
GeneralDataRegionevictAll in interface GeneralDataRegionCacheException - Indicates problem accessing the region.public Object get(Object key) throws CacheException
GeneralDataRegionget in interface GeneralDataRegionkey - The key of the item to be retrieved.CacheException - Indicates a problem accessing the item or region.public void put(Object key, Object value) throws CacheException
GeneralDataRegionput in interface GeneralDataRegionkey - The key under which to cache the item.value - The item to cache.CacheException - Indicates a problem accessing the region.public void preInvalidate(Object key, Object value) throws CacheException
CacheExceptionpublic void invalidate(Object key, Object value, Object preInvalidateValue) throws CacheException
CacheExceptionpublic void destroy()
throws CacheException
RegionSessionFactory.close() to give
the region a chance to cleanup.destroy in interface Regiondestroy in class BasicRegionAdapterCacheException - Indicates problem shutting downpublic void nodeModified(org.jboss.cache.notifications.event.NodeModifiedEvent event)
nodeModified in class BasicRegionAdapterevent - public void nodeRemoved(org.jboss.cache.notifications.event.NodeRemovedEvent event)
event - Copyright © 2002-2013 Red Hat Middleware, LLC. All Rights Reserved