1 7 package org.jboss.cache.lock; 8 9 import java.util.concurrent.locks.Lock ; 10 11 21 public class LockStrategyRepeatableRead implements LockStrategy 22 { 23 private ReadWriteLockWithUpgrade lock_; 25 public LockStrategyRepeatableRead() 26 { 27 lock_ = new ReadWriteLockWithUpgrade(); 28 } 29 30 33 public Lock readLock() 34 { 35 return lock_.readLock(); 36 } 37 38 41 public Lock upgradeLockAttempt(long msecs) throws UpgradeException 42 { 43 return lock_.upgradeLockAttempt(msecs); 44 } 45 46 49 public Lock writeLock() 50 { 51 return lock_.writeLock(); 52 } 53 54 55 public String toString() 56 { 57 return lock_ != null? lock_.toString() : null; 58 } 59 } 60 | Popular Tags |