Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
public interface EntityRegionAccessStrategy
insert(Object,Object,Object)
-> afterInsert(Object,Object,Object)
lockItem(Object,Object)
-> update(Object,Object,Object,Object)
-> afterUpdate(Object,Object,Object,Object,SoftLock)
lockItem(Object,Object)
-> remove(Object)
-> unlockItem(Object,SoftLock)
lockRegion()
-> removeAll()
-> unlockRegion(SoftLock)
Method Summary | |
boolean |
|
boolean |
|
void |
|
void |
|
Object |
|
EntityRegion |
|
boolean |
|
SoftLock |
|
SoftLock |
|
boolean |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
boolean |
|
public boolean afterInsert(Object key, Object value, Object version) throws CacheException
Called after an item has been inserted (after the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.
- Parameters:
key
- The item keyvalue
- The itemversion
- The item's version value
- Returns:
- Were the contents of the cache actual changed by this operation?
- Throws:
CacheException
- Propogated from underlyingRegion
public boolean afterUpdate(Object key, Object value, Object currentVersion, Object previousVersion, SoftLock lock) throws CacheException
Called after an item has been updated (after the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies.
- Parameters:
key
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version valuelock
- The lock previously obtained fromlockItem(Object,Object)
- Returns:
- Were the contents of the cache actual changed by this operation?
- Throws:
CacheException
- Propogated from underlyingRegion
public void evict(Object key) throws CacheException
Forcibly evict an item from the cache immediately without regard for transaction isolation.
- Parameters:
key
- The key of the item to remove
- Throws:
CacheException
- Propogated from underlyingRegion
public void evictAll() throws CacheException
Forcibly evict all items from the cache immediately without regard for transaction isolation.
- Throws:
CacheException
- Propogated from underlyingRegion
public Object get(Object key, long txTimestamp) throws CacheException
Attempt to retrieve an object from the cache. Mainly used in attempting to resolve entities/collections from the second level cache.
- Parameters:
key
- The key of the item to be retrieved.txTimestamp
- a timestamp prior to the transaction start time
- Returns:
- the cached object or null
- Throws:
CacheException
- Propogated from underlyingRegion
public EntityRegion getRegion()
Get the wrapped entity cache region
- Returns:
- The underlying region
public boolean insert(Object key, Object value, Object version) throws CacheException
Called after an item has been inserted (before the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.
- Parameters:
key
- The item keyvalue
- The itemversion
- The item's version value
- Returns:
- Were the contents of the cache actual changed by this operation?
- Throws:
CacheException
- Propogated from underlyingRegion
public SoftLock lockItem(Object key, Object version) throws CacheException
We are going to attempt to update/delete the keyed object. This method is used by "asynchronous" concurrency strategies. The returned object must be passed back to release(), to release the lock. Concurrency strategies which do not support client-visible locks may silently return null.
- Parameters:
key
- The key of the item to lockversion
- The item's current version value
- Returns:
- A representation of our lock on the item; or null.
- Throws:
CacheException
- Propogated from underlyingRegion
public SoftLock lockRegion() throws CacheException
Lock the entire region
- Returns:
- A representation of our lock on the item; or null.
- Throws:
CacheException
- Propogated from underlyingRegion
public boolean putFromLoad(Object key, Object value, long txTimestamp, Object version) throws CacheException
Attempt to cache an object, after loading from the database.
- Parameters:
key
- The item keyvalue
- The itemtxTimestamp
- a timestamp prior to the transaction start timeversion
- the item version number
- Returns:
- true if the object was successfully cached
- Throws:
CacheException
- Propogated from underlyingRegion
public boolean putFromLoad(Object key, Object value, long txTimestamp, Object version, boolean minimalPutOverride) throws CacheException
Attempt to cache an object, after loading from the database, explicitly specifying the minimalPut behavior.
- Parameters:
key
- The item keyvalue
- The itemtxTimestamp
- a timestamp prior to the transaction start timeversion
- the item version numberminimalPutOverride
- Explicit minimalPut flag
- Returns:
- true if the object was successfully cached
- Throws:
CacheException
- Propogated from underlyingRegion
public void remove(Object key) throws CacheException
Called after an item has become stale (before the transaction completes). This method is used by "synchronous" concurrency strategies.
- Parameters:
key
- The key of the item to remove
- Throws:
CacheException
- Propogated from underlyingRegion
public void removeAll() throws CacheException
Called to evict data from the entire region
- Throws:
CacheException
- Propogated from underlyingRegion
public void unlockItem(Object key, SoftLock lock) throws CacheException
Called when we have finished the attempted update/delete (which may or may not have been successful), after transaction completion. This method is used by "asynchronous" concurrency strategies.
- Parameters:
key
- The item keylock
- The lock previously obtained fromlockItem(Object,Object)
- Throws:
CacheException
- Propogated from underlyingRegion
public void unlockRegion(SoftLock lock) throws CacheException
Called after we have finished the attempted invalidation of the entire region
- Parameters:
lock
- The lock previously obtained fromlockRegion()
- Throws:
CacheException
- Propogated from underlyingRegion
public boolean update(Object key, Object value, Object currentVersion, Object previousVersion) throws CacheException
Called after an item has been updated (before the transaction completes), instead of calling evict(). This method is used by "synchronous" concurrency strategies.
- Parameters:
key
- The item keyvalue
- The itemcurrentVersion
- The item's current version valuepreviousVersion
- The item's previous version value
- Returns:
- Were the contents of the cache actual changed by this operation?
- Throws:
CacheException
- Propogated from underlyingRegion