Class SynchronousBase
- java.lang.Object
-
- com.moesif.api.controllers.syncwrapper.SynchronousBase
-
- Direct Known Subclasses:
APICallBackCatcher
public class SynchronousBase extends Object
Base class to help convert an asynchronous callback to synchronous one
-
-
Constructor Summary
Constructors Constructor Description SynchronousBase()Initiate class with a count down of one onlySynchronousBase(int count)Initiate class with a task count
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidawait()Wait until all tasks are marked as donebooleanawait(long timeout, TimeUnit unit)Wait until all tasks are marked as done or timeout after given timeprotected voidmarkAsDone()Mark as done one task
-
-
-
Method Detail
-
markAsDone
protected void markAsDone()
Mark as done one task
-
await
public void await() throws InterruptedExceptionWait until all tasks are marked as done- Throws:
InterruptedException- error waiting for tasks to complete
-
await
public boolean await(long timeout, TimeUnit unit) throws InterruptedExceptionWait until all tasks are marked as done or timeout after given time- Parameters:
timeout- Time to waitunit- Unit for time- Returns:
- true if done
- Throws:
InterruptedException- error waiting for tasks to complete
-
-