com.atlassian.bamboo.build
Class DefaultBuildChangeDetector

java.lang.Object
  extended by com.atlassian.bamboo.container.BambooTask
      extended by com.atlassian.bamboo.build.DefaultBuildChangeDetector
All Implemented Interfaces:
BuildChangeDetector, Runnable

public class DefaultBuildChangeDetector
extends BambooTask
implements BuildChangeDetector

A Deamon that detects when a build needs to be built.


Field Summary
 
Fields inherited from interface com.atlassian.bamboo.build.BuildChangeDetector
DISABLE_BUILD_SYSTEM_PROPERTY
 
Constructor Summary
DefaultBuildChangeDetector(BlockingQueue codeChangeQueue, ErrorHandler errorHandler, BuildManager buildManager)
          Create the deamon.
 
Method Summary
 void checkIfBuildNeedsBuilding(Build build)
          Use the given build's BuildStrategy to check if the build needs building or not.
protected  void doTask()
          Check for build build strategies to determine if they should be built
 void run()
          Check for build changes every second.
 void setRunning(boolean keepRunning)
           
 boolean sourceNotAlreadyCheckedOut(File sourceCodeDirectory)
           
 
Methods inherited from class com.atlassian.bamboo.container.BambooTask
getPersister, init, isRunning, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBuildChangeDetector

public DefaultBuildChangeDetector(BlockingQueue codeChangeQueue,
                                  ErrorHandler errorHandler,
                                  BuildManager buildManager)
Create the deamon.

Parameters:
codeChangeQueue - The SEDA queue to pipe the change to.
errorHandler - Report errors back to the user
buildManager -
Method Detail

run

public void run()
Check for build changes every second. Each build has it's own polling period

Specified by:
run in interface Runnable
Overrides:
run in class BambooTask

doTask

protected void doTask()
Check for build build strategies to determine if they should be built

Specified by:
doTask in class BambooTask

checkIfBuildNeedsBuilding

public void checkIfBuildNeedsBuilding(Build build)
Use the given build's BuildStrategy to check if the build needs building or not. Build's that need building are added to the build queue.

It ignores checking builds that are currently being built. It ignore build's who sourse code repository is being manipulated by another thread (possibly checking out the code when it has first been added...)

Specified by:
checkIfBuildNeedsBuilding in interface BuildChangeDetector
Parameters:
build - The build we're checking

sourceNotAlreadyCheckedOut

public boolean sourceNotAlreadyCheckedOut(File sourceCodeDirectory)

setRunning

public void setRunning(boolean keepRunning)


Copyright © 2006 Atlassian Software Systems. All Rights Reserved.