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

    Modifier and Type Method Description
    ResourceLock acquire()
    Acquire this resource lock, potentially blocking.
    default void close()  
    void release()
    Release this resource lock.
  • Method Details

    • acquire

      Acquire this resource lock, potentially blocking.
      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
    • release

      void release()
      Release this resource lock.
    • close

      default void close()
      Specified by:
      close in interface AutoCloseable