public abstract class BaseRegion extends java.lang.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 AddressAdapter |
address |
protected CacheAdapter |
cacheAdapter |
protected java.util.concurrent.atomic.AtomicReference<org.hibernate.cache.infinispan.impl.BaseRegion.InvalidateState> |
invalidateState |
protected java.lang.Object |
invalidationMutex |
protected boolean |
replication |
protected javax.transaction.TransactionManager |
transactionManager |
| Constructor and Description |
|---|
BaseRegion(CacheAdapter cacheAdapter,
java.lang.String name,
javax.transaction.TransactionManager transactionManager,
RegionFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkValid() |
boolean |
contains(java.lang.Object key)
Determine whether this region contains data for the given key.
|
void |
destroy()
The "end state" contract of the region's lifecycle.
|
protected java.lang.Object |
get(java.lang.Object key,
boolean suppressTimeout,
FlagAdapter... flagAdapters)
Performs a Infinispan
get(Fqn, Object) |
AddressAdapter |
getAddress() |
CacheAdapter |
getCacheAdapter() |
long |
getElementCountInMemory()
The count of entries currently contained in the regions in-memory store.
|
long |
getElementCountOnDisk()
Not supported.
|
java.lang.String |
getName()
Retrieve the name of this region.
|
java.lang.Object |
getOwnerForPut() |
long |
getSizeInMemory()
Not supported.
|
int |
getTimeout() |
javax.transaction.TransactionManager |
getTransactionManager() |
void |
invalidateRegion() |
protected boolean |
isValid() |
long |
nextTimestamp() |
void |
resume(javax.transaction.Transaction tx)
Tell the TransactionManager to resume the given transaction
|
javax.transaction.Transaction |
suspend()
Tell the TransactionManager to suspend any ongoing transaction.
|
java.util.Map |
toMap()
Get the contents of this region as a map.
|
protected final CacheAdapter cacheAdapter
protected final AddressAdapter address
protected final javax.transaction.TransactionManager transactionManager
protected final boolean replication
protected final java.lang.Object invalidationMutex
protected final java.util.concurrent.atomic.AtomicReference<org.hibernate.cache.infinispan.impl.BaseRegion.InvalidateState> invalidateState
public BaseRegion(CacheAdapter cacheAdapter, java.lang.String name, javax.transaction.TransactionManager transactionManager, RegionFactory factory)
public java.lang.String getName()
Regionpublic CacheAdapter getCacheAdapter()
public long getElementCountInMemory()
RegiongetElementCountInMemory in interface Regionpublic long getElementCountOnDisk()
getElementCountOnDisk in interface Regionpublic long getSizeInMemory()
getSizeInMemory in interface Regionpublic int getTimeout()
getTimeout in interface Regionpublic long nextTimestamp()
nextTimestamp in interface Regionpublic java.util.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(java.lang.Object key)
Regionpublic AddressAdapter getAddress()
public boolean checkValid()
protected boolean isValid()
protected java.lang.Object get(java.lang.Object key,
boolean suppressTimeout,
FlagAdapter... flagAdapters)
throws CacheException
get(Fqn, Object)key - The key of the item to getsuppressTimeout - should any TimeoutException be suppressed?flagAdapters - flags to add to the get invocationCacheException - issue managing transaction or talking to cachepublic java.lang.Object getOwnerForPut()
public javax.transaction.Transaction suspend()
null if
there wasn't onepublic void resume(javax.transaction.Transaction tx)
tx - the transaction to suspend. May be null.public void invalidateRegion()
public javax.transaction.TransactionManager getTransactionManager()
Copyright © 2001-2013 Red Hat, Inc. All Rights Reserved.