org.objectweb.perseus.concurrency.lib
Class RWLockValue

java.lang.Object
  extended byorg.objectweb.perseus.concurrency.lib.RWLockValue
All Implemented Interfaces:
LockValue

public class RWLockValue
extends java.lang.Object
implements LockValue

Simple lock value comparator. Possible values are: - nolock (compatible w/ any lock level) - read (compatible w/ nolocks and other reads) - upgrade (compatible only w/ nolocks) - write (compatible only w/ nolocks) From a compatibility point of view upgrade lock requests are equivalent to exclusive lock request. However, distinguishing the two can be convenient in the treatement of requests (two upgrades on the same object automatically leads to a deadlock)


Field Summary
static byte READ
           
static byte UPGRADE
           
static byte WRITE
           
 
Fields inherited from interface org.objectweb.perseus.concurrency.lib.LockValue
NOLOCK, UNDEFINED
 
Constructor Summary
RWLockValue()
           
 
Method Summary
 byte getCompatibleWith(byte l1, byte l2)
           
 boolean isCompatibleWith(byte l1, byte l2)
           
 byte maxValue()
           
 java.lang.String str(byte l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

READ

public static final byte READ
See Also:
Constant Field Values

UPGRADE

public static final byte UPGRADE
See Also:
Constant Field Values

WRITE

public static final byte WRITE
See Also:
Constant Field Values
Constructor Detail

RWLockValue

public RWLockValue()
Method Detail

maxValue

public byte maxValue()
Specified by:
maxValue in interface LockValue

isCompatibleWith

public boolean isCompatibleWith(byte l1,
                                byte l2)
Specified by:
isCompatibleWith in interface LockValue

getCompatibleWith

public byte getCompatibleWith(byte l1,
                              byte l2)
Specified by:
getCompatibleWith in interface LockValue

str

public java.lang.String str(byte l)
Specified by:
str in interface LockValue


Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.