Deprecated
This is the Ehcache specific equivalent to Hibernate's ReadWriteCache. This implementation uses a more robust soft-lock system (less prone to accidental collisions).
| Modifier and Type | Class and Description |
|---|---|
| private static class | EhcacheReadWriteCache.Item
Wrapper type representing unlocked items. |
| private static class | EhcacheReadWriteCache.Lock
Wrapper type representing locked items. |
| private static interface | EhcacheReadWriteCache.Lockable
Interface type implemented by all wrapper objects in the cache. |
| Modifier and Type | Field and Description |
|---|---|
| private final ReentrantReadWriteLock. | |
| private final ReentrantReadWriteLock. | |
| private static final Logger | |
| private final AtomicLong | |
| private final UUID |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | afterInsert(Object key, Object value, Object version)
Implements org. |
| public boolean | afterUpdate(Object key, Object value, Object version, SoftLock softlock)
Implements org. |
| private void | |
| public void | evict(Object key)
Implements org. |
| public Object | get(Object key, long
a timestamp prior to the transaction start time txTimestamp)Implements org. |
| private void | |
| public boolean | insert(Object key, Object value, Object currentVersion)
Implements org. |
| public SoftLock | lock(Object key, Object version)
Implements org. |
| private long | |
| public boolean | put(Object key, Object value, long
a timestamp prior to the transaction start time txTimestamp, Object the item version number version, Comparator<T> a comparator used to compare version numbers versionComparator, boolean indicates that the cache should avoid a put is the item is already cached minimalPut)Implements org. |
| private void | |
| private void | |
| public void | release(Object key, SoftLock lock)
Implements org. |
| public boolean | |
| private void | |
| private void |
| coarseReadLock | back to summary |
|---|---|
| private final ReentrantReadWriteLock. | |
| coarseWriteLock | back to summary |
|---|---|
| private final ReentrantReadWriteLock. | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG Hides net. | |
| nextLockId | back to summary |
|---|---|
| private final AtomicLong nextLockId | |
| uuid | back to summary |
|---|---|
| private final UUID uuid | |
| EhcacheReadWriteCache | back to summary |
|---|---|
| public EhcacheReadWriteCache() | |
| afterInsert | back to summary |
|---|---|
| public boolean afterInsert(Object key, Object value, Object version) throws CacheException Implements org. Doc from org. Called after an item has been inserted (after the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies. | |
| afterUpdate | back to summary |
|---|---|
| public boolean afterUpdate(Object key, Object value, Object version, SoftLock softlock) throws CacheException Implements org. Doc from org. Called after an item has been updated (after the transaction completes), instead of calling release(). This method is used by "asynchronous" concurrency strategies. | |
| decrementLock | back to summary |
|---|---|
| private void decrementLock(Object key, EhcacheReadWriteCache. | |
| evict | back to summary |
|---|---|
| public void evict(Object key) throws CacheException Implements org. A No-Op, since we are an asynchronous cache concurrency strategy. | |
| get | back to summary |
|---|---|
| public Object get(Object key, long txTimestamp) throws CacheException Implements org. Doc from org. Attempt to retrieve an object from the cache. Mainly used in attempting to resolve entities/collections from the second level cache.
| |
| handleLockExpiry | back to summary |
|---|---|
| private void handleLockExpiry(Object key) | |
| insert | back to summary |
|---|---|
| public boolean insert(Object key, Object value, Object currentVersion) throws CacheException Implements org. A No-Op, since we are an asynchronous cache concurrency strategy. | |
| lock | back to summary |
|---|---|
| public SoftLock lock(Object key, Object version) throws CacheException Implements org. Soft-locks the associated mapping prior to updating/inserting a new value. | |
| nextLockId | back to summary |
|---|---|
| private long nextLockId() | |
| put | back to summary |
|---|---|
| public boolean put(Object key, Object value, long txTimestamp, Object version, Comparator<T> versionComparator, boolean minimalPut) throws CacheException Implements org. Doc from org. Attempt to cache an object, after loading from the database.
| |
| readLockIfCoarse | back to summary |
|---|---|
| private void readLockIfCoarse(Object key) | |
| readUnlockIfCoarse | back to summary |
|---|---|
| private void readUnlockIfCoarse(Object key) | |
| release | back to summary |
|---|---|
| public void release(Object key, SoftLock lock) throws CacheException Implements org. Soft-unlocks the associated mapping. | |
| update | back to summary |
|---|---|
| public boolean update(Object key, Object value, Object currentVersion, Object previousVersion) throws CacheException Implements org. A No-Op, since we are an asynchronous cache concurrency strategy. | |
| writeLock | back to summary |
|---|---|
| private void writeLock(Object key) | |
| writeUnlock | back to summary |
|---|---|
| private void writeUnlock(Object key) | |
| Modifier and Type | Field and Description |
|---|---|
| private static final long | |
| private final long | |
| private final Object | |
| private final Object |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public boolean | isReadable(long txTimestamp)
Implements net. |
| public boolean | |
| public boolean | isWriteable(long txTimestamp, Object newVersion, Comparator<T> versionComparator)
Implements net. |
| public EhcacheReadWriteCache. | lock(long timeout, UUID uuid, long lockId)
Implements net. |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| timestamp | back to summary |
|---|---|
| private final long timestamp | |
| value | back to summary |
|---|---|
| private final Object value | |
| version | back to summary |
|---|---|
| private final Object version | |
| Item | back to summary |
|---|---|
| private Item(Object value, Object version, long timestamp) | |
| getValue | back to summary |
|---|---|
| public Object getValue() Implements net. | |
| isReadable | back to summary |
|---|---|
| public boolean isReadable(long txTimestamp) Implements net. | |
| isUnlockable | back to summary |
|---|---|
| public boolean isUnlockable(SoftLock lock) Implements net. | |
| isWriteable | back to summary |
|---|---|
| public boolean isWriteable(long txTimestamp, Object newVersion, Comparator<T> versionComparator) Implements net. | |
| lock | back to summary |
|---|---|
| public EhcacheReadWriteCache. Implements net. | |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final long | |
| private int | |
| private static final long | |
| private final UUID | |
| private long | |
| private long | |
| private final Object |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. o)Overrides java. |
| public Object | |
| public int | |
| public boolean | isReadable(long txTimestamp)
Implements net. |
| public boolean | |
| public boolean | isWriteable(long txTimestamp, Object newVersion, Comparator<T> versionComparator)
Implements net. |
| public EhcacheReadWriteCache. | lock(long timeout, UUID uuid, long lockId)
Implements net. |
| private void | |
| private boolean |
| concurrent | back to summary |
|---|---|
| private boolean concurrent | |
| lockId | back to summary |
|---|---|
| private final long lockId | |
| multiplicity | back to summary |
|---|---|
| private int multiplicity | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| sourceUuid | back to summary |
|---|---|
| private final UUID sourceUuid | |
| timeout | back to summary |
|---|---|
| private long timeout | |
| unlockTimestamp | back to summary |
|---|---|
| private long unlockTimestamp | |
| version | back to summary |
|---|---|
| private final Object version | |
| Lock | back to summary |
|---|---|
| pack-priv Lock(long timeout, UUID sourceUuid, long lockId, Object version) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getValue | back to summary |
|---|---|
| public Object getValue() Implements net. | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for the object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isReadable | back to summary |
|---|---|
| public boolean isReadable(long txTimestamp) Implements net. | |
| isUnlockable | back to summary |
|---|---|
| public boolean isUnlockable(SoftLock lock) Implements net. | |
| isWriteable | back to summary |
|---|---|
| public boolean isWriteable(long txTimestamp, Object newVersion, Comparator<T> versionComparator) Implements net. | |
| lock | back to summary |
|---|---|
| public EhcacheReadWriteCache. Implements net. | |
| unlock | back to summary |
|---|---|
| private void unlock(long timestamp) | |
| wasLockedConcurrently | back to summary |
|---|---|
| private boolean wasLockedConcurrently() | |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public boolean | |
| public boolean | |
| public boolean | |
| public EhcacheReadWriteCache. |
| getValue | back to summary |
|---|---|
| public Object getValue() | |
| isReadable | back to summary |
|---|---|
| public boolean isReadable(long txTimestamp) | |
| isUnlockable | back to summary |
|---|---|
| public boolean isUnlockable(SoftLock lock) | |
| isWriteable | back to summary |
|---|---|
| public boolean isWriteable(long txTimestamp, Object version, Comparator<T> versionComparator) | |
| lock | back to summary |
|---|---|
| public EhcacheReadWriteCache. | |