Class LockCloseable
- java.lang.Object
-
- com.epam.reportportal.utils.concurrency.LockCloseable
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class LockCloseable extends java.lang.Object implements java.lang.AutoCloseableAutoCloseable wrapper for Lock that enables try-with-resources usage.
-
-
Constructor Summary
Constructors Constructor Description LockCloseable(java.util.concurrent.locks.Lock lock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()LockCloseablelock()Locks the underlying lock and returns this instance for use in try-with-resources.
-
-
-
Method Detail
-
lock
public LockCloseable lock()
Locks the underlying lock and returns this instance for use in try-with-resources.- Returns:
- this LockCloseable instance
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable
-
-