org.objectweb.perseus.concurrency.pessimistic
Class MutexLock
java.lang.Object
org.objectweb.perseus.concurrency.pessimistic.Lock
org.objectweb.perseus.concurrency.pessimistic.MutexLock
- public final class MutexLock
- extends Lock
A lock associated to an oid (see the "locks" map within the pessimistic
concurrency manager).
Provides a mutex concurrency policy.
- Author:
- E. Bruneton, P. Dechamboux
Field Summary |
protected java.lang.Object |
writer
The contexts that have a lock for the oid to which this object is
associated. |
Method Summary |
boolean |
close(java.lang.Object ctxt)
Removes the given context from the reader and writer lists of this
lock. |
byte |
getMax()
|
void |
readIntention(java.lang.Object ctxt)
Acquires this lock in read mode for the given context. |
void |
writeIntention(java.lang.Object ctxt)
Acquires this lock in write mode for the given context. |
Methods inherited from class org.objectweb.perseus.concurrency.pessimistic.Lock |
reserve |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
writer
protected java.lang.Object writer
- The contexts that have a lock for the oid to which this object is
associated.
MutexLock
public MutexLock()
MutexLock
public MutexLock(java.lang.Object hints,
DependencyGraph dg)
readIntention
public void readIntention(java.lang.Object ctxt)
throws ConcurrencyException
- Acquires this lock in read mode for the given context. This method
blocks until the lock can be acquired in read mode by this context.
- Specified by:
readIntention
in class Lock
- Parameters:
ctxt
- a context.
- Throws:
ConcurrencyException
writeIntention
public void writeIntention(java.lang.Object ctxt)
throws ConcurrencyException
- Acquires this lock in write mode for the given context. This method
blocks until the lock can be acquired in write mode by this context.
- Specified by:
writeIntention
in class Lock
- Parameters:
ctxt
- a context.
- Throws:
ConcurrencyException
close
public boolean close(java.lang.Object ctxt)
- Removes the given context from the reader and writer lists of this
lock.
- Specified by:
close
in class Lock
- Parameters:
ctxt
- a context
- Returns:
- true if the reader and writer list are empty, after the
context has been removed from these lists. In such a case, this
object can be removed from the 'locks' map.
getMax
public byte getMax()
- Specified by:
getMax
in class Lock
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.