Package com.atlassian.bamboo.plan
Interface PlanExecutionLockService
-
- All Known Implementing Classes:
PlanExecutionLockServiceImpl
@Internal public interface PlanExecutionLockServiceLocking manager forPlanExecutionManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <V> VinlineProcessLocks(@NotNull TriggerableInternalKey lockKey, @NotNull AcquisitionPolicy acquisitionPolicy, @NotNull Callable<V> callable)A parallel locking mechanism that allows a backdoor to the standard lock.voidinterruptLockOwner(@NotNull TriggerableInternalKey lockKey)Interrupts the owner of the lock represented byTriggerableInternalKeybooleanisLocked(@NotNull TriggerableInternalKey lockKey)Checks if the givenStringhas been locked<V> Vlock(@NotNull TriggerableInternalKey lockKey, @NotNull AcquisitionPolicy acquisitionPolicy, @NotNull Callable<V> callable)Acquires a lock on the givenTriggerableInternalKeythen calls the givenCallablewithin the global request lock<V> VrunWhenNoExecutionRequestsAreBeingMade(@NotNull Callable<V> callable)Executes the givenCallablewhen there are no requests being made to execute plans
-
-
-
Method Detail
-
runWhenNoExecutionRequestsAreBeingMade
<V> V runWhenNoExecutionRequestsAreBeingMade(@NotNull @NotNull Callable<V> callable) throws ExceptionExecutes the givenCallablewhen there are no requests being made to execute plans- Type Parameters:
V- callable result type- Parameters:
callable- to execute- Returns:
- callable result
- Throws:
Exception- if error
-
isLocked
boolean isLocked(@NotNull @NotNull TriggerableInternalKey lockKey)Checks if the givenStringhas been locked- Parameters:
lockKey- to check- Returns:
- locked state
-
lock
<V> V lock(@NotNull @NotNull TriggerableInternalKey lockKey, @NotNull @NotNull AcquisitionPolicy acquisitionPolicy, @NotNull @NotNull Callable<V> callable) throws ExceptionAcquires a lock on the givenTriggerableInternalKeythen calls the givenCallablewithin the global request lock- Type Parameters:
V- callable result type- Parameters:
lockKey- to lockacquisitionPolicy- to acquire the lockcallable- to execute- Returns:
- callable result
- Throws:
Exception- if error
-
inlineProcessLocks
<V> V inlineProcessLocks(@NotNull @NotNull TriggerableInternalKey lockKey, @NotNull @NotNull AcquisitionPolicy acquisitionPolicy, @NotNull @NotNull Callable<V> callable) throws ExceptionA parallel locking mechanism that allows a backdoor to the standard lock. This should only be used for short lived locking (whereas the standard lock might be used for change detection). This is by convention only, so take care. This lock will participate inisLocked(TriggerableInternalKey)andinterruptLockOwner(TriggerableInternalKey)- Type Parameters:
V-- Parameters:
lockKey-acquisitionPolicy-callable-- Returns:
- Throws:
Exception
-
interruptLockOwner
void interruptLockOwner(@NotNull @NotNull TriggerableInternalKey lockKey)Interrupts the owner of the lock represented byTriggerableInternalKey- Parameters:
lockKey-- Since:
- 3.3.3
-
-