public abstract class BaseRegion extends Object implements Region
Regions. Handles common "utility" methods for an underlying named
Cache. In other words, this implementation doesn't actually read or write data. Subclasses are
expected to provide core cache interaction appropriate to the semantics needed.| Modifier and Type | Field and Description |
|---|---|
protected org.infinispan.AdvancedCache |
cache |
| Constructor and Description |
|---|
BaseRegion(org.infinispan.AdvancedCache cache,
String name,
RegionFactory factory)
Base region constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkValid()
Checks if the region is valid for operations such as storing new data
in the region, or retrieving data from the region.
|
boolean |
contains(Object key)
Determine whether this region contains data for the given key.
|
void |
destroy()
The "end state" contract of the region's lifecycle.
|
org.infinispan.AdvancedCache |
getCache() |
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 |
getName()
Retrieve the name of this region.
|
long |
getSizeInMemory()
The number of bytes is this cache region currently consuming in memory.
|
int |
getTimeout()
Get a timeout value.
|
TransactionManager |
getTransactionManager() |
void |
invalidateRegion()
Invalidates the region.
|
boolean |
isRegionInvalidatedInCurrentTx() |
boolean |
isTransactionAware() |
protected boolean |
isValid() |
long |
nextTimestamp()
Get the next timestamp according to the underlying cache implementor.
|
void |
resume(Transaction tx)
Tell the TransactionManager to resume the given transaction
|
Transaction |
suspend()
Tell the TransactionManager to suspend any ongoing transaction.
|
Map |
toMap()
Get the contents of this region as a map.
|
public BaseRegion(org.infinispan.AdvancedCache cache,
String name,
RegionFactory factory)
cache - instance for the regionname - of the regionfactory - for this regionpublic String getName()
Regionpublic long getElementCountInMemory()
RegiongetElementCountInMemory in interface Regionpublic long getElementCountOnDisk()
getElementCountOnDisk in interface Regionpublic long getSizeInMemory()
getSizeInMemory in interface Regionpublic int getTimeout()
RegiongetTimeout in interface Regionpublic long nextTimestamp()
RegionnextTimestamp in interface Regionpublic Map toMap()
Regionpublic void destroy()
throws CacheException
RegionSessionFactory.close() to give
the region a chance to cleanup.destroy in interface RegionCacheException - Indicates problem shutting downpublic boolean contains(Object key)
Regionpublic boolean checkValid()
protected boolean isValid()
public Transaction suspend()
null if
there wasn't onepublic void resume(Transaction tx)
tx - the transaction to suspend. May be null.public void invalidateRegion()
public TransactionManager getTransactionManager()
public boolean isTransactionAware()
public org.infinispan.AdvancedCache getCache()
public boolean isRegionInvalidatedInCurrentTx()
Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.