01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.objectserver.lockmanager.api;
05:
06: import com.tc.async.api.Sink;
07: import com.tc.net.groups.NodeID;
08: import com.tc.object.lockmanager.api.LockID;
09: import com.tc.object.lockmanager.api.ThreadID;
10: import com.tc.object.tx.WaitInvocation;
11:
12: import java.util.Collection;
13: import java.util.Set;
14:
15: /**
16: * The Lock Manager interface implemented at the L2
17: */
18: public interface LockManager {
19:
20: public void enableClientStat(LockID lockID, Sink sink,
21: int stackTraceDepth, int statCollectFrequency);
22:
23: public void disableClientStat(LockID lockID,
24: Set statEnabledClients, Sink sink);
25:
26: public void notify(LockID lid, NodeID cid, ThreadID tid,
27: boolean all, NotifiedWaiters addNotifiedWaitersTo);
28:
29: public void wait(LockID lid, NodeID cid, ThreadID tid,
30: WaitInvocation waitInvocation, Sink lockResponseSink);
31:
32: public void reestablishLock(LockID lid, NodeID cid, ThreadID tid,
33: int level, Sink lockResponseSink);
34:
35: public void reestablishWait(LockID lid, NodeID cid, ThreadID tid,
36: int level, WaitInvocation waitInvocation,
37: Sink lockResponseSink);
38:
39: public boolean requestLock(LockID lockID, NodeID cid,
40: ThreadID source, int level, Sink awardLockSink);
41:
42: public boolean tryRequestLock(LockID lockID, NodeID cid,
43: ThreadID threadID, int level, WaitInvocation timeout,
44: Sink awardLockSink);
45:
46: public void unlock(LockID id, NodeID receiverID, ThreadID threadID);
47:
48: public void queryLock(LockID lockID, NodeID cid, ThreadID threadID,
49: Sink lockResponseSink);
50:
51: public void interrupt(LockID lockID, NodeID cid, ThreadID threadID);
52:
53: public boolean hasPending(LockID id);
54:
55: public void clearAllLocksFor(NodeID cid);
56:
57: public void scanForDeadlocks(DeadlockResults output);
58:
59: public void start();
60:
61: public void stop() throws InterruptedException;
62:
63: public void recallCommit(LockID lid, NodeID cid,
64: Collection lockContexts, Collection waitContexts,
65: Collection pendingLockContexts,
66: Collection pendingTryLockContexts, Sink lockResponseSink);
67:
68: public void dump();
69:
70: }
|