public class ChainExecutionManagerImpl extends Object implements ChainExecutionManager
postConstruct()
Constructor and Description |
---|
ChainExecutionManagerImpl(PlanStatePersisterService planStatePersisterService,
JobExecutionManager buildContextExecutor,
ChainStateFactory chainStateFactory,
BuildContextFactory buildContextFactory,
com.atlassian.event.api.EventPublisher eventPublisher,
ChainPluginSupport chainPluginSupport,
ErrorUpdateHandler errorUpdateHandler,
AuthorCreatorService authorCreatorService,
ResultsSummaryManager resultsSummaryManager,
BuildDirectoryManager buildDirectoryManager,
VcsBranchIntegrationHelper branchIntegrationHelper,
CustomVariableContext customVariableContext,
PlanExecutionLockService planExecutionLockService,
PlanVcsRevisionHistoryService planVcsRevisionHistoryService,
XStreamFactory xStreamFactory,
CachedPlanManager cachedPlanManager,
VcsRepositoryManager vcsRepositoryManager,
StorageTagService storageTagService,
PlanBranchPullRequestService planBranchPullRequestService,
StorageLocationService storageLocationService) |
Modifier and Type | Method and Description |
---|---|
ChainStateCreationRequestResult |
createChainStateNoDetection(ImmutableChain chain,
UnconditionalBuildDetectionAction buildDetectionAction)
Create a chain state ready for building but dont actually build.
|
ChainExecutionRequestResult |
delayedStart(ImmutableChain chain,
UnconditionalBuildDetectionAction buildDetectionAction,
ChainState chainState)
Starts the Chain if it's been created already
|
ChainExecution |
getChainExecution(PlanResultKey planResultKey)
Get the state of the single ChainExecution
|
List<ChainExecution> |
getExecutingChains(PlanKey planKey)
Get the Collection of the state of the ChainExecution or empty collection when no chain is executing
|
BuildExecution |
getJobExecution(PlanResultKey planResultKey)
Get the state of a single Job being executed
|
boolean |
isActive(PlanKey planKey)
Checks if the
Chain is "active" ie being queued, or building |
boolean |
isExecuting(PlanKey planKey)
Checks if the Chain is building
|
boolean |
isExecuting(PlanResultKey planResultKey)
Checks of
BuildResultsSummary represented by PlanResultKey is currently building (ie started on an agent_ |
void |
logChainExecutionState()
Log active
ChainExecution s |
int |
numberOfChainsExecuting() |
int |
numberOfChainsExecuting(PlanKey planKey)
Determines the number of
ChainExecution s are active for the given PlanKey |
void |
onBuildFinished(BuildFinishedEvent buildFinishedEvent) |
void |
onChainRemoved(ChainDeletedEvent chainDeletedEvent) |
void |
onExecutionStartedTimingPoint(BuildTimingPoints.ExecutionStarted event) |
void |
onVcsSyncStartedTimingPoint(BuildTimingPoints.VcsSyncStarted event) |
Set<PlanResultKey> |
restoreState(Set<PlanResultKey> chainResultsToRestore)
Restores state of running chains after server restart.
|
ChainExecutionRequestResult |
start(ImmutableChain chain,
ConditionalBuildDetectionAction buildDetectionAction)
Starts the Chain
|
void |
stop(PlanKey planKey)
|
void |
stop(PlanResultKey planResultKey)
Stops the executing instance of the
Chain represented by PlanResultKey |
public static final String MERGE_DIR
public ChainExecutionManagerImpl(PlanStatePersisterService planStatePersisterService, JobExecutionManager buildContextExecutor, ChainStateFactory chainStateFactory, BuildContextFactory buildContextFactory, com.atlassian.event.api.EventPublisher eventPublisher, ChainPluginSupport chainPluginSupport, ErrorUpdateHandler errorUpdateHandler, AuthorCreatorService authorCreatorService, ResultsSummaryManager resultsSummaryManager, BuildDirectoryManager buildDirectoryManager, VcsBranchIntegrationHelper branchIntegrationHelper, CustomVariableContext customVariableContext, PlanExecutionLockService planExecutionLockService, PlanVcsRevisionHistoryService planVcsRevisionHistoryService, XStreamFactory xStreamFactory, CachedPlanManager cachedPlanManager, VcsRepositoryManager vcsRepositoryManager, StorageTagService storageTagService, PlanBranchPullRequestService planBranchPullRequestService, StorageLocationService storageLocationService)
@NotNull public ChainExecutionRequestResult start(@NotNull ImmutableChain chain, @NotNull ConditionalBuildDetectionAction buildDetectionAction)
ChainExecutionManager
start
in interface ChainExecutionManager
@NotNull public ChainExecutionRequestResult delayedStart(@NotNull ImmutableChain chain, @NotNull UnconditionalBuildDetectionAction buildDetectionAction, @NotNull ChainState chainState)
ChainExecutionManager
delayedStart
in interface ChainExecutionManager
chainState
- if already created@EventListener public void onChainRemoved(@NotNull ChainDeletedEvent chainDeletedEvent)
@EventListener public void onVcsSyncStartedTimingPoint(@NotNull BuildTimingPoints.VcsSyncStarted event)
@EventListener public void onExecutionStartedTimingPoint(@NotNull BuildTimingPoints.ExecutionStarted event)
@EventListener @HibernateEventListenerAspect public void onBuildFinished(BuildFinishedEvent buildFinishedEvent)
@NotNull public ChainStateCreationRequestResult createChainStateNoDetection(@NotNull ImmutableChain chain, @NotNull UnconditionalBuildDetectionAction buildDetectionAction)
ChainExecutionManager
createChainStateNoDetection
in interface ChainExecutionManager
public void stop(@NotNull PlanResultKey planResultKey)
ChainExecutionManager
Chain
represented by PlanResultKey
stop
in interface ChainExecutionManager
public void stop(@NotNull PlanKey planKey)
ChainExecutionManager
stop
in interface ChainExecutionManager
public boolean isActive(@NotNull PlanKey planKey)
ChainExecutionAccessor
Chain
is "active" ie being queued, or buildingisActive
in interface ChainExecutionAccessor
public boolean isExecuting(@NotNull PlanKey planKey)
ChainExecutionAccessor
isExecuting
in interface ChainExecutionAccessor
public boolean isExecuting(@NotNull PlanResultKey planResultKey)
ChainExecutionAccessor
BuildResultsSummary
represented by PlanResultKey
is currently building (ie started on an agent_isExecuting
in interface ChainExecutionAccessor
@NotNull public List<ChainExecution> getExecutingChains(@NotNull PlanKey planKey)
ChainExecutionAccessor
getExecutingChains
in interface ChainExecutionAccessor
@Nullable public ChainExecution getChainExecution(@NotNull PlanResultKey planResultKey)
ChainExecutionAccessor
getChainExecution
in interface ChainExecutionAccessor
@Nullable public BuildExecution getJobExecution(@NotNull PlanResultKey planResultKey)
ChainExecutionAccessor
getJobExecution
in interface ChainExecutionAccessor
public int numberOfChainsExecuting(@NotNull PlanKey planKey)
ChainExecutionAccessor
ChainExecution
s are active for the given PlanKey
numberOfChainsExecuting
in interface ChainExecutionAccessor
public void logChainExecutionState()
ChainExecutionAccessor
ChainExecution
slogChainExecutionState
in interface ChainExecutionAccessor
public int numberOfChainsExecuting()
numberOfChainsExecuting
in interface ChainExecutionAccessor
ChainExecution
spublic Set<PlanResultKey> restoreState(Set<PlanResultKey> chainResultsToRestore)
ChainExecutionManager
restoreState
in interface ChainExecutionManager
Copyright © 2021 Atlassian Software Systems Pty Ltd. All rights reserved.