Class CompositeLock
java.lang.Object
org.junit.platform.engine.support.hierarchical.CompositeLock
- All Implemented Interfaces:
AutoCloseable, ResourceLock
- Since:
- 1.3
-
Field Details
-
resources
-
locks
-
exclusive
private final boolean exclusive
-
-
Constructor Details
-
CompositeLock
CompositeLock(List<ExclusiveResource> resources, List<Lock> locks)
-
-
Method Details
-
getResources
Description copied from interface:ResourceLockReturns the exclusive resources this lock represents.- Specified by:
getResourcesin interfaceResourceLock- Returns:
- the exclusive resources this lock represents
-
getLocks
-
acquire
Description copied from interface:ResourceLockAcquire this resource lock, potentially blocking.- Specified by:
acquirein interfaceResourceLock- Returns:
- this lock so it can easily be used in a try-with-resources statement.
- Throws:
InterruptedException- if the calling thread is interrupted while waiting to acquire this lock
-
acquireAllLocks
- Throws:
InterruptedException
-
release
public void release()Description copied from interface:ResourceLockRelease this resource lock.- Specified by:
releasein interfaceResourceLock
-
release
-
isExclusive
public boolean isExclusive()Description copied from interface:ResourceLockReturns whether this lock requires exclusiveness.- Specified by:
isExclusivein interfaceResourceLock- Returns:
- whether this lock requires exclusiveness
-
toString
-