|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.curator.test.Timing
public class Timing
Utility to get various testing times
| Constructor Summary | |
|---|---|
Timing()
Use the default base time |
|
Timing(double multiple)
Use a multiple of the default base time |
|
Timing(double multiple,
int waitingMultiple)
Use a multiple of the default base time |
|
Timing(long value,
TimeUnit unit)
|
|
Timing(long value,
TimeUnit unit,
int waitingMultiple)
|
|
| Method Summary | |
|---|---|
boolean |
acquireSemaphore(Semaphore semaphore)
Wait on the given semaphore |
boolean |
acquireSemaphore(Semaphore semaphore,
int n)
Wait on the given semaphore |
boolean |
awaitLatch(CountDownLatch latch)
Wait on the given latch |
int |
connection()
Return the value to use for ZK connection timeout |
Timing |
forWaiting()
Return a new timing with the standard multiple for waiting on latches, etc. |
int |
milliseconds()
Return the base time in milliseconds |
Timing |
multiple(double n)
Return a new timing that is a multiple of the this timing |
int |
seconds()
Return the base time in seconds |
int |
session()
Return the value to use for ZK session timeout |
void |
sleepABit()
Sleep for a small amount of time |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Timing()
public Timing(double multiple)
multiple - the multiple
public Timing(double multiple,
int waitingMultiple)
multiple - the multiplewaitingMultiple - multiple of main timing to use when waiting
public Timing(long value,
TimeUnit unit)
value - base timeunit - base time unit
public Timing(long value,
TimeUnit unit,
int waitingMultiple)
value - base timeunit - base time unitwaitingMultiple - multiple of main timing to use when waiting| Method Detail |
|---|
public int milliseconds()
public int seconds()
public boolean awaitLatch(CountDownLatch latch)
latch - latch to wait on
CountDownLatch.await(long, TimeUnit)public boolean acquireSemaphore(Semaphore semaphore)
semaphore - the semaphore
Semaphore.tryAcquire()
public boolean acquireSemaphore(Semaphore semaphore,
int n)
semaphore - the semaphoren - number of permits to acquire
Semaphore.tryAcquire(int, long, TimeUnit)public Timing multiple(double n)
n - the multiple
public Timing forWaiting()
public void sleepABit()
throws InterruptedException
InterruptedException - if interruptedpublic int session()
public int connection()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||