com.atlassian.bamboo.plan
Class NonBlockingPlanExecutionServiceImpl

java.lang.Object
  extended by com.atlassian.bamboo.plan.NonBlockingPlanExecutionServiceImpl
All Implemented Interfaces:
NonBlockingPlanExecutionService

public class NonBlockingPlanExecutionServiceImpl
extends Object
implements NonBlockingPlanExecutionService


Constructor Summary
NonBlockingPlanExecutionServiceImpl(PlanExecutionManager planExecutionManager)
           
 
Method Summary
 void enqueueTrigger(Triggerable triggerable, Long triggerId, BuildDetectionAction buildDetectionAction)
          Submits a background task to run PlanExecutionManager.start(com.atlassian.bamboo.plan.cache.ImmutableChain, com.atlassian.bamboo.build.BuildDetectionAction, com.atlassian.bamboo.util.AcquisitionPolicy).
 ExecutorStats getExecutorStats()
          Stats for the underlying ThreadPoolExecutor
 Future<Boolean> shutdown()
          Stop accepting any more trigger requests.
 Future<ExecutionRequestResult> tryToStart(Triggerable triggerable, BuildDetectionAction buildDetectionAction)
          Submits a background task to run PlanExecutionManager.start(com.atlassian.bamboo.plan.cache.ImmutableChain, com.atlassian.bamboo.build.BuildDetectionAction, com.atlassian.bamboo.util.AcquisitionPolicy).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NonBlockingPlanExecutionServiceImpl

public NonBlockingPlanExecutionServiceImpl(PlanExecutionManager planExecutionManager)
Method Detail

enqueueTrigger

public void enqueueTrigger(@NotNull
                           Triggerable triggerable,
                           @NotNull
                           Long triggerId,
                           @NotNull
                           BuildDetectionAction buildDetectionAction)
Description copied from interface: NonBlockingPlanExecutionService
Submits a background task to run PlanExecutionManager.start(com.atlassian.bamboo.plan.cache.ImmutableChain, com.atlassian.bamboo.build.BuildDetectionAction, com.atlassian.bamboo.util.AcquisitionPolicy). Only one AcquisitionPolicy.IMMEDIATE per planKey + triggerId combination will be queued at any point in time. The task are not guaranteed to be run, they might get dropped if NonBlockingPlanExecutionService.tryToStart(Triggerable, BuildDetectionAction) is called. Rationale is: conditional triggers won't start anyway if there's a 'guaranteed' build run. To be used with automatic triggers: any auto Trigger can have Trigger Conditions defined

Specified by:
enqueueTrigger in interface NonBlockingPlanExecutionService

tryToStart

@Nullable
public Future<ExecutionRequestResult> tryToStart(@NotNull
                                                          Triggerable triggerable,
                                                          @NotNull
                                                          BuildDetectionAction buildDetectionAction)
Description copied from interface: NonBlockingPlanExecutionService
Submits a background task to run PlanExecutionManager.start(com.atlassian.bamboo.plan.cache.ImmutableChain, com.atlassian.bamboo.build.BuildDetectionAction, com.atlassian.bamboo.util.AcquisitionPolicy). The task uses AcquisitionPolicy.WAIT. To be used for triggers that are 'unconditional'. In other words, the method should be used for cases where build absolutely, positively needs to trigger (unless encountering internal error or hitting concurrent build limit)

Specified by:
tryToStart in interface NonBlockingPlanExecutionService
Returns:

shutdown

public Future<Boolean> shutdown()
Description copied from interface: NonBlockingPlanExecutionService
Stop accepting any more trigger requests.

Specified by:
shutdown in interface NonBlockingPlanExecutionService

getExecutorStats

@NotNull
public ExecutorStats getExecutorStats()
Description copied from interface: NonBlockingPlanExecutionService
Stats for the underlying ThreadPoolExecutor

Specified by:
getExecutorStats in interface NonBlockingPlanExecutionService
Returns:


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.