|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.types.LockManager
@PublicAPI(stability=UNCOMMITTED, mayInstantiate=false, mayExtend=false, mayInvoke=true) public final class LockManager
This class defines a Directory Server component that can keep track of all locks needed throughout the Directory Server. It is intended primarily for entry locking but support for other types of objects might be added in the future.
Field Summary | |
---|---|
static int |
DEFAULT_CONCURRENCY_LEVEL
The default concurrency level to use for the lock table. |
static boolean |
DEFAULT_FAIR_ORDERING
The default setting for the use of fair ordering locks. |
static int |
DEFAULT_INITIAL_TABLE_SIZE
The default initial size to use for the lock table. |
static float |
DEFAULT_LOAD_FACTOR
The default load factor to use for the lock table. |
static long |
DEFAULT_TIMEOUT
The default length of time in milliseconds to wait while attempting to acquire a read or write lock. |
Constructor Summary | |
---|---|
LockManager()
|
Method Summary | |
---|---|
static java.util.concurrent.locks.ReentrantReadWriteLock |
destroyLock(DN entryDN)
Removes any reference to the specified entry from the lock table. |
static java.util.concurrent.locks.Lock |
lockRead(DN entryDN)
Attempts to acquire a read lock for the specified entry. |
static java.util.concurrent.locks.Lock |
lockRead(DN entryDN,
long timeout)
Attempts to acquire a read lock for the specified entry. |
static int |
lockTableSize()
Retrieves the number of entries currently held in the lock table. |
static java.util.concurrent.locks.Lock |
lockWrite(DN entryDN)
Attempts to acquire the write lock for the specified entry. |
static java.util.concurrent.locks.Lock |
lockWrite(DN entryDN,
long timeout)
Attempts to acquire the write lock for the specified entry. |
static void |
reinitializeLockTable()
Recreates the lock table. |
static java.util.concurrent.locks.Lock |
tryLockRead(DN entryDN)
Attempts to acquire a read lock on the specified entry. |
static java.util.concurrent.locks.Lock |
tryLockWrite(DN entryDN)
Attempts to acquire a write lock on the specified entry. |
static void |
unlock(DN entryDN,
java.util.concurrent.locks.Lock lock)
Releases a read or write lock held on the specified entry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean DEFAULT_FAIR_ORDERING
public static final int DEFAULT_INITIAL_TABLE_SIZE
public static final int DEFAULT_CONCURRENCY_LEVEL
public static final float DEFAULT_LOAD_FACTOR
public static final long DEFAULT_TIMEOUT
Constructor Detail |
---|
public LockManager()
Method Detail |
---|
public static void reinitializeLockTable()
public static java.util.concurrent.locks.Lock tryLockRead(DN entryDN)
entryDN
- The DN of the entry for which to obtain the read
lock.
null
if it
was not possible to obtain a read lock for some reason.public static java.util.concurrent.locks.Lock lockRead(DN entryDN)
entryDN
- The DN of the entry for which to obtain the read
lock.
null
if it
was not possible to obtain a read lock for some reason.public static java.util.concurrent.locks.Lock lockRead(DN entryDN, long timeout)
entryDN
- The DN of the entry for which to obtain the read
lock.timeout
- The maximum length of time in milliseconds to
wait for the lock before timing out.
null
if
it was not possible to obtain a read lock for some
reason.public static java.util.concurrent.locks.Lock tryLockWrite(DN entryDN)
entryDN
- The DN of the entry for which to obtain the
write lock.
null
if it was not possible to obtain a write lock for some
reason.public static java.util.concurrent.locks.Lock lockWrite(DN entryDN)
entryDN
- The DN of the entry for which to obtain the
write lock.
null
if it was not possible to obtain a write lock for some
reason.public static java.util.concurrent.locks.Lock lockWrite(DN entryDN, long timeout)
entryDN
- The DN of the entry for which to obtain the
write lock.timeout
- The maximum length of time in milliseconds to
wait for the lock before timing out.
null
if it was not possible to obtain a read lock for some
reason.public static void unlock(DN entryDN, java.util.concurrent.locks.Lock lock)
entryDN
- The DN of the entry for which to release the
lock.lock
- The read or write lock held for the entry.public static java.util.concurrent.locks.ReentrantReadWriteLock destroyLock(DN entryDN)
entryDN
- The DN of the entry for which to remove the lock
from the table.
null
if nothing was in the table for the
specified entry. If a lock object is returned, it may
be possible to get information about who was holding it.public static int lockTableSize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |