|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.plan.PlanExecutionLockServiceImpl
public class PlanExecutionLockServiceImpl
Constructor Summary | |
---|---|
PlanExecutionLockServiceImpl()
|
Method Summary | ||
---|---|---|
void |
interruptLockOwner(PlanKey planKey)
Interrupts the owner of the lock represented by PlanKey |
|
boolean |
isLocked(PlanKey planKey)
Checks if the given PlanKey has been locked |
|
|
lock(PlanKey planKey,
AcquisitionPolicy acquisitionPolicy,
java.util.concurrent.Callable<V> callable)
Quick note about the implementation Since the acquisition policy AcquisitionPolicy.WAIT can block for an indefinite amount of time
we acquire this lock before trying to take the global execution lock otherwise callers to runWhenNoExecutionRequestsAreBeingMade(Callable)
in the worst case will wait indefinitely. |
|
|
runWhenNoExecutionRequestsAreBeingMade(java.util.concurrent.Callable<V> callable)
Executes the given Callable when there are no requests being made to execute plans |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PlanExecutionLockServiceImpl()
Method Detail |
---|
public <V> V runWhenNoExecutionRequestsAreBeingMade(@NotNull java.util.concurrent.Callable<V> callable) throws java.lang.Exception
PlanExecutionLockService
Callable
when there are no requests being made to execute plans
runWhenNoExecutionRequestsAreBeingMade
in interface PlanExecutionLockService
V
- callable result typecallable
- to execute
java.lang.Exception
- if errorpublic boolean isLocked(@NotNull PlanKey planKey)
PlanExecutionLockService
PlanKey
has been locked
isLocked
in interface PlanExecutionLockService
planKey
- to check
public <V> V lock(@NotNull PlanKey planKey, @NotNull AcquisitionPolicy acquisitionPolicy, @NotNull java.util.concurrent.Callable<V> callable) throws java.lang.Exception
AcquisitionPolicy.WAIT
can block for an indefinite amount of time
we acquire this lock before trying to take the global execution lock otherwise callers to runWhenNoExecutionRequestsAreBeingMade(Callable)
in the worst case will wait indefinitely.
lock
in interface PlanExecutionLockService
V
- callable result typeplanKey
- to lockacquisitionPolicy
- to acquire the lockcallable
- to execute
java.lang.Exception
- if errorpublic void interruptLockOwner(@NotNull PlanKey planKey)
PlanExecutionLockService
PlanKey
interruptLockOwner
in interface PlanExecutionLockService
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |