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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
detachBuildFromAgent
(long agentId) Detaches runnin build (if any) from an agent that was assigned to it.void
execute
(@NotNull BuildContext buildContext) Executes the givenBuildContext
At this point aBuildResultsSummary
exists that matches the givenBuildContext
void
finishBuild
(@NotNull PlanResultKey planResultKey, boolean updateFollowingBuilds) Calls removeCurrentlyBuilding and finishProcessvoid
finishBuildWithCleanState
(@NotNull PlanResultKey planResultKey, @NotNull BuildContext buildContext) Calls removeCurrentlyBuilding and finishProcess.@Nullable CurrentlyBuilding
getBuildRunningOnAgent
(@NotNull Long buildAgentId) @NotNull List<CurrentlyBuilding>
getCurrentlyBuilding
(@NotNull Key key) @Nullable CurrentlyBuilding
getCurrentlyBuildingByBuildResult
(@NotNull BuildIdentifier buildIdentifier) ReturnsCurrentlyBuilding
instance for build identifier (orBuildContext
).@Nullable CurrentlyBuilding
getCurrentlyBuildingByPlanResultKey
(@NotNull ResultKey resultKey) ReturnsCurrentlyBuilding
instance for build identified by buildResultKey.@NotNull Iterable<CurrentlyBuilding>
Retrieves a all builds being executed (i.e not just queued).getCurrentlyExecuting
(PlanKey planKey) void
void
void
void
@Nullable CurrentlyBuilding
removeCurrentlyBuilding
(@NotNull ResultKey resultKey) void
setAgentManager
(AgentManager agentManager) void
setAuthorCreatorService
(AuthorCreatorService authorCreatorService) void
setBuildLoggerManager
(BuildLoggerManager buildLoggerManager) void
setCachedPlanManager
(CachedPlanManager cachedPlanManager) void
setCurrentlyBuilding
(@NotNull BuildContext buildContext, @NotNull Collection<BuildAgent> executableAgents, @NotNull Collection<ElasticImageConfiguration> executableImages) Denotes that the passed build context is beginning the build process.void
setEventPublisher
(com.atlassian.event.api.EventPublisher eventPublisher) void
setPlanStatePersisterService
(PlanStatePersisterService planStatePersisterService) void
setResultsSummaryManager
(ResultsSummaryManager resultsSummaryManager)
-
Constructor Details
-
DefaultBuildExecutionManager
public DefaultBuildExecutionManager(org.quartz.Scheduler scheduler)
-
-
Method Details
-
execute
Description copied from interface:BuildExecutionManager
Executes the givenBuildContext
At this point aBuildResultsSummary
exists that matches the givenBuildContext
- Specified by:
execute
in interfaceBuildExecutionManager
-
getCurrentlyExecuting
Description copied from interface:BuildExecutionManager
Retrieves a all builds being executed (i.e not just queued).- Specified by:
getCurrentlyExecuting
in interfaceBuildExecutionManager
- Returns:
-
getCurrentlyExecuting
- Specified by:
getCurrentlyExecuting
in interfaceBuildExecutionManager
-
getCurrentlyBuilding
- Specified by:
getCurrentlyBuilding
in interfaceBuildExecutionManager
-
getCurrentlyBuildingByPlanResultKey
@Nullable public @Nullable CurrentlyBuilding getCurrentlyBuildingByPlanResultKey(@NotNull @NotNull ResultKey resultKey) Description copied from interface:BuildExecutionManager
ReturnsCurrentlyBuilding
instance for build identified by buildResultKey. Should be used only ifBuildIdentifier
is not available - basically in actions- Specified by:
getCurrentlyBuildingByPlanResultKey
in interfaceBuildExecutionManager
- Returns:
-
getCurrentlyBuildingByBuildResult
@Nullable public @Nullable CurrentlyBuilding getCurrentlyBuildingByBuildResult(@NotNull @NotNull BuildIdentifier buildIdentifier) Description copied from interface:BuildExecutionManager
ReturnsCurrentlyBuilding
instance for build identifier (orBuildContext
).- Specified by:
getCurrentlyBuildingByBuildResult
in 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:
setCurrentlyBuilding
in 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:
getBuildRunningOnAgent
in interfaceBuildExecutionManager
-
detachBuildFromAgent
public void detachBuildFromAgent(long agentId) Description copied from interface:BuildExecutionManager
Detaches 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:
detachBuildFromAgent
in interfaceBuildExecutionManager
-
finishBuildWithCleanState
public void finishBuildWithCleanState(@NotNull @NotNull PlanResultKey planResultKey, @NotNull @NotNull BuildContext buildContext) Description copied from interface:BuildExecutionManager
Calls 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:
finishBuildWithCleanState
in interfaceBuildExecutionManager
- Parameters:
planResultKey
- identifies plan result
-
finishBuild
public void finishBuild(@NotNull @NotNull PlanResultKey planResultKey, boolean updateFollowingBuilds) Description copied from interface:BuildExecutionManager
Calls removeCurrentlyBuilding and finishProcess- Specified by:
finishBuild
in interfaceBuildExecutionManager
- Parameters:
planResultKey
- identifies plan result
-
removeCurrentlyBuilding
@Nullable public @Nullable CurrentlyBuilding removeCurrentlyBuilding(@NotNull @NotNull ResultKey resultKey) - Specified by:
removeCurrentlyBuilding
in 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
-