ehcache / ehcache3

Ehcache 3.x line
http://www.ehcache.org
Apache License 2.0
2.01k stars 579 forks source link

Migration- Ehcache 2 to Ehcache 3.x #3135

Closed MaheshGowda26 closed 1 year ago

MaheshGowda26 commented 1 year ago

Hi Team, could you please help me with below code that migration to ehcahe3

Ehcache2 code. public void acquireReadLockOnKey(Object key) { this.acquireLockOnKey(key, LockType.READ); }

public void acquireWriteLockOnKey(Object key) { this.acquireLockOnKey(key, LockType.WRITE); }

TIA

public boolean tryReadLockOnKey(Object key, long timeout) throws InterruptedException { Sync s = getLockForKey(key); return s.tryLock(LockType.READ, timeout); }

public boolean tryWriteLockOnKey(Object key, long timeout) throws InterruptedException { Sync s = getLockForKey(key); return s.tryLock(LockType.WRITE, timeout); }

public void releaseReadLockOnKey(Object key) { releaseLockOnKey(key, LockType.READ); }

public void releaseWriteLockOnKey(Object key) { releaseLockOnKey(key, LockType.WRITE); }

boolean isReadLockedByCurrentThread(Object key);

boolean isWriteLockedByCurrentThread(Object key);

chrisdennis commented 1 year ago

There are no directly corresponding methods. In order to know how to migrate this code I would need to know what these methods are being used to accomplish at a higher level.