public class UUIDLock extends ReentrantLock<java.util.UUID>
ReentrantLock.Lock, ReentrantLock.ReadLock, ReentrantLock.WriteLocklogger, notification, readLock, writeLock| Constructor and Description |
|---|
UUIDLock(boolean exclusive,
java.util.logging.Logger logger)
Creates a new
UUIDLock based on UUID, it uses
Object.equals(Object) and supports (non-exclusive) readers and
(exclusive) writers. |
UUIDLock(java.lang.Class<? extends LockCountManager<java.util.UUID>> lockCountManager,
boolean exclusive,
LockNotification<java.util.UUID> notification,
java.util.logging.Logger logger)
Creates a new
UUIDLock using the designated lock count manager
and the designated exclusive mode. |
UUIDLock(java.lang.Class<? extends LockCountManager<java.util.UUID>> lockCountManager,
boolean exclusive,
java.util.logging.Logger logger)
Creates a new
UUIDLock using the designated lock count manager
and the designated exclusive mode. |
UUIDLock(java.util.logging.Logger logger)
Creates a new
UUIDLock based on UUID,
it uses Object.equals(Object) and it is exclusive. |
isReadLocked, isWriteLocked, readLock, writeLockpublic UUIDLock(java.util.logging.Logger logger)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException
UUIDLock based on UUID,
it uses Object.equals(Object) and it is exclusive.logger - The logger for log messages.java.lang.InstantiationException - Should never happen. If the object equality
lock count manager cannot be instantiated or does not have a
parameterless constructor, an InstantiationException
will be thrown.java.lang.IllegalAccessException - Should never happen. If the object equality
lock count manager class or its constructor is not accessible, an
IllegalAccessException will be thrown.public UUIDLock(boolean exclusive,
java.util.logging.Logger logger)
throws java.lang.InstantiationException,
java.lang.IllegalAccessException
UUIDLock based on UUID, it uses
Object.equals(Object) and supports (non-exclusive) readers and
(exclusive) writers.exclusive - Whether to create an exclusive lock or a read/write-lock.logger - The logger for log messages.java.lang.InstantiationException - Should never happen. If the object equality
lock count manager cannot be instantiated or does not have a
parameterless constructor, an InstantiationException
will be thrown.java.lang.IllegalAccessException - Should never happen. If the object equality
lock count manager class or its constructor is not accessible, an
IllegalAccessException will be thrown.public UUIDLock(java.lang.Class<? extends LockCountManager<java.util.UUID>> lockCountManager, boolean exclusive, java.util.logging.Logger logger) throws java.lang.InstantiationException, java.lang.IllegalAccessException
UUIDLock using the designated lock count manager
and the designated exclusive mode. This constructor is for usage by
ObjectLockManager.lockCountManager - The manager counting locks for UUIDs. The provided
class needs an accessible (public) constructor without parameters.exclusive - Whether to create an exclusive lock or a read/write-lock.logger - The logger for log messages.java.lang.InstantiationException - If the designated lock count manager class
cannot be instantiated or does not have a parameterless
constructor, an InstantiationException will be
thrown.java.lang.IllegalAccessException - If the designated lock count manager class
or its constructor is not accessible, an
IllegalAccessException will be thrown.public UUIDLock(java.lang.Class<? extends LockCountManager<java.util.UUID>> lockCountManager, boolean exclusive, LockNotification<java.util.UUID> notification, java.util.logging.Logger logger) throws java.lang.InstantiationException, java.lang.IllegalAccessException
UUIDLock using the designated lock count manager
and the designated exclusive mode. The designated notification will be used
for notifying a successful lock or unlock while locking and unlocking, that
is, the notification will be atomically with respect to locking/unlocking.
This constructor is for usage by ObjectLockManager.lockCountManager - The manager counting locks for UUIDs. The provided
class needs an accessible (public) constructor without parameters.exclusive - Whether to create an exclusive lock or a read/write-lock.notification - The notification to call directly but atomically after
locking and unlocking. If this is null, no
notification will be sent.logger - The logger for log messages.java.lang.InstantiationException - If the designated lock count manager class
cannot be instantiated or does not have a parameterless
constructor, an InstantiationException will be
thrown.java.lang.IllegalAccessException - If the designated lock count manager class
or its constructor is not accessible, an
IllegalAccessException will be thrown.