KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > lockmanager > api > LockEventListener


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.objectserver.lockmanager.api;
5
6 /**
7  * Listener interface for lock events.
8  */

9 public interface LockEventListener {
10
11   // NOTE: There are more lock events (upgrades, wait/notify, etc.) that could be added if need be
12

13   /**
14    * Notification that there is a new pending request for the lock indicated in the given lock award context.
15    *
16    * @param waiterCount The number of pending requests currently waiting for the lock-- including the one just added.
17    * @param ctxt The award context of the current holder -- NOT the waiter.
18    */

19   public void notifyAddPending(int waiterCount, LockAwardContext ctxt);
20
21   /**
22    * Notification that a lock was awarded in the given award context.
23    *
24    * @param waiterCount The number of waiters currently waiting for the lock after the award.
25    * @param ctxt The award context of this lock award event.
26    */

27   public void notifyAward(int waiterCount, LockAwardContext ctxt);
28
29   /**
30    * Notification that a lock has been revoked in the given lock award context.
31    *
32    * @param ctxt The award context that is being revoked. This should be the holder prior to revocation.
33    */

34   public void notifyRevoke(LockAwardContext ctxt);
35 }
Popular Tags