Class ServerMaintenanceLock
- java.lang.Object
-
- jetbrains.buildServer.serverSide.maintenance.ServerMaintenanceLock
-
- All Implemented Interfaces:
MaintenanceLock
public class ServerMaintenanceLock extends Object implements MaintenanceLock
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jetbrains.buildServer.serverSide.maintenance.MaintenanceLock
MaintenanceLock.ProcessInfo
-
-
Constructor Summary
Constructors Constructor Description ServerMaintenanceLock(MultiNodeLocks multiNodeLocks)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MaintenanceLock.ProcessInfogetCurrentProcess()voidrelease(MaintenanceProcessKind processKind)Releases the lock for the specified maintenance process kindbooleantryCapture(MaintenanceProcessKind processKind, long timeoutMillis)Tries to capture an exclusive lock for the specified maintenance process kind.
-
-
-
Constructor Detail
-
ServerMaintenanceLock
public ServerMaintenanceLock(@NotNull MultiNodeLocks multiNodeLocks)
-
-
Method Detail
-
tryCapture
public boolean tryCapture(@NotNull MaintenanceProcessKind processKind, long timeoutMillis)Description copied from interface:MaintenanceLockTries to capture an exclusive lock for the specified maintenance process kind. If lock is taken by some other maintenance process, then this method repeats attempts untile the specified timeout happens- Specified by:
tryCapturein interfaceMaintenanceLock- Parameters:
processKind- a kind of the maintenance processtimeoutMillis- repeats attempts to capture the lock until the timeout happens- Returns:
- true if the lock was captured and false otherwise
-
release
public void release(@NotNull MaintenanceProcessKind processKind)Description copied from interface:MaintenanceLockReleases the lock for the specified maintenance process kind- Specified by:
releasein interfaceMaintenanceLock- Parameters:
processKind- a kind of a maintenance process whose lock should be released
-
getCurrentProcess
@Nullable public MaintenanceLock.ProcessInfo getCurrentProcess()
- Specified by:
getCurrentProcessin interfaceMaintenanceLock- Returns:
- information about the currently running maintenance process
-
-