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
ChainExecution s |
int |
numberOfChainsExecuting() |
int |
numberOfChainsExecuting(@NotNull PlanKey planKey)
Determines the number of
ChainExecution s 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)
ChainExecutionManager
start
in interface ChainExecutionManager
@NotNull public @NotNull ChainExecutionRequestResult delayedStart(@NotNull @NotNull ImmutableChain chain, @NotNull @NotNull UnconditionalBuildDetectionAction buildDetectionAction, @NotNull @NotNull ChainState chainState)
ChainExecutionManager
delayedStart
in interface ChainExecutionManager
chainState
- 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)
ChainExecutionManager
createChainStateNoDetection
in interface ChainExecutionManager
public void stop(@NotNull @NotNull PlanResultKey planResultKey)
ChainExecutionManager
Chain
represented by PlanResultKey
stop
in interface ChainExecutionManager
public void stop(@NotNull @NotNull PlanKey planKey)
ChainExecutionManager
stop
in interface ChainExecutionManager
public boolean isActive(@NotNull @NotNull PlanKey planKey)
ChainExecutionAccessor
Chain
is "active" ie being queued, or buildingisActive
in interface ChainExecutionAccessor
public boolean isExecuting(@NotNull @NotNull PlanKey planKey)
ChainExecutionAccessor
isExecuting
in interface ChainExecutionAccessor
public boolean isExecuting(@NotNull @NotNull PlanResultKey planResultKey)
ChainExecutionAccessor
BuildResultsSummary
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)
ChainExecutionAccessor
getExecutingChains
in interface ChainExecutionAccessor
@Nullable public @Nullable ChainExecution getChainExecution(@NotNull @NotNull PlanResultKey planResultKey)
ChainExecutionAccessor
getChainExecution
in interface ChainExecutionAccessor
@Nullable public @Nullable BuildExecution getJobExecution(@NotNull @NotNull PlanResultKey planResultKey)
ChainExecutionAccessor
getJobExecution
in interface ChainExecutionAccessor
public int numberOfChainsExecuting(@NotNull @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, Map<PlanResultKey,BuildResultsSummary> jobsInProgress)
ChainExecutionManager
restoreState
in interface ChainExecutionManager
Copyright © 2022 Atlassian Software Systems Pty Ltd. All rights reserved.