org.ozoneDB.core
Class MROWLock
java.lang.Object
|
+--org.ozoneDB.core.AbstractLock
|
+--org.ozoneDB.core.MROWLock
- All Implemented Interfaces:
- Lock, java.io.Serializable
- public final class MROWLock
- extends AbstractLock
This class implements a Multiple Reader One Writer lock policy.
- Version:
- $Revision: 1.2 $Date: 2002/06/08 00:49:38 $
- Author:
- SMB
, Medium.net
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
serialVersionUID
protected static final long serialVersionUID
- See Also:
- Constant Field Values
subSerialVersionUID
protected static final byte subSerialVersionUID
- See Also:
- Constant Field Values
enableReleaseOfReadlockOnFailedWritelock
protected static final boolean enableReleaseOfReadlockOnFailedWritelock
- See Also:
- Constant Field Values
level
private int level
readLock
private SharedLock readLock
writeLock
private ExclusiveLock writeLock
clusterID
protected transient ClusterID clusterID
MROWLock
public MROWLock()
reset
public void reset()
setClusterID
public void setClusterID(ClusterID to)
tryAcquire
public int tryAcquire(Transaction ta,
int newLevel)
- Description copied from interface:
Lock
- Try to aquire this lock. This method returns the previous level of the
specified transaction, if the lock was sucessfully acquired. Otherwise
it returns NOT_ACQUIRED.
- Returns:
- The previous level for the given transaction or NOT_ACQUIRED.
acquire
protected boolean acquire(Transaction ta,
int newLevel)
release
public void release(Transaction ta)
- Description copied from interface:
Lock
- Release the previously aquired lock.
isAcquiredBy
public boolean isAcquiredBy(Transaction ta)
lockerIDs
public DxCollection lockerIDs()
- Description copied from interface:
Lock
- Return all transactions that currently hold this lock.
level
public int level(Transaction ta)
- Description copied from interface:
Lock
- Returns the lock level for the specified transaction. If ta is null,
then we do not check ta against the transaction that has acquired this
lock.
- Parameters:
ta
- The transaction that has acquired the lock or null.
- Returns:
- Lock level for ta if ta has aquired the lock or ta is null. LEVEL_NONE
otherwise.
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright (C) The Ozone Database Project - www.ozone-db.org. All rights reserved.