|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecteu.cedarsoft.async.AsyncCallSupport<T>
T - the type of callspublic class AsyncCallSupport<T>
An asynchronous call.
| Field Summary | |
|---|---|
static java.lang.String |
NAME_PREFIX
|
| Constructor Summary | |
|---|---|
AsyncCallSupport()
|
|
| Method Summary | ||
|---|---|---|
protected void |
acknowledge(T action,
java.lang.Object returnValue)
Acknowledges the asynchronous dao that an action has been executed |
|
static int |
countWorkerThreadsLeft()
|
|
void |
initializeWorker(CallbackCaller<T> callbackCaller)
|
|
|
invoke(T callback)
Invokes a callback |
|
|
invokeNullable(T callback)
Invoke a nullable callback |
|
void |
invokeVoid(T callback)
Invokes a void callback |
|
boolean |
isInitialized()
|
|
void |
shutdown()
|
|
static void |
shutdownWorkerThreads()
|
|
static void |
verifyNoWorkerThreadsLeft()
Verifies that no worker threads have been left |
|
protected T |
waitForNextCallback()
Returns the next action |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@NotNull @NonNls public static final java.lang.String NAME_PREFIX
| Constructor Detail |
|---|
public AsyncCallSupport()
| Method Detail |
|---|
public void initializeWorker(@NotNull
CallbackCaller<T> callbackCaller)
public void shutdown()
@NotNull
public <R> R invoke(T callback)
throws AsynchroniousInvocationException
callback - the callback
AsynchroniousInvocationException
@Nullable
public <R> R invokeNullable(@NotNull
T callback)
throws AsynchroniousInvocationException
callback - the callback
AsynchroniousInvocationException
public void invokeVoid(@NotNull
T callback)
throws AsynchroniousInvocationException
callback - the callback
AsynchroniousInvocationExceptionpublic boolean isInitialized()
@NotNull
protected T waitForNextCallback()
throws java.lang.InterruptedException
java.lang.InterruptedException
protected void acknowledge(@NotNull
T action,
@Nullable
java.lang.Object returnValue)
action - the action that has been executedreturnValue - the return value (or exception)
public static void verifyNoWorkerThreadsLeft()
throws java.lang.InterruptedException
java.lang.InterruptedException
public static int countWorkerThreadsLeft()
throws java.lang.InterruptedException
java.lang.InterruptedException
public static void shutdownWorkerThreads()
throws java.lang.InterruptedException
java.lang.InterruptedException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||