| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.cache.lock.LockMap
public class LockMap
Provide lock ownership mapping.
| Field Summary | |
|---|---|
| static int | OWNER_ANY | 
| static int | OWNER_READ | 
| static int | OWNER_WRITE | 
| Constructor Summary | |
|---|---|
| LockMap() | |
| LockMap(Collection<Object> readOwners)This constructor is made available for testing with different collection types for the readOwners collection. | |
| Method Summary | |
|---|---|
|  void | addReader(Object owner)Adding a reader owner. | 
|  boolean | isOwner(Object caller,
        int ownership)Check whether this owner has reader or writer ownership. | 
|  boolean | isReadLocked() | 
|  String | printInfo()Debugging information. | 
|  Collection<Object> | readerOwners()Returns an unmodifiable set of reader owner objects. | 
|  void | releaseReaderOwners(LockStrategy lock) | 
|  void | removeAll()Remove all ownership. | 
|  void | removeReader(Object owner)Remove reader ownership. | 
|  void | removeWriter()Remove writer ownership. | 
|  void | setWriterIfNotNull(Object owner)Adding a writer owner. | 
|  boolean | upgrade(Object owner)Upgrading current reader ownership to writer one. | 
|  Object | writerOwner() | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final int OWNER_ANY
public static final int OWNER_READ
public static final int OWNER_WRITE
| Constructor Detail | 
|---|
public LockMap()
public LockMap(Collection<Object> readOwners)
readOwners - | Method Detail | 
|---|
public boolean isOwner(Object caller,
                       int ownership)
caller - the potential owner.  Cannot be null.ownership - Either OWNER_ANY, OWNER_READ,
                  or OWNER_WRITE.
NullPointerException - if caller is null.public void addReader(Object owner)
owner - public void setWriterIfNotNull(Object owner)
owner - 
public boolean upgrade(Object owner)
                throws OwnerNotExistedException
owner - 
OwnerNotExistedExceptionpublic Collection<Object> readerOwners()
public void releaseReaderOwners(LockStrategy lock)
public Object writerOwner()
public void removeReader(Object owner)
public void removeWriter()
public void removeAll()
public String printInfo()
public boolean isReadLocked()
| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||