001: /*-
002: * See the file LICENSE for redistribution information.
003: *
004: * Copyright (c) 2002,2008 Oracle. All rights reserved.
005: *
006: * $Id: DummyLockManager.java,v 1.4.2.6 2008/01/07 15:14:17 cwl Exp $
007: */
008:
009: package com.sleepycat.je.txn;
010:
011: import java.util.Set;
012:
013: import com.sleepycat.je.DatabaseException;
014: import com.sleepycat.je.DeadlockException;
015: import com.sleepycat.je.LockStats;
016: import com.sleepycat.je.dbi.DatabaseImpl;
017: import com.sleepycat.je.dbi.EnvironmentImpl;
018: import com.sleepycat.je.dbi.MemoryBudget;
019:
020: /**
021: * DummyLockManager performs no locking for DS mode.
022: */
023: public class DummyLockManager extends LockManager {
024:
025: public DummyLockManager(EnvironmentImpl envImpl)
026: throws DatabaseException {
027:
028: super (envImpl);
029: }
030:
031: /**
032: * @see LockManager#lookupLock
033: */
034: protected Lock lookupLock(Long nodeId) throws DatabaseException {
035:
036: return null;
037: }
038:
039: /**
040: * @see LockManager#attemptLock
041: */
042: protected LockAttemptResult attemptLock(Long nodeId, Locker locker,
043: LockType type, boolean nonBlockingRequest)
044: throws DatabaseException {
045:
046: return new LockAttemptResult(null, LockGrantType.NEW, true);
047: }
048:
049: /**
050: * @see LockManager#makeTimeoutMsg
051: */
052: protected DeadlockException makeTimeoutMsg(String lockOrTxn,
053: Locker locker, long nodeId, LockType type,
054: LockGrantType grantType, Lock useLock, long timeout,
055: long start, long now, DatabaseImpl database) {
056:
057: return null;
058: }
059:
060: /**
061: * @see LockManager#releaseAndNotifyTargets
062: */
063: protected Set releaseAndFindNotifyTargets(long nodeId, Locker locker)
064: throws DatabaseException {
065:
066: return null;
067: }
068:
069: /**
070: * @see LockManager#transfer
071: */
072: void transfer(long nodeId, Locker owningLocker, Locker destLocker,
073: boolean demoteToRead) throws DatabaseException {
074:
075: }
076:
077: /**
078: * @see LockManager#transferMultiple
079: */
080: void transferMultiple(long nodeId, Locker owningLocker,
081: Locker[] destLockers) throws DatabaseException {
082:
083: }
084:
085: /**
086: * @see LockManager#demote
087: */
088: void demote(long nodeId, Locker locker) throws DatabaseException {
089:
090: }
091:
092: /**
093: * @see LockManager#isLocked
094: */
095: boolean isLocked(Long nodeId) {
096:
097: return false;
098: }
099:
100: /**
101: * @see LockManager#isOwner
102: */
103: boolean isOwner(Long nodeId, Locker locker, LockType type) {
104:
105: return false;
106: }
107:
108: /**
109: * @see LockManager#isWaiter
110: */
111: boolean isWaiter(Long nodeId, Locker locker) {
112:
113: return false;
114: }
115:
116: /**
117: * @see LockManager#nWaiters
118: */
119: int nWaiters(Long nodeId) {
120:
121: return 0;
122: }
123:
124: /**
125: * @see LockManager#nOwners
126: */
127: int nOwners(Long nodeId) {
128:
129: return 0;
130: }
131:
132: /**
133: * @see LockManager#getWriterOwnerLocker
134: */
135: Locker getWriteOwnerLocker(Long nodeId) throws DatabaseException {
136:
137: return null;
138: }
139:
140: /**
141: * @see LockManager#validateOwnership
142: */
143: protected boolean validateOwnership(Long nodeId, Locker locker,
144: LockType type, boolean flushFromWaiters, MemoryBudget mb)
145: throws DatabaseException {
146:
147: return true;
148: }
149:
150: /**
151: * @see LockManager#dumpLockTable
152: */
153: protected void dumpLockTable(LockStats stats)
154: throws DatabaseException {
155:
156: }
157: }
|