KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > cache > lock > NullLock


1 package org.jboss.cache.lock;
2
3 import java.util.Date JavaDoc;
4 import java.util.concurrent.TimeUnit JavaDoc;
5 import java.util.concurrent.locks.Condition JavaDoc;
6 import java.util.concurrent.locks.Lock JavaDoc;
7
8 class NullLock implements Lock JavaDoc, Condition JavaDoc {
9
10    public void lock()
11    {
12    }
13
14    public void lockInterruptibly() throws InterruptedException JavaDoc
15    {
16    }
17
18    public Condition JavaDoc newCondition()
19    {
20       return this;
21    }
22
23    public boolean tryLock()
24    {
25       return true;
26    }
27
28    public boolean tryLock(long arg0, TimeUnit JavaDoc arg1) throws InterruptedException JavaDoc
29    {
30       return true;
31    }
32
33    public void unlock()
34    {
35    }
36
37    public void await() throws InterruptedException JavaDoc
38    {
39    }
40
41    public boolean await(long arg0, TimeUnit JavaDoc arg1) throws InterruptedException JavaDoc
42    {
43       return true;
44    }
45
46    public long awaitNanos(long arg0) throws InterruptedException JavaDoc
47    {
48       return arg0;
49    }
50
51    public void awaitUninterruptibly()
52    {
53    }
54
55    public boolean awaitUntil(Date JavaDoc arg0) throws InterruptedException JavaDoc
56    {
57       return true;
58    }
59
60    public void signal()
61    {
62    }
63
64    public void signalAll()
65    {
66    }
67 }
68
Popular Tags