1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.mybatis.caches.memcached;
17
18 import java.util.concurrent.TimeUnit;
19 import java.util.concurrent.locks.Condition;
20 import java.util.concurrent.locks.Lock;
21 import java.util.concurrent.locks.ReadWriteLock;
22
23
24
25
26 class DummyReadWriteLock implements ReadWriteLock {
27
28 private Lock lock = new DummyLock();
29
30 @Override
31 public Lock readLock() {
32 return lock;
33 }
34
35 @Override
36 public Lock writeLock() {
37 return lock;
38 }
39
40 static class DummyLock implements Lock {
41
42 @Override
43 public void lock() {
44
45 }
46
47 @Override
48 public void lockInterruptibly() throws InterruptedException {
49
50 }
51
52 @Override
53 public boolean tryLock() {
54 return true;
55 }
56
57 @Override
58 public boolean tryLock(long paramLong, TimeUnit paramTimeUnit) throws InterruptedException {
59 return true;
60 }
61
62 @Override
63 public void unlock() {
64
65 }
66
67 @Override
68 public Condition newCondition() {
69 return null;
70 }
71 }
72
73 }