public class ChainExecutionManagerImpl extends Object implements ChainExecutionManager
postConstruct()
Constructor and Description |
---|
ChainExecutionManagerImpl(PlanStatePersisterService planStatePersisterService,
JobExecutionManager buildContextExecutor,
ChainResultManager chainResultManager,
ChainStateFactory chainStateFactory,
BuildContextFactory buildContextFactory,
com.atlassian.event.api.EventPublisher eventPublisher,
ChainPluginSupport chainPluginSupport,
ErrorUpdateHandler errorUpdateHandler,
AuthorCreatorService authorCreatorService,
ResultsSummaryManager resultsSummaryManager,
BuildDirectoryManager buildDirectoryManager,
BranchIntegrationHelper branchIntegrationHelper,
CustomVariableContext customVariableContext,
PlanExecutionLockService planExecutionLockService,
PlanVcsRevisionHistoryService planVcsRevisionHistoryService,
XStreamFactory xStreamFactory,
ArtifactLinkManager artifactLinkManager,
CachedPlanManager cachedPlanManager) |
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_ |
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(OutOfBandBuildTimingPoints.ExecutionStarted event) |
void |
onVcsSyncStartedTimingPoint(OutOfBandBuildTimingPoints.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, ChainResultManager chainResultManager, ChainStateFactory chainStateFactory, BuildContextFactory buildContextFactory, com.atlassian.event.api.EventPublisher eventPublisher, ChainPluginSupport chainPluginSupport, ErrorUpdateHandler errorUpdateHandler, AuthorCreatorService authorCreatorService, ResultsSummaryManager resultsSummaryManager, BuildDirectoryManager buildDirectoryManager, BranchIntegrationHelper branchIntegrationHelper, CustomVariableContext customVariableContext, PlanExecutionLockService planExecutionLockService, PlanVcsRevisionHistoryService planVcsRevisionHistoryService, XStreamFactory xStreamFactory, ArtifactLinkManager artifactLinkManager, CachedPlanManager cachedPlanManager)
@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 OutOfBandBuildTimingPoints.VcsSyncStarted event)
@EventListener public void onExecutionStartedTimingPoint(@NotNull OutOfBandBuildTimingPoints.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)
ChainExecutionManager
Chain
is "active" ie being queued, or buildingisActive
in interface ChainExecutionManager
public boolean isExecuting(@NotNull PlanKey planKey)
ChainExecutionManager
isExecuting
in interface ChainExecutionManager
public boolean isExecuting(@NotNull PlanResultKey planResultKey)
ChainExecutionManager
BuildResultsSummary
represented by PlanResultKey
is currently building (ie started on an agent_isExecuting
in interface ChainExecutionManager
@NotNull public List<ChainExecution> getExecutingChains(@NotNull PlanKey planKey)
ChainExecutionManager
getExecutingChains
in interface ChainExecutionManager
@Nullable public ChainExecution getChainExecution(@NotNull PlanResultKey planResultKey)
ChainExecutionManager
getChainExecution
in interface ChainExecutionManager
@Nullable public BuildExecution getJobExecution(@NotNull PlanResultKey planResultKey)
ChainExecutionManager
getJobExecution
in interface ChainExecutionManager
public int numberOfChainsExecuting(@NotNull PlanKey planKey)
ChainExecutionManager
ChainExecution
s are active for the given PlanKey
numberOfChainsExecuting
in interface ChainExecutionManager
public int numberOfChainsExecuting()
numberOfChainsExecuting
in interface ChainExecutionManager
public Set<PlanResultKey> restoreState(Set<PlanResultKey> chainResultsToRestore)
ChainExecutionManager
restoreState
in interface ChainExecutionManager
Copyright © 2016 Atlassian Software Systems Pty Ltd. All rights reserved.