org.hibernate.cache.infinispan.timestamp
Class TimestampsRegionImpl

java.lang.Object
  extended by org.hibernate.cache.infinispan.impl.BaseRegion
      extended by org.hibernate.cache.infinispan.impl.BaseGeneralDataRegion
          extended by org.hibernate.cache.infinispan.timestamp.TimestampsRegionImpl
All Implemented Interfaces:
GeneralDataRegion, Region, TimestampsRegion

public class TimestampsRegionImpl
extends BaseGeneralDataRegion
implements TimestampsRegion

Defines the behavior of the timestamps cache region for Infinispan.

Since:
3.5
Author:
Chris Bredesen, Galder ZamarreƱo

Field Summary
 
Fields inherited from class org.hibernate.cache.infinispan.impl.BaseRegion
address, cacheAdapter, currentView, invalidateState, invalidationMutex, replication, transactionManager
 
Constructor Summary
TimestampsRegionImpl(CacheAdapter cacheAdapter, String name, TransactionManager transactionManager, RegionFactory factory)
           
 
Method Summary
 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.
protected  boolean handleEvictAllInvalidation(org.infinispan.notifications.cachelistener.event.CacheEntryInvalidatedEvent event)
           
protected  boolean handleEvictAllModification(org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent event)
           
 void nodeModified(org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent event)
          Monitors cache events and updates the local cache
 void nodeRemoved(org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent event)
          Monitors cache events and updates the local cache
 void put(Object key, Object value)
          Put an item into the cache.
 
Methods inherited from class org.hibernate.cache.infinispan.impl.BaseRegion
checkValid, contains, entryInvalidated, entryModified, get, getAddress, getCacheAdapter, getElementCountInMemory, getElementCountOnDisk, getName, getOwnerForPut, getSizeInMemory, getTimeout, nextTimestamp, resume, start, suspend, toMap, viewChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.cache.Region
contains, getElementCountInMemory, getElementCountOnDisk, getName, getSizeInMemory, getTimeout, nextTimestamp, toMap
 

Constructor Detail

TimestampsRegionImpl

public TimestampsRegionImpl(CacheAdapter cacheAdapter,
                            String name,
                            TransactionManager transactionManager,
                            RegionFactory factory)
Method Detail

evict

public void evict(Object key)
           throws CacheException
Description copied from interface: GeneralDataRegion
Evict an item from the cache immediately (without regard for transaction isolation).

Specified by:
evict in interface GeneralDataRegion
Overrides:
evict in class BaseGeneralDataRegion
Parameters:
key - The key of the item to remove
Throws:
CacheException - Indicates a problem accessing the item or region.

evictAll

public void evictAll()
              throws CacheException
Description copied from interface: GeneralDataRegion
Evict all contents of this particular cache region (without regard for transaction isolation).

Specified by:
evictAll in interface GeneralDataRegion
Overrides:
evictAll in class BaseGeneralDataRegion
Throws:
CacheException - Indicates problem accessing the region.

get

public Object get(Object key)
           throws CacheException
Description copied from interface: GeneralDataRegion
Get an item from the cache.

Specified by:
get in interface GeneralDataRegion
Overrides:
get in class BaseGeneralDataRegion
Parameters:
key - The key of the item to be retrieved.
Returns:
the cached object or null
Throws:
CacheException - Indicates a problem accessing the item or region.

put

public void put(Object key,
                Object value)
         throws CacheException
Description copied from interface: GeneralDataRegion
Put an item into the cache.

Specified by:
put in interface GeneralDataRegion
Overrides:
put in class BaseGeneralDataRegion
Parameters:
key - The key under which to cache the item.
value - The item to cache.
Throws:
CacheException - Indicates a problem accessing the region.

destroy

public void destroy()
             throws CacheException
Description copied from interface: Region
The "end state" contract of the region's lifecycle. Called during SessionFactory.close() to give the region a chance to cleanup.

Specified by:
destroy in interface Region
Overrides:
destroy in class BaseRegion
Throws:
CacheException - Indicates problem shutting down

nodeModified

public void nodeModified(org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent event)
Monitors cache events and updates the local cache

Parameters:
event -

nodeRemoved

public void nodeRemoved(org.infinispan.notifications.cachelistener.event.CacheEntryRemovedEvent event)
Monitors cache events and updates the local cache

Parameters:
event -

handleEvictAllModification

protected boolean handleEvictAllModification(org.infinispan.notifications.cachelistener.event.CacheEntryModifiedEvent event)
Overrides:
handleEvictAllModification in class BaseRegion

handleEvictAllInvalidation

protected boolean handleEvictAllInvalidation(org.infinispan.notifications.cachelistener.event.CacheEntryInvalidatedEvent event)
Overrides:
handleEvictAllInvalidation in class BaseRegion


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.