Package com.atlassian.bamboo.build
Class DefaultBuildExecutionManager
java.lang.Object
com.atlassian.bamboo.build.DefaultBuildExecutionManager
- All Implemented Interfaces:
BuildExecutionManager
This class is registered as event listener
postConstruct()-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddetachBuildFromAgent(long agentId) Detaches runnin build (if any) from an agent that was assigned to it.voidexecute(@NotNull BuildContext buildContext) Executes the givenBuildContextAt this point aBuildResultsSummaryexists that matches the givenBuildContextvoidfinishBuild(@NotNull PlanResultKey planResultKey, boolean updateFollowingBuilds) Calls removeCurrentlyBuilding and finishProcessvoidfinishBuildWithCleanState(@NotNull PlanResultKey planResultKey, @NotNull BuildContext buildContext) Calls removeCurrentlyBuilding and finishProcess.@Nullable CurrentlyBuildinggetBuildRunningOnAgent(@NotNull Long buildAgentId) @NotNull List<CurrentlyBuilding>getCurrentlyBuilding(@NotNull Key key) @Nullable CurrentlyBuildinggetCurrentlyBuildingByBuildResult(@NotNull BuildIdentifier buildIdentifier) ReturnsCurrentlyBuildinginstance for build identifier (orBuildContext).@Nullable CurrentlyBuildinggetCurrentlyBuildingByPlanResultKey(@NotNull ResultKey resultKey) ReturnsCurrentlyBuildinginstance for build identified by buildResultKey.@NotNull Iterable<CurrentlyBuilding>Retrieves a all builds being executed (i.e not just queued).getCurrentlyExecuting(PlanKey planKey) voidvoidvoidvoid@Nullable CurrentlyBuildingremoveCurrentlyBuilding(@NotNull ResultKey resultKey) voidsetAgentManager(AgentManager agentManager) voidsetAuthorCreatorService(AuthorCreatorService authorCreatorService) voidsetBuildLoggerManager(BuildLoggerManager buildLoggerManager) voidsetCachedPlanManager(CachedPlanManager cachedPlanManager) voidsetCurrentlyBuilding(@NotNull BuildContext buildContext, @NotNull Collection<BuildAgent> executableAgents, @NotNull Collection<ElasticImageConfiguration> executableImages) Denotes that the passed build context is beginning the build process.voidsetEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) voidsetPlanStatePersisterService(PlanStatePersisterService planStatePersisterService) voidsetResultsSummaryManager(ResultsSummaryManager resultsSummaryManager)
-
Constructor Details
-
DefaultBuildExecutionManager
public DefaultBuildExecutionManager(org.quartz.Scheduler scheduler)
-
-
Method Details
-
execute
Description copied from interface:BuildExecutionManagerExecutes the givenBuildContextAt this point aBuildResultsSummaryexists that matches the givenBuildContext- Specified by:
executein interfaceBuildExecutionManager
-
getCurrentlyExecuting
Description copied from interface:BuildExecutionManagerRetrieves a all builds being executed (i.e not just queued).- Specified by:
getCurrentlyExecutingin interfaceBuildExecutionManager- Returns:
-
getCurrentlyExecuting
- Specified by:
getCurrentlyExecutingin interfaceBuildExecutionManager
-
getCurrentlyBuilding
- Specified by:
getCurrentlyBuildingin interfaceBuildExecutionManager
-
getCurrentlyBuildingByPlanResultKey
@Nullable public @Nullable CurrentlyBuilding getCurrentlyBuildingByPlanResultKey(@NotNull @NotNull ResultKey resultKey) Description copied from interface:BuildExecutionManagerReturnsCurrentlyBuildinginstance for build identified by buildResultKey. Should be used only ifBuildIdentifieris not available - basically in actions- Specified by:
getCurrentlyBuildingByPlanResultKeyin interfaceBuildExecutionManager- Returns:
-
getCurrentlyBuildingByBuildResult
@Nullable public @Nullable CurrentlyBuilding getCurrentlyBuildingByBuildResult(@NotNull @NotNull BuildIdentifier buildIdentifier) Description copied from interface:BuildExecutionManagerReturnsCurrentlyBuildinginstance for build identifier (orBuildContext).- Specified by:
getCurrentlyBuildingByBuildResultin interfaceBuildExecutionManager- Returns:
-
setCurrentlyBuilding
public void setCurrentlyBuilding(@NotNull @NotNull BuildContext buildContext, @NotNull @NotNull Collection<BuildAgent> executableAgents, @NotNull @NotNull Collection<ElasticImageConfiguration> executableImages) Denotes that the passed build context is beginning the build process. (i.e. it's being queued). Executable build agent lists are considered to be up to date if this method is used.- Specified by:
setCurrentlyBuildingin interfaceBuildExecutionManager- Parameters:
buildContext-executableAgents- - a list of agents on which this build can be run.executableImages- - a list of images on which the build can be run.
-
getBuildRunningOnAgent
@Nullable public @Nullable CurrentlyBuilding getBuildRunningOnAgent(@NotNull @NotNull Long buildAgentId) - Specified by:
getBuildRunningOnAgentin interfaceBuildExecutionManager
-
detachBuildFromAgent
public void detachBuildFromAgent(long agentId) Description copied from interface:BuildExecutionManagerDetaches runnin build (if any) from an agent that was assigned to it. Makes it possible for orphaned build monitor to clean it up. On the other hand, if the build result is returned within grace period it can still be accepted.- Specified by:
detachBuildFromAgentin interfaceBuildExecutionManager
-
finishBuildWithCleanState
public void finishBuildWithCleanState(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull BuildContext buildContext) Description copied from interface:BuildExecutionManagerCalls removeCurrentlyBuilding and finishProcess. This method assumes that result's life cycle state has been updated correctly. If in doubt use#finishBuild(PlanResultKey)instead.- Specified by:
finishBuildWithCleanStatein interfaceBuildExecutionManager- Parameters:
planResultKey- identifies plan result
-
finishBuild
public void finishBuild(@NotNull @NotNull PlanResultKey planResultKey, boolean updateFollowingBuilds) Description copied from interface:BuildExecutionManagerCalls removeCurrentlyBuilding and finishProcess- Specified by:
finishBuildin interfaceBuildExecutionManager- Parameters:
planResultKey- identifies plan result
-
removeCurrentlyBuilding
@Nullable public @Nullable CurrentlyBuilding removeCurrentlyBuilding(@NotNull @NotNull ResultKey resultKey) - Specified by:
removeCurrentlyBuildingin interfaceBuildExecutionManager
-
onQueuedTimingPoint
-
onSentToAgentTimingPoint
-
onExecutionCancelledTimingPoint
@EventListener public void onExecutionCancelledTimingPoint(@NotNull BuildTimingPoints.ExecutionCancelled event) -
onExecutionFinishedTimingPoint
@EventListener public void onExecutionFinishedTimingPoint(@NotNull BuildTimingPoints.ExecutionFinished event) -
setEventPublisher
public void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher) -
setResultsSummaryManager
-
setBuildLoggerManager
-
setAuthorCreatorService
-
setPlanStatePersisterService
-
setAgentManager
-
setCachedPlanManager
-