Package jetbrains.buildServer.serverSide
Interface MultiNodeLocks
-
- All Known Implementing Classes:
MultiNodeLocksDbImpl
public interface MultiNodeLocks
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
MultiNodeLocks.Lock
static interface
MultiNodeLocks.LockInfo
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MultiNodeLocks.LockInfo
fetchLockInfo(String lockType, long lockId)
Retrieves information about a lock with given type and id if the lock is currently taken by some node, otherwise returns null.MultiNodeLocks.Lock
tryLock(String lockType, long lockId)
Tries to take a lock of given type and with the given id.MultiNodeLocks.Lock
tryLock(String lockType, long lockId, long timeoutMillis)
MultiNodeLocks.Lock
tryLock(String lockType, long lockId, String additionalArg, long timeoutMillis)
-
-
-
Method Detail
-
tryLock
MultiNodeLocks.Lock tryLock(@NotNull String lockType, long lockId) throws InterruptedException
Tries to take a lock of given type and with the given id. Returns lock instance if attempt was successful, or null if the lock with the given type/id pair is already taken.- Parameters:
lockType
-lockId
-- Returns:
- see above
- Throws:
InterruptedException
-
tryLock
MultiNodeLocks.Lock tryLock(@NotNull String lockType, long lockId, long timeoutMillis) throws InterruptedException
- Throws:
InterruptedException
-
tryLock
MultiNodeLocks.Lock tryLock(@NotNull String lockType, long lockId, @Nullable String additionalArg, long timeoutMillis) throws InterruptedException
- Throws:
InterruptedException
-
fetchLockInfo
@Nullable MultiNodeLocks.LockInfo fetchLockInfo(@NotNull String lockType, long lockId)
Retrieves information about a lock with given type and id if the lock is currently taken by some node, otherwise returns null.- Parameters:
lockType
-lockId
-- Returns:
- see above
-
-