com.atlassian.bamboo.plan
Interface PlanExecutionLockService

All Known Implementing Classes:
PlanExecutionLockServiceImpl

public interface PlanExecutionLockService

Locking manager for PlanExecutionManager


Method Summary
<V> V
inlineProcessLocks(TriggerableInternalKey lockKey, AcquisitionPolicy acquisitionPolicy, java.util.concurrent.Callable<V> callable)
          A parallel locking mechanism that allows a backdoor to the standard lock.
 void interruptLockOwner(TriggerableInternalKey lockKey)
          Interrupts the owner of the lock represented by TriggerableInternalKey
 boolean isLocked(TriggerableInternalKey lockKey)
          Checks if the given String has been locked
<V> V
lock(TriggerableInternalKey lockKey, AcquisitionPolicy acquisitionPolicy, java.util.concurrent.Callable<V> callable)
          Acquires a lock on the given TriggerableInternalKey then calls the given Callable within the global request lock
<V> V
runWhenNoExecutionRequestsAreBeingMade(java.util.concurrent.Callable<V> callable)
          Executes the given Callable when there are no requests being made to execute plans
 

Method Detail

runWhenNoExecutionRequestsAreBeingMade

<V> V runWhenNoExecutionRequestsAreBeingMade(@NotNull
                                             java.util.concurrent.Callable<V> callable)
                                         throws java.lang.Exception
Executes the given Callable when there are no requests being made to execute plans

Type Parameters:
V - callable result type
Parameters:
callable - to execute
Returns:
callable result
Throws:
java.lang.Exception - if error

isLocked

boolean isLocked(@NotNull
                 TriggerableInternalKey lockKey)
Checks if the given String has been locked

Parameters:
lockKey - to check
Returns:
locked state

lock

<V> V lock(@NotNull
           TriggerableInternalKey lockKey,
           @NotNull
           AcquisitionPolicy acquisitionPolicy,
           @NotNull
           java.util.concurrent.Callable<V> callable)
       throws java.lang.Exception
Acquires a lock on the given TriggerableInternalKey then calls the given Callable within the global request lock

Type Parameters:
V - callable result type
Parameters:
lockKey - to lock
acquisitionPolicy - to acquire the lock
callable - to execute
Returns:
callable result
Throws:
java.lang.Exception - if error

inlineProcessLocks

<V> V inlineProcessLocks(@NotNull
                         TriggerableInternalKey lockKey,
                         @NotNull
                         AcquisitionPolicy acquisitionPolicy,
                         @NotNull
                         java.util.concurrent.Callable<V> callable)
                     throws java.lang.Exception
A 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 in isLocked(TriggerableInternalKey) and interruptLockOwner(TriggerableInternalKey)

Type Parameters:
V -
Parameters:
lockKey -
acquisitionPolicy -
callable -
Returns:
Throws:
java.lang.Exception

interruptLockOwner

void interruptLockOwner(@NotNull
                        TriggerableInternalKey lockKey)
Interrupts the owner of the lock represented by TriggerableInternalKey

Parameters:
lockKey -
Since:
3.3.3


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.