Package jadex.common
Class RwAutoLock
java.lang.Object
jadex.common.RwAutoLock
Class wrapping a read-write lock mechanism that can be used
with try-with-resources.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IAutoLock
The resource read unlock.protected ReadWriteLock
The internal lock.protected IAutoLock
The resource write unlock. -
Constructor Summary
ConstructorsConstructorDescriptionCreates the auto-lock.RwAutoLock
(ReadWriteLock lock) Creates the auto-lock. -
Method Summary
-
Field Details
-
rwlock
The internal lock. -
readunlock
The resource read unlock. -
writeunlock
The resource write unlock.
-
-
Constructor Details
-
RwAutoLock
public RwAutoLock()Creates the auto-lock. -
RwAutoLock
Creates the auto-lock.- Parameters:
lock
- Specific RW-lock to use internally.
-
-
Method Details
-
readLock
Locks the read lock for resource-based locking. -
writeLock
Locks the write lock for resource-based locking. -
getReadLock
Gets the read lock for manual locking. -
getWriteLock
Gets the write lock for manual locking. -
getLock
Gets the internal lock.- Returns:
- The lock.
-