org.jenkinsci.plugins.pretestedintegration
Class CommitQueue

java.lang.Object
  extended by org.jenkinsci.plugins.pretestedintegration.CommitQueue

public class CommitQueue
extends Object

Queue for ensuring that only one build is running at a time. This class is a Singleton, so use getInstance() to access it.


Method Summary
 boolean available()
          Test if the lock is available, without blocking.
 void enqueueAndWait()
          Block until the commit can be tested without any other commits running at the same time.
static CommitQueue getInstance()
          Get the singleton instance.
 void release()
          Signal that the build is done and a new one can get access.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static CommitQueue getInstance()
Get the singleton instance.


enqueueAndWait

public void enqueueAndWait()
Block until the commit can be tested without any other commits running at the same time. After calling this function, release() MUST be called, so make sure that every error scenario releases the lock at some point.


release

public void release()
Signal that the build is done and a new one can get access.


available

public boolean available()
Test if the lock is available, without blocking.



Copyright © 2004-2013. All Rights Reserved.