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,
BuildLoggerManager buildLoggerManager,
DeploymentVersionService deploymentVersionService) |
| Modifier and Type | Method and Description |
|---|---|
@NotNull ChainStateCreationRequestResult |
createChainStateNoDetection(@NotNull ImmutableChain chain,
@NotNull UnconditionalBuildDetectionAction buildDetectionAction)
Create a chain state ready for building but dont actually build.
|
@NotNull ChainExecutionRequestResult |
delayedStart(@NotNull ImmutableChain chain,
@NotNull UnconditionalBuildDetectionAction buildDetectionAction,
@NotNull ChainState chainState)
Starts the Chain if it's been created already
|
@Nullable ChainExecution |
getChainExecution(@NotNull PlanResultKey planResultKey)
Get the state of the single ChainExecution
|
@NotNull List<ChainExecution> |
getExecutingChains(@NotNull PlanKey planKey)
Get the Collection of the state of the ChainExecution or empty collection when no chain is executing
|
@Nullable BuildExecution |
getJobExecution(@NotNull PlanResultKey planResultKey)
Get the state of a single Job being executed
|
boolean |
isActive(@NotNull PlanKey planKey)
Checks if the
Chain is "active" ie being queued, or building |
boolean |
isExecuting(@NotNull PlanKey planKey)
Checks if the Chain is building
|
boolean |
isExecuting(@NotNull PlanResultKey planResultKey)
Checks of
BuildResultsSummary represented by PlanResultKey is currently building (ie started on an agent_ |
void |
logChainExecutionState()
Log active
ChainExecutions |
int |
numberOfChainsExecuting() |
int |
numberOfChainsExecuting(@NotNull PlanKey planKey)
Determines the number of
ChainExecutions are active for the given PlanKey |
void |
onBuildFinished(BuildFinishedEvent buildFinishedEvent) |
void |
onChainRemoved(@NotNull ChainDeletedEvent chainDeletedEvent) |
void |
onChainRemoved(@NotNull MultipleChainsDeletedEvent chainDeletedEvent) |
void |
onExecutionStartedTimingPoint(BuildTimingPoints.ExecutionStarted event) |
void |
onVcsSyncStartedTimingPoint(BuildTimingPoints.VcsSyncStarted event) |
Set<PlanResultKey> |
restoreState(Set<PlanResultKey> chainResultsToRestore,
Map<PlanResultKey,BuildResultsSummary> jobsInProgress)
Restores state of running chains after server restart.
|
@NotNull ChainExecutionRequestResult |
start(@NotNull ImmutableChain chain,
@NotNull ConditionalBuildDetectionAction buildDetectionAction)
Starts the Chain
|
void |
stop(@NotNull PlanKey planKey)
|
void |
stop(@NotNull 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, BuildLoggerManager buildLoggerManager, DeploymentVersionService deploymentVersionService)
@NotNull public @NotNull ChainExecutionRequestResult start(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull ConditionalBuildDetectionAction buildDetectionAction)
ChainExecutionManagerstart in interface ChainExecutionManager@NotNull public @NotNull ChainExecutionRequestResult delayedStart(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull UnconditionalBuildDetectionAction buildDetectionAction, @NotNull @NotNull ChainState chainState)
ChainExecutionManagerdelayedStart in interface ChainExecutionManagerchainState - if already created@EventListener
public void onChainRemoved(@NotNull
@NotNull ChainDeletedEvent chainDeletedEvent)
@EventListener
public void onChainRemoved(@NotNull
@NotNull MultipleChainsDeletedEvent 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 @NotNull ChainStateCreationRequestResult createChainStateNoDetection(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull UnconditionalBuildDetectionAction buildDetectionAction)
ChainExecutionManagercreateChainStateNoDetection in interface ChainExecutionManagerpublic void stop(@NotNull
@NotNull PlanResultKey planResultKey)
ChainExecutionManagerChain represented by PlanResultKeystop in interface ChainExecutionManagerpublic void stop(@NotNull
@NotNull PlanKey planKey)
ChainExecutionManagerstop in interface ChainExecutionManagerpublic boolean isActive(@NotNull
@NotNull PlanKey planKey)
ChainExecutionAccessorChain is "active" ie being queued, or buildingisActive in interface ChainExecutionAccessorpublic boolean isExecuting(@NotNull
@NotNull PlanKey planKey)
ChainExecutionAccessorisExecuting in interface ChainExecutionAccessorpublic boolean isExecuting(@NotNull
@NotNull PlanResultKey planResultKey)
ChainExecutionAccessorBuildResultsSummary represented by PlanResultKey is currently building (ie started on an agent_isExecuting in interface ChainExecutionAccessor@NotNull public @NotNull List<ChainExecution> getExecutingChains(@NotNull @NotNull PlanKey planKey)
ChainExecutionAccessorgetExecutingChains in interface ChainExecutionAccessor@Nullable public @Nullable ChainExecution getChainExecution(@NotNull @NotNull PlanResultKey planResultKey)
ChainExecutionAccessorgetChainExecution in interface ChainExecutionAccessor@Nullable public @Nullable BuildExecution getJobExecution(@NotNull @NotNull PlanResultKey planResultKey)
ChainExecutionAccessorgetJobExecution in interface ChainExecutionAccessorpublic int numberOfChainsExecuting(@NotNull
@NotNull PlanKey planKey)
ChainExecutionAccessorChainExecutions are active for the given PlanKeynumberOfChainsExecuting in interface ChainExecutionAccessorpublic void logChainExecutionState()
ChainExecutionAccessorChainExecutionslogChainExecutionState in interface ChainExecutionAccessorpublic int numberOfChainsExecuting()
numberOfChainsExecuting in interface ChainExecutionAccessorChainExecutionspublic Set<PlanResultKey> restoreState(Set<PlanResultKey> chainResultsToRestore, Map<PlanResultKey,BuildResultsSummary> jobsInProgress)
ChainExecutionManagerrestoreState in interface ChainExecutionManagerCopyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.