org.objectweb.perseus.concurrency.lib

Class RWLockValue

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

Method Summary

byte
getCompatibleWith(byte l1, byte l2)
boolean
isCompatibleWith(byte l1, byte l2)
byte
maxValue()
String
str(byte l)

Field Details

READ

public static final byte READ

Field Value:
1


UPGRADE

public static final byte UPGRADE

Field Value:
2


WRITE

public static final byte WRITE

Field Value:
3

Method Details

getCompatibleWith

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


isCompatibleWith

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


maxValue

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


str

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


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