1 package org.jboss.cache.lock; 2 3 import java.util.Set ; 4 5 6 9 public interface NodeLock 10 { 11 12 public enum LockType 13 { 14 NONE, READ, WRITE 15 } 16 17 24 Set getReaderOwners(); 25 26 31 Object getWriterOwner(); 32 33 45 boolean acquireWriteLock(Object caller, long timeout) throws LockingException, TimeoutException, 46 InterruptedException ; 47 48 57 boolean acquireReadLock(Object caller, long timeout) throws LockingException, TimeoutException, InterruptedException ; 58 59 64 void release(Object caller); 65 66 69 void releaseAll(); 70 71 74 void releaseAll(Object owner); 75 76 79 boolean isReadLocked(); 80 81 84 boolean isWriteLocked(); 85 86 89 boolean isLocked(); 90 91 94 boolean isOwner(Object o); 95 96 boolean acquire(Object caller, long timeout, NodeLock.LockType lock_type) throws LockingException, TimeoutException, 97 InterruptedException ; 98 99 Set acquireAll(Object caller, long timeout, NodeLock.LockType lock_type) throws LockingException, TimeoutException, 100 InterruptedException ; 101 102 void printLockInfo(StringBuffer sb, int indent); 103 104 } | Popular Tags |