com.atlassian.bamboo.build
Class DefaultBuildExecutionManager

java.lang.Object
  extended by com.atlassian.bamboo.build.DefaultBuildExecutionManager
All Implemented Interfaces:
BuildExecutionManager, BuildExecutionUpdateManager, BuildLoggerManager, org.springframework.beans.factory.InitializingBean

public class DefaultBuildExecutionManager
extends java.lang.Object
implements BuildExecutionManager, org.springframework.beans.factory.InitializingBean

This class is registered as event listener afterPropertiesSet()


Constructor Summary
DefaultBuildExecutionManager(org.quartz.Scheduler scheduler)
           
 
Method Summary
 CurrentlyBuilding addToCurrentlyBuilding(BuildContext buildContext)
          Denotes that the passed build context is beginning the build process.
 void afterPropertiesSet()
           
 void execute(BuildContext buildContext)
          Executes the given BuildContext At this point a BuildResultsSummary exists that matches the given BuildContext
 void finishBuild(PlanResultKey planResultKey)
          Calls removeCurrentlyBuilding & finishProcess
 BuildLogger getBuildLogger(PlanKey key)
          Deprecated. since 5.0 use respective method from BuildLoggerManager
 BuildLogger getBuildLogger(PlanResultKey resultKey)
          Deprecated. since 5.0 use respective method from BuildLoggerManager
 BuildLogger getBuildLogger(java.lang.String planOrResultKey)
          Deprecated. since 5.0 use respective method from BuildLoggerManager
 CurrentlyBuilding getBuildRunningOnAgent(java.lang.Long buildAgentId)
           
 java.util.List<CurrentlyBuilding> getCurrentlyBuilding(Key key)
           
 java.util.List<CurrentlyBuilding> getCurrentlyBuilding(java.lang.String planKey)
           
 CurrentlyBuilding getCurrentlyBuildingByBuildResult(BuildIdentifier buildIdentifier)
          Returns CurrentlyBuilding instance for build identifier (or BuildContext).
 CurrentlyBuilding getCurrentlyBuildingByBuildResultKey(java.lang.String buildResultKey)
          Returns CurrentlyBuilding instance for build identified by buildResultKey.
 CurrentlyBuilding getCurrentlyBuildingByPlanResultKey(ResultKey resultKey)
          Returns CurrentlyBuilding instance for build identified by buildResultKey.
 java.util.List<CurrentlyBuilding> getCurrentlyExecutingBuilds()
          Retrieves a list of all builds being executed (i.e not just queued).
 java.util.List<CurrentlyBuilding> getCurrentlyExecutingBuilds(java.lang.String planKey)
          Retrieves a list of all builds being executed (i.e not just queued) that belong to the specified planKey.
 BuildLogger getLogger(Key key)
          Deprecated. since 5.0 use respective method from BuildLoggerManager
 BuildLogger getLogger(ResultKey resultKey)
          Deprecated. since 5.0 use respective method from BuildLoggerManager
 void onExecutionCancelledTimingPoint(BuildTimingPoints.ExecutionCancelled event)
           
 void onExecutionFinishedTimingPoint(BuildTimingPoints.ExecutionFinished event)
           
 void onExecutionStartedTimingPoint(BuildTimingPoints.ExecutionStarted event)
           
 void onQueuedTimingPoint(BuildTimingPoints.Queued event)
           
 void onVcsSyncStartedTimingPoint(BuildTimingPoints.VcsSyncStarted event)
           
 void removeBuildLogger(PlanKey planKey)
          Deprecated. since 5.0 use respective method from BuildLoggerManager
 void removeBuildLogger(PlanResultKey buildResultKey)
          Deprecated. since 5.0 use respective method from BuildLoggerManager
 CurrentlyBuilding removeCurrentlyBuilding(ResultKey resultKey)
           
 CurrentlyBuilding removeCurrentlyBuilding(java.lang.String planKey)
           
 void removeLogger(LoggerId loggerId)
          Deprecated. since 5.0 use respective method from BuildLoggerManager
 void setAuthorCreatorService(AuthorCreatorService authorCreatorService)
           
 void setBuildFinish(BuildContext buildContext, TimingPoint timingPoint)
          Deprecated. 
 void setBuildLoggerManager(BuildLoggerManager buildLoggerManager)
           
 void setBuildRunningOnAgent(BuildContext buildContext, java.lang.Long buildAgentId)
          Deprecated. 
 void setBuildStart(BuildContext buildContext, TimingPoint timingPoint)
          Deprecated. 
 void setBuildStopAcknowledge(java.lang.String buildResultKey, boolean hasCancellingStarted)
          Deprecated. 
 void setCurrentlyBuilding(BuildContext buildContext, java.util.Collection<BuildAgent> executableAgents, java.util.Collection<ElasticImageConfiguration> executableImages)
          Denotes that the passed build context is beginning the build process.
 void setCurrentlyBuildingContainer(CurrentlyBuildingContainer currentlyBuildingContainer)
           
 void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)
           
 void setPendingBuildResultsCleanup(PendingBuildResultsCleanup pendingBuildResultsCleanup)
           
 void setPlanManager(PlanManager planManager)
           
 void setPlanStatePersisterService(PlanStatePersisterService planStatePersisterService)
           
 void setResultsSummaryManager(ResultsSummaryManager resultsSummaryManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBuildExecutionManager

public DefaultBuildExecutionManager(org.quartz.Scheduler scheduler)
Method Detail

execute

public void execute(@NotNull
                    BuildContext buildContext)
Description copied from interface: BuildExecutionManager
Executes the given BuildContext At this point a BuildResultsSummary exists that matches the given BuildContext

Specified by:
execute in interface BuildExecutionManager

afterPropertiesSet

public void afterPropertiesSet()
                        throws java.lang.Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
java.lang.Exception

getCurrentlyExecutingBuilds

@NotNull
public java.util.List<CurrentlyBuilding> getCurrentlyExecutingBuilds()
Description copied from interface: BuildExecutionManager
Retrieves a list of all builds being executed (i.e not just queued).

Specified by:
getCurrentlyExecutingBuilds in interface BuildExecutionManager
Returns:

getCurrentlyExecutingBuilds

@NotNull
public java.util.List<CurrentlyBuilding> getCurrentlyExecutingBuilds(java.lang.String planKey)
Description copied from interface: BuildExecutionManager
Retrieves a list of all builds being executed (i.e not just queued) that belong to the specified planKey.

Specified by:
getCurrentlyExecutingBuilds in interface BuildExecutionManager
Returns:

getCurrentlyBuilding

@NotNull
public java.util.List<CurrentlyBuilding> getCurrentlyBuilding(@NotNull
                                                                      java.lang.String planKey)
Specified by:
getCurrentlyBuilding in interface BuildExecutionManager
Returns:

getCurrentlyBuilding

@NotNull
public java.util.List<CurrentlyBuilding> getCurrentlyBuilding(@NotNull
                                                                      Key key)
Specified by:
getCurrentlyBuilding in interface BuildExecutionManager

getCurrentlyBuildingByBuildResultKey

@Nullable
public CurrentlyBuilding getCurrentlyBuildingByBuildResultKey(@NotNull
                                                                       java.lang.String buildResultKey)
Description copied from interface: BuildExecutionManager
Returns CurrentlyBuilding instance for build identified by buildResultKey. Should be used only if BuildIdentifier is not available - basically in actions

Specified by:
getCurrentlyBuildingByBuildResultKey in interface BuildExecutionManager
Returns:

getCurrentlyBuildingByPlanResultKey

@Nullable
public CurrentlyBuilding getCurrentlyBuildingByPlanResultKey(@NotNull
                                                                      ResultKey resultKey)
Description copied from interface: BuildExecutionManager
Returns CurrentlyBuilding instance for build identified by buildResultKey. Should be used only if BuildIdentifier is not available - basically in actions

Specified by:
getCurrentlyBuildingByPlanResultKey in interface BuildExecutionManager
Returns:

getCurrentlyBuildingByBuildResult

@Nullable
public CurrentlyBuilding getCurrentlyBuildingByBuildResult(@NotNull
                                                                    BuildIdentifier buildIdentifier)
Description copied from interface: BuildExecutionManager
Returns CurrentlyBuilding instance for build identifier (or BuildContext).

Specified by:
getCurrentlyBuildingByBuildResult in interface BuildExecutionManager
Returns:

setCurrentlyBuilding

public void setCurrentlyBuilding(@NotNull
                                 BuildContext buildContext,
                                 @NotNull
                                 java.util.Collection<BuildAgent> executableAgents,
                                 @NotNull
                                 java.util.Collection<ElasticImageConfiguration> executableImages)
Denotes that the passed build context is beginning the build process. (i.e. it's being queued). Executable build agent lists are considered to be up to date if this method is used.

Specified by:
setCurrentlyBuilding in interface BuildExecutionManager
Parameters:
buildContext -
executableAgents - - a list of agents on which this build can be run.
executableImages - - a list of images on which the build can be run.

addToCurrentlyBuilding

@NotNull
public CurrentlyBuilding addToCurrentlyBuilding(@NotNull
                                                        BuildContext buildContext)
Denotes that the passed build context is beginning the build process. (i.e. it's being queued). Executable build agent lists are considered to be not yet initialized if this method is used.

Specified by:
addToCurrentlyBuilding in interface BuildExecutionManager
Parameters:
buildContext -

getBuildRunningOnAgent

@Nullable
public CurrentlyBuilding getBuildRunningOnAgent(@NotNull
                                                         java.lang.Long buildAgentId)
Specified by:
getBuildRunningOnAgent in interface BuildExecutionManager

finishBuild

public void finishBuild(@NotNull
                        PlanResultKey planResultKey)
Description copied from interface: BuildExecutionManager
Calls removeCurrentlyBuilding & finishProcess

Specified by:
finishBuild in interface BuildExecutionManager
Parameters:
planResultKey - identifies plan result

removeCurrentlyBuilding

public CurrentlyBuilding removeCurrentlyBuilding(@NotNull
                                                 java.lang.String planKey)
Specified by:
removeCurrentlyBuilding in interface BuildExecutionManager

removeCurrentlyBuilding

public CurrentlyBuilding removeCurrentlyBuilding(@NotNull
                                                 ResultKey resultKey)
Specified by:
removeCurrentlyBuilding in interface BuildExecutionManager

onQueuedTimingPoint

@EventListener
public void onQueuedTimingPoint(@NotNull
                                              BuildTimingPoints.Queued event)

onVcsSyncStartedTimingPoint

@EventListener
public void onVcsSyncStartedTimingPoint(@NotNull
                                                      BuildTimingPoints.VcsSyncStarted event)

onExecutionStartedTimingPoint

@EventListener
public void onExecutionStartedTimingPoint(@NotNull
                                                        BuildTimingPoints.ExecutionStarted event)

onExecutionCancelledTimingPoint

@EventListener
public void onExecutionCancelledTimingPoint(@NotNull
                                                          BuildTimingPoints.ExecutionCancelled event)

onExecutionFinishedTimingPoint

@EventListener
public void onExecutionFinishedTimingPoint(@NotNull
                                                         BuildTimingPoints.ExecutionFinished event)

getBuildLogger

@Deprecated
@NotNull
public BuildLogger getBuildLogger(@NotNull
                                                     PlanKey key)
Deprecated. since 5.0 use respective method from BuildLoggerManager

Description copied from interface: BuildLoggerManager
Returns a BuildLogger for the given plan

Specified by:
getBuildLogger in interface BuildLoggerManager

getBuildLogger

@Deprecated
@NotNull
public BuildLogger getBuildLogger(@NotNull
                                                     PlanResultKey resultKey)
Deprecated. since 5.0 use respective method from BuildLoggerManager

Description copied from interface: BuildLoggerManager
Returns a BuildLogger for the given result

Specified by:
getBuildLogger in interface BuildLoggerManager
Returns:

getLogger

@Deprecated
@NotNull
public BuildLogger getLogger(@NotNull
                                                Key key)
Deprecated. since 5.0 use respective method from BuildLoggerManager

Description copied from interface: BuildLoggerManager
Returns a BuildLogger for the given plan

Specified by:
getLogger in interface BuildLoggerManager

getLogger

@Deprecated
@NotNull
public BuildLogger getLogger(@NotNull
                                                ResultKey resultKey)
Deprecated. since 5.0 use respective method from BuildLoggerManager

Description copied from interface: BuildLoggerManager
Returns a BuildLogger for the given result

Specified by:
getLogger in interface BuildLoggerManager
Returns:

getBuildLogger

@NotNull
public BuildLogger getBuildLogger(@NotNull
                                          java.lang.String planOrResultKey)
Deprecated. since 5.0 use respective method from BuildLoggerManager

Description copied from interface: BuildLoggerManager
Returns a BuildLogger for the given plan or result key. If it's detected that the AgentContext is building something, passing the plan key String will switch to log to the result log

Specified by:
getBuildLogger in interface BuildLoggerManager
Returns:
buildLogger

removeBuildLogger

@Deprecated
public void removeBuildLogger(PlanKey planKey)
Deprecated. since 5.0 use respective method from BuildLoggerManager

Description copied from interface: BuildLoggerManager
Removes plan logger for given plan key.

Specified by:
removeBuildLogger in interface BuildLoggerManager

removeBuildLogger

@Deprecated
public void removeBuildLogger(PlanResultKey buildResultKey)
Deprecated. since 5.0 use respective method from BuildLoggerManager

Description copied from interface: BuildLoggerManager
Removes buildLogger for finished build process. Removed build logger is not used anymore as build has been finished and build result should be persisted already.

Specified by:
removeBuildLogger in interface BuildLoggerManager

removeLogger

@Deprecated
public void removeLogger(LoggerId loggerId)
Deprecated. since 5.0 use respective method from BuildLoggerManager

Description copied from interface: BuildLoggerManager
Remove a logger if you are finished with it.

Specified by:
removeLogger in interface BuildLoggerManager
Parameters:
loggerId - of the logger to remove

setBuildRunningOnAgent

@Deprecated
public void setBuildRunningOnAgent(@NotNull
                                              BuildContext buildContext,
                                              java.lang.Long buildAgentId)
Deprecated. 

Specified by:
setBuildRunningOnAgent in interface BuildExecutionUpdateManager

setBuildStart

@Deprecated
public void setBuildStart(@NotNull
                                     BuildContext buildContext,
                                     @NotNull
                                     TimingPoint timingPoint)
Deprecated. 

Specified by:
setBuildStart in interface BuildExecutionUpdateManager

setBuildFinish

@Deprecated
public void setBuildFinish(@NotNull
                                      BuildContext buildContext,
                                      @NotNull
                                      TimingPoint timingPoint)
Deprecated. 

Specified by:
setBuildFinish in interface BuildExecutionUpdateManager

setBuildStopAcknowledge

@Deprecated
public void setBuildStopAcknowledge(@NotNull
                                               java.lang.String buildResultKey,
                                               boolean hasCancellingStarted)
Deprecated. 

Specified by:
setBuildStopAcknowledge in interface BuildExecutionUpdateManager

setPlanManager

public void setPlanManager(PlanManager planManager)

setEventPublisher

public void setEventPublisher(com.atlassian.event.api.EventPublisher eventPublisher)

setResultsSummaryManager

public void setResultsSummaryManager(ResultsSummaryManager resultsSummaryManager)

setBuildLoggerManager

public void setBuildLoggerManager(BuildLoggerManager buildLoggerManager)

setPendingBuildResultsCleanup

public void setPendingBuildResultsCleanup(PendingBuildResultsCleanup pendingBuildResultsCleanup)

setAuthorCreatorService

public void setAuthorCreatorService(AuthorCreatorService authorCreatorService)

setCurrentlyBuildingContainer

public void setCurrentlyBuildingContainer(CurrentlyBuildingContainer currentlyBuildingContainer)

setPlanStatePersisterService

public void setPlanStatePersisterService(PlanStatePersisterService planStatePersisterService)


Copyright © 2013 Atlassian Software Systems Pty Ltd. All Rights Reserved.