com.atlassian.bamboo.event
Class DefaultBuildEventNotifier

java.lang.Object
  extended by com.atlassian.bamboo.event.DefaultBuildEventNotifier
All Implemented Interfaces:
Startable, BuildEventNotifier

public class DefaultBuildEventNotifier
extends Object
implements BuildEventNotifier

This class keep a registery of BuildEventListeners and notifies them when a build event occurs.


Constructor Summary
DefaultBuildEventNotifier()
           
 
Method Summary
 void addBuildEventListener(BuildEventListener listener)
          Register an interest build events
protected  int getTimeoutDurationInMillis()
          Defaults to FIVE_MINUTES, but can be overridden by tests that don't want to wait that long
 void notifyListenersOfBuildComplete(Build build, BuildResults buildResults)
          Notify the registered BuildEventListeners that a build build has completed.
 void notifyListenersOfBuildResultsRemoval(Build build, long buildNumber)
          Notify the registered BuildEventListeners that a build build has completed.
 void notifyListenersOfBuildStart(Build build, long buildNumber)
          Notify the registered BuildEventListeners that a build has started to be built.
 void notifyListenersOfDeletedBuild(Build build)
          Notify the registered BuildEventListeners that an existing build has been deleted.
 void notifyListenersOfNewBuild(Build build)
          Notify the registered BuildEventListeners that a new build has been added.
 void restart()
          We need to restart the build Builder!
 void setErrorHandler(ErrorHandler errorHandler)
           
 void start()
          Starts up the all the registered Build Listeners that implement Startable
 void stop()
          Stops the all the registered Build Listeners that implement Startable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultBuildEventNotifier

public DefaultBuildEventNotifier()
Method Detail

addBuildEventListener

public void addBuildEventListener(BuildEventListener listener)
Register an interest build events

Specified by:
addBuildEventListener in interface BuildEventNotifier
Parameters:
listener - The listener interested in build events

start

public void start()
           throws Exception
Starts up the all the registered Build Listeners that implement Startable

Specified by:
start in interface Startable
Throws:
Exception - A generic exception

stop

public void stop()
          throws Exception
Stops the all the registered Build Listeners that implement Startable

Specified by:
stop in interface Startable
Throws:
Exception - A generic exception

restart

public void restart()
             throws Exception
We need to restart the build Builder!

Specified by:
restart in interface BuildEventNotifier
Throws:
Exception

notifyListenersOfBuildStart

public void notifyListenersOfBuildStart(Build build,
                                        long buildNumber)
                                 throws Exception
Description copied from interface: BuildEventNotifier
Notify the registered BuildEventListeners that a build has started to be built.

Specified by:
notifyListenersOfBuildStart in interface BuildEventNotifier
Parameters:
build - The build being built
buildNumber - The number of the new build.
Throws:
Exception

notifyListenersOfBuildComplete

public void notifyListenersOfBuildComplete(Build build,
                                           BuildResults buildResults)
                                    throws Exception
Description copied from interface: BuildEventNotifier
Notify the registered BuildEventListeners that a build build has completed.

Specified by:
notifyListenersOfBuildComplete in interface BuildEventNotifier
Parameters:
build - The build being built
buildResults - The results of the build
Throws:
Exception

notifyListenersOfBuildResultsRemoval

public void notifyListenersOfBuildResultsRemoval(Build build,
                                                 long buildNumber)
Description copied from interface: BuildEventNotifier
Notify the registered BuildEventListeners that a build build has completed.

Specified by:
notifyListenersOfBuildResultsRemoval in interface BuildEventNotifier
Parameters:
build - The build being built
buildNumber - The number of the build to delete

getTimeoutDurationInMillis

protected int getTimeoutDurationInMillis()
Defaults to FIVE_MINUTES, but can be overridden by tests that don't want to wait that long

Returns:
The duration in millis

notifyListenersOfNewBuild

public void notifyListenersOfNewBuild(Build build)
Description copied from interface: BuildEventNotifier
Notify the registered BuildEventListeners that a new build has been added.

Specified by:
notifyListenersOfNewBuild in interface BuildEventNotifier
Parameters:
build - The new build

notifyListenersOfDeletedBuild

public void notifyListenersOfDeletedBuild(Build build)
                                   throws Exception
Description copied from interface: BuildEventNotifier
Notify the registered BuildEventListeners that an existing build has been deleted.

Specified by:
notifyListenersOfDeletedBuild in interface BuildEventNotifier
Parameters:
build - The build that's about to get zapped
Throws:
Exception

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)


Copyright © 2006 Atlassian Software Systems. All Rights Reserved.