Interface ResourceLock
-
- All Superinterfaces:
AutoCloseable
@API(status=EXPERIMENTAL, since="1.3") public interface ResourceLock extends AutoCloseable
A lock for a one or more resources.- Since:
- 1.3
- See Also:
HierarchicalTestExecutorService.TestTask.getResourceLock()
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ResourceLockacquire()Acquire this resource lock, potentially blocking.default voidclose()voidrelease()Release this resource lock.
-
-
-
Method Detail
-
acquire
ResourceLock acquire() throws InterruptedException
Acquire this resource lock, potentially blocking.- Returns:
- this lock so it can easily be used in a try-with-resources statement.
- Throws:
InterruptedException- when the calling thread is interrupted while waiting to acquire this lock.
-
release
void release()
Release this resource lock.
-
close
default void close()
- Specified by:
closein interfaceAutoCloseable
-
-