com.atlassian.plugin.util
Class WaitUntil

java.lang.Object
  extended by com.atlassian.plugin.util.WaitUntil

public class WaitUntil
extends Object

Utility methods for synchronising on asynchronous processes


Nested Class Summary
static interface WaitUntil.WaitCondition
          The condition to determine when to stop waiting
 
Method Summary
static boolean invoke(WaitUntil.WaitCondition waitCondition)
          Invokes the wait condition, trying every second for 10 seconds
static boolean invoke(WaitUntil.WaitCondition waitCondition, int tries)
          Invokes the wait condition, trying every second for the configured seconds
static boolean invoke(WaitUntil.WaitCondition waitCondition, int time, TimeUnit unit, int retryInterval)
          Invokes the wait condition, trying every second for the configured seconds
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

invoke

public static boolean invoke(WaitUntil.WaitCondition waitCondition)
Invokes the wait condition, trying every second for 10 seconds

Parameters:
waitCondition - The condition that determines when to stop waiting
Returns:
True if the condition returned true

invoke

public static boolean invoke(WaitUntil.WaitCondition waitCondition,
                             int tries)
Invokes the wait condition, trying every second for the configured seconds

Parameters:
waitCondition - The condition that determines when to stop waiting
tries - The number of tries to attempt
Returns:
True if the condition returned true

invoke

public static boolean invoke(WaitUntil.WaitCondition waitCondition,
                             int time,
                             TimeUnit unit,
                             int retryInterval)
Invokes the wait condition, trying every second for the configured seconds

Parameters:
waitCondition - The condition that determines when to stop waiting
time - the amount of time to wait
unit - the time unit time is specified in
retryInterval - how often to re-check the condition (specified in the supplied TimeUnit)
Returns:
True if the condition returned true


Copyright © 2010 Atlassian. All Rights Reserved.