com.atlassian.bamboo.chains
Class ChainExecutionManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.chains.ChainExecutionManagerImpl
All Implemented Interfaces:
ChainExecutionManager, ChainExecutionUpdateManager, HibernateEventListener, com.atlassian.event.EventListener

public class ChainExecutionManagerImpl
extends java.lang.Object
implements ChainExecutionManager, HibernateEventListener


Constructor Summary
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, BuildNumberGeneratorService buildNumberGeneratorService, BuildDirectoryManager buildDirectoryManager, BranchIntegrationHelper branchIntegrationHelper, CustomVariableContext customVariableContext, PlanExecutionLockService planExecutionLockService, PlanVcsRevisionHistoryService planVcsRevisionHistoryService)
           
 
Method Summary
 ChainExecution getChainExecution(PlanResultKey planResultKey)
          Get the state of the single ChainExecution
 java.util.List<ChainExecution> getExecutingChains(PlanKey planKey)
          Get the Collection of the state of the ChainExecution or empty collection when no chain is executing
 java.lang.Class<? extends com.atlassian.event.Event>[] getHandledEventClasses()
           
 BuildExecution getJobExecution(PlanResultKey planResultKey)
          Get the state of a single Job being executed
 void handleEvent(com.atlassian.event.Event event)
           
 void handleJobStarted(BuildContext buildContext, TimingPoint timingPoint)
           
 boolean isActive(PlanKey planKey)
          Checks if the Chain represented by PlanKey has any executions
 boolean isExecuting(PlanKey planKey)
          Checks if the Chain represented by PlanKey has any executions that are currently in progress
 boolean isExecuting(PlanResultKey planResultKey)
          Checks of the Chain represented by PlanResultKey is executed
 int numberOfChainsExecuting()
           
 int numberOfChainsExecuting(PlanKey planKey)
          Determines the number of ChainExecutions are active for the given PlanKey
 ChainExecutionRequestResult start(ImmutableChain chain, BuildDetectionAction buildDetectionAction)
          Starts the Chain
 void stop(PlanKey planKey)
          Stops all executing instances of the Chain represented by PlanKey
 void stop(PlanResultKey planResultKey)
          Stops the executing instance of the Chain represented by PlanResultKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChainExecutionManagerImpl

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,
                                 BuildNumberGeneratorService buildNumberGeneratorService,
                                 BuildDirectoryManager buildDirectoryManager,
                                 BranchIntegrationHelper branchIntegrationHelper,
                                 CustomVariableContext customVariableContext,
                                 PlanExecutionLockService planExecutionLockService,
                                 PlanVcsRevisionHistoryService planVcsRevisionHistoryService)
Method Detail

start

@NotNull
public ChainExecutionRequestResult start(@NotNull
                                                 ImmutableChain chain,
                                                 @NotNull
                                                 BuildDetectionAction buildDetectionAction)
Description copied from interface: ChainExecutionManager
Starts the Chain

Specified by:
start in interface ChainExecutionManager
Returns:
success or null if chain execution has not been started

handleJobStarted

public void handleJobStarted(@NotNull
                             BuildContext buildContext,
                             @NotNull
                             TimingPoint timingPoint)
Specified by:
handleJobStarted in interface ChainExecutionUpdateManager

handleEvent

public void handleEvent(com.atlassian.event.Event event)
Specified by:
handleEvent in interface HibernateEventListener
Specified by:
handleEvent in interface com.atlassian.event.EventListener

stop

public void stop(@NotNull
                 PlanResultKey planResultKey)
Description copied from interface: ChainExecutionManager
Stops the executing instance of the Chain represented by PlanResultKey

Specified by:
stop in interface ChainExecutionManager

stop

public void stop(@NotNull
                 PlanKey planKey)
Description copied from interface: ChainExecutionManager
Stops all executing instances of the Chain represented by PlanKey

Specified by:
stop in interface ChainExecutionManager

isActive

public boolean isActive(@NotNull
                        PlanKey planKey)
Description copied from interface: ChainExecutionManager
Checks if the Chain represented by PlanKey has any executions

Specified by:
isActive in interface ChainExecutionManager
Returns:
active

isExecuting

public boolean isExecuting(@NotNull
                           PlanKey planKey)
Description copied from interface: ChainExecutionManager
Checks if the Chain represented by PlanKey has any executions that are currently in progress

Specified by:
isExecuting in interface ChainExecutionManager
Returns:
running

isExecuting

public boolean isExecuting(@NotNull
                           PlanResultKey planResultKey)
Description copied from interface: ChainExecutionManager
Checks of the Chain represented by PlanResultKey is executed

Specified by:
isExecuting in interface ChainExecutionManager
Returns:
executing

getExecutingChains

@NotNull
public java.util.List<ChainExecution> getExecutingChains(@NotNull
                                                                 PlanKey planKey)
Description copied from interface: ChainExecutionManager
Get the Collection of the state of the ChainExecution or empty collection when no chain is executing

Specified by:
getExecutingChains in interface ChainExecutionManager
Returns:
chainExecution

getChainExecution

@Nullable
public ChainExecution getChainExecution(@NotNull
                                                 PlanResultKey planResultKey)
Description copied from interface: ChainExecutionManager
Get the state of the single ChainExecution

Specified by:
getChainExecution in interface ChainExecutionManager
Returns:

getJobExecution

@Nullable
public BuildExecution getJobExecution(@NotNull
                                               PlanResultKey planResultKey)
Description copied from interface: ChainExecutionManager
Get the state of a single Job being executed

Specified by:
getJobExecution in interface ChainExecutionManager
Returns:

numberOfChainsExecuting

public int numberOfChainsExecuting(@NotNull
                                   PlanKey planKey)
Description copied from interface: ChainExecutionManager
Determines the number of ChainExecutions are active for the given PlanKey

Specified by:
numberOfChainsExecuting in interface ChainExecutionManager
Returns:

numberOfChainsExecuting

public int numberOfChainsExecuting()
Specified by:
numberOfChainsExecuting in interface ChainExecutionManager

getHandledEventClasses

public java.lang.Class<? extends com.atlassian.event.Event>[] getHandledEventClasses()
Specified by:
getHandledEventClasses in interface HibernateEventListener
Specified by:
getHandledEventClasses in interface com.atlassian.event.EventListener
Returns:
Array of Class objects this listener handles


Copyright © 2012 Atlassian. All Rights Reserved.