concurrency
Class LockMode

java.lang.Object
  extended byconcurrency.LockMode

public class LockMode
extends java.lang.Object

This class represents the locking modes (share or exclusive).


Field Summary
static byte EXCLUSIVE
          The byte representation of exclusive mode.
static LockMode EXCLUSIVE_MODE
          The exclusive mode.
static byte SHARE
          The byte representation of share mode.
static LockMode SHARE_MODE
          The share mode.
 
Constructor Summary
LockMode()
          Constructa a new locking mode (share mode);
LockMode(byte lockMode)
          Constructs a new locking mode with a specified value.
LockMode(LockMode lockMode)
          Constructs a new locking mode as a copy of other.
 
Method Summary
 byte getMode()
          Returns the byte representation of the locking mode.
 boolean isCompatible(LockMode mode)
          Checks if this lock is compatible with oter.
 boolean isExclusive()
          Checks if the mode is exclusive.
 boolean isShare()
          Checks if the mode is share.
 void setExclusive()
          Changes the mode to exclusive.
 void setMode(byte lockMode)
          Changes the mode.
 void setMorePowerful(byte lockMode)
          Try to change the mode preserving the greater (exclusive is greater than share).
 void setMorePowerful(LockMode lockMode)
          Try to change the mode preserving the greater (exclusive is greater than share).
 void setShare()
          Changes the mode to share.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXCLUSIVE

public static final byte EXCLUSIVE
The byte representation of exclusive mode.

See Also:
Constant Field Values

SHARE

public static final byte SHARE
The byte representation of share mode.

See Also:
Constant Field Values

EXCLUSIVE_MODE

public static final LockMode EXCLUSIVE_MODE
The exclusive mode.


SHARE_MODE

public static final LockMode SHARE_MODE
The share mode.

Constructor Detail

LockMode

public LockMode(byte lockMode)
Constructs a new locking mode with a specified value.


LockMode

public LockMode(LockMode lockMode)
Constructs a new locking mode as a copy of other.


LockMode

public LockMode()
Constructa a new locking mode (share mode);

Method Detail

getMode

public byte getMode()
Returns the byte representation of the locking mode.


isExclusive

public boolean isExclusive()
Checks if the mode is exclusive.


isShare

public boolean isShare()
Checks if the mode is share.


setMode

public void setMode(byte lockMode)
Changes the mode.


setMorePowerful

public void setMorePowerful(byte lockMode)
Try to change the mode preserving the greater (exclusive is greater than share).


setMorePowerful

public void setMorePowerful(LockMode lockMode)
Try to change the mode preserving the greater (exclusive is greater than share).


setExclusive

public void setExclusive()
Changes the mode to exclusive.


setShare

public void setShare()
Changes the mode to share.


isCompatible

public boolean isCompatible(LockMode mode)
Checks if this lock is compatible with oter.


toString

public java.lang.String toString()