|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.buffer.MultiLock
public final class MultiLock
Acquires and releases a set of ReadWriteLock
as a unit. Ensures that locks are always taken in a consistent order to avoid lock ordering deadlocks.
Method Summary | |
---|---|
static MultiLock |
get(java.util.Collection<ReadWriteLock> read, java.util.Collection<ReadWriteLock> write) Get a lock instance which obtains a mixture of read and write locks. |
static MultiLock |
getCopyLock(ReadWriteLock src, ReadWriteLock dest) Get an instance suitable for copying from a source to a destination. |
static MultiLock |
getReadLock(ReadWriteLock... locks) Get an instance which obtains read locks. |
static MultiLock |
getWriteLock(ReadWriteLock... locks) Get an instance which obtains write locks. |
void |
lock() Acquire the locks. |
void |
lockInterruptibly() Acquire the locks unless the calling thread is interrupted. |
boolean |
tryLock() Acquires the lock if it is possible to do so without blocking. |
void |
unlock() Release the locks. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static MultiLock getReadLock(ReadWriteLock... locks)
locks
- the locks to be locked for readingpublic static MultiLock getWriteLock(ReadWriteLock... locks)
locks
- the locks to be locked for writingpublic static MultiLock getCopyLock(ReadWriteLock src, ReadWriteLock dest)
src
- the source lockdest
- the destination lockpublic static MultiLock get(java.util.Collection<ReadWriteLock> read, java.util.Collection<ReadWriteLock> write)
read
- the locks to be locked for readingwrite
- the locks to be locked for writingpublic void lock()
public void lockInterruptibly() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the calling thread is interruptedpublic boolean tryLock()
true
if the lock was acquired, false
otherwisepublic void unlock()
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK 11g Release 2 (11.1.2.2.0) E17493-03 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |