KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sleepycat > je > txn > DummyLockManager


1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2002,2006 Oracle. All rights reserved.
5  *
6  * $Id: DummyLockManager.java,v 1.4 2006/10/30 21:14:27 bostic Exp $
7  */

8
9 package com.sleepycat.je.txn;
10
11 import java.util.Set JavaDoc;
12
13 import com.sleepycat.je.DatabaseException;
14 import com.sleepycat.je.LockStats;
15 import com.sleepycat.je.dbi.DatabaseImpl;
16 import com.sleepycat.je.dbi.EnvironmentImpl;
17 import com.sleepycat.je.dbi.MemoryBudget;
18
19 /**
20  * DummyLockManager performs no locking for DS mode.
21  */

22 public class DummyLockManager extends LockManager {
23
24     public DummyLockManager(EnvironmentImpl envImpl)
25         throws DatabaseException {
26
27         super(envImpl);
28     }
29
30     /**
31      * @see LockManager#attemptLock
32      */

33     protected LockAttemptResult attemptLock(Long JavaDoc nodeId,
34                                             Locker locker,
35                                             LockType type,
36                                             boolean nonBlockingRequest)
37         throws DatabaseException {
38
39     return new LockAttemptResult(null, LockGrantType.NEW, true);
40     }
41         
42     /**
43      * @see LockManager#makeTimeoutMsg
44      */

45     protected String JavaDoc makeTimeoutMsg(String JavaDoc lockOrTxn,
46                                     Locker locker,
47                                     long nodeId,
48                                     LockType type,
49                                     LockGrantType grantType,
50                                     Lock useLock,
51                                     long timeout,
52                                     long start,
53                                     long now,
54                     DatabaseImpl database) {
55
56     return null;
57     }
58
59     /**
60      * @see LockManager#releaseAndNotifyTargets
61      */

62     protected Set JavaDoc releaseAndFindNotifyTargets(long nodeId,
63                                               Lock lock,
64                                               Locker locker,
65                                               boolean removeFromLocker)
66         throws DatabaseException {
67
68     return null;
69     }
70
71     /**
72      * @see LockManager#transfer
73      */

74     void transfer(long nodeId,
75                   Locker owningLocker,
76                   Locker destLocker,
77                   boolean demoteToRead)
78         throws DatabaseException {
79
80     }
81
82     /**
83      * @see LockManager#transferMultiple
84      */

85     void transferMultiple(long nodeId,
86                           Locker owningLocker,
87                           Locker[] destLockers)
88         throws DatabaseException {
89
90     }
91
92     /**
93      * @see LockManager#demote
94      */

95     void demote(long nodeId, Locker locker)
96         throws DatabaseException {
97         
98     }
99
100     /**
101      * @see LockManager#isLocked
102      */

103     boolean isLocked(Long JavaDoc nodeId) {
104
105     return false;
106     }
107
108     /**
109      * @see LockManager#isOwner
110      */

111     boolean isOwner(Long JavaDoc nodeId, Locker locker, LockType type) {
112
113     return false;
114     }
115
116     /**
117      * @see LockManager#isWaiter
118      */

119     boolean isWaiter(Long JavaDoc nodeId, Locker locker) {
120         
121     return false;
122     }
123
124     /**
125      * @see LockManager#nWaiters
126      */

127     int nWaiters(Long JavaDoc nodeId) {
128
129     return 0;
130     }
131
132     /**
133      * @see LockManager#nOwners
134      */

135     int nOwners(Long JavaDoc nodeId) {
136
137     return 0;
138     }
139
140     /**
141      * @see LockManager#getWriterOwnerLocker
142      */

143     Locker getWriteOwnerLocker(Long JavaDoc nodeId)
144         throws DatabaseException {
145
146     return null;
147     }
148
149     /**
150      * @see LockManager#validateOwnership
151      */

152     protected boolean validateOwnership(Long JavaDoc nodeId,
153                                         Locker locker,
154                                         LockType type,
155                                         boolean flushFromWaiters,
156                     MemoryBudget mb)
157         throws DatabaseException {
158
159     return true;
160     }
161
162     /**
163      * @see LockManager#dumpLockTable
164      */

165     protected void dumpLockTable(LockStats stats)
166         throws DatabaseException {
167         
168     }
169 }
170
Popular Tags