|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jboss.cache.lock.LockMap
Provide lock ownership mapping.
Field Summary | |
static java.lang.Object |
NULL
|
static int |
OWNER_ANY
|
static int |
OWNER_READ
|
static int |
OWNER_WRITE
|
Constructor Summary | |
LockMap()
|
Method Summary | |
void |
addReader(java.lang.Object owner)
Adding a reader owner. |
boolean |
isOwner(java.lang.Object caller,
int ownership)
Check whether this owner has reader or writer ownership. |
boolean |
isReadLocked()
|
java.lang.String |
printInfo()
Debugging information. |
java.util.Set |
readerOwners()
|
void |
removeAll()
Remove all ownership. |
void |
removeReader(java.lang.Object owner)
Remove reader ownership. |
void |
removeWriter()
Remove writer ownership. |
void |
setWriterIfNotNull(java.lang.Object owner)
Adding a writer owner. |
boolean |
upgrade(java.lang.Object owner)
Upgrading current reader ownership to writer one. |
java.lang.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
public static final java.lang.Object NULL
Constructor Detail |
public LockMap()
Method Detail |
public boolean isOwner(java.lang.Object caller, int ownership)
caller
- the potential owner. Cannot be null
.ownership
- Either OWNER_ANY
, OWNER_READ
,
or OWNER_WRITE
.
java.lang.NullPointerException
- if caller
is null
.public void addReader(java.lang.Object owner)
owner
- public void setWriterIfNotNull(java.lang.Object owner)
owner
- public boolean upgrade(java.lang.Object owner) throws OwnerNotExistedException
owner
-
OwnerNotExistedException
public java.util.Set readerOwners()
public java.lang.Object writerOwner()
public void removeReader(java.lang.Object owner)
owner
-
public void removeWriter()
public void removeAll()
public java.lang.String printInfo()
public boolean isReadLocked()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |