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.ProcessInfo
getCurrentProcess()
void
release(MaintenanceProcessKind processKind)
Releases the lock for the specified maintenance process kindboolean
tryCapture(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:MaintenanceLock
Tries 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:
tryCapture
in 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:MaintenanceLock
Releases the lock for the specified maintenance process kind- Specified by:
release
in interfaceMaintenanceLock
- Parameters:
processKind
- a kind of a maintenance process whose lock should be released
-
getCurrentProcess
@Nullable public MaintenanceLock.ProcessInfo getCurrentProcess()
- Specified by:
getCurrentProcess
in interfaceMaintenanceLock
- Returns:
- information about the currently running maintenance process
-
-