Class AnyFutureSubscriber<T>
- java.lang.Object
-
- com.oracle.coherence.concurrent.executor.subscribers.internal.FutureSubscriber<T>
-
- com.oracle.coherence.concurrent.executor.subscribers.internal.AnyFutureSubscriber<T>
-
- Type Parameters:
T- the non-null type of result to be subscribed by the subscriber.
- All Implemented Interfaces:
Task.Subscriber<T>,Future<T>
public class AnyFutureSubscriber<T> extends FutureSubscriber<T>
AFutureSubscriberwhich notifies a monitor object when the task completes or fails.- Since:
- 21.12
- Author:
- bo, lh
-
-
Field Summary
Fields Modifier and Type Field Description protected Objectf_oMonitorObject monitor to track whether the task is done either via completion or exception.-
Fields inherited from class com.oracle.coherence.concurrent.executor.subscribers.internal.FutureSubscriber
f_fCompleted, f_fError, m_coordinator, m_result
-
-
Constructor Summary
Constructors Constructor Description AnyFutureSubscriber(Object oCompletionMonitor)Constructs aAnyFutureSubscriber.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonComplete()Invoked by aTask.Coordinatorwhen it is known that no additionalTask.Subscribermethod invocations will occur or has already been terminated by an error.voidonError(Throwable throwable)Invoked by aTask.Coordinatorwhen an unrecoverable error was encountered, after which no otherTask.Subscribermethods are invoked.-
Methods inherited from class com.oracle.coherence.concurrent.executor.subscribers.internal.FutureSubscriber
cancel, get, get, getCompleted, hasResult, isCancelled, isDone, isSubscribed, onNext, onSubscribe, setCoordinator
-
-
-
-
Field Detail
-
f_oMonitor
protected final Object f_oMonitor
Object monitor to track whether the task is done either via completion or exception.
-
-
Constructor Detail
-
AnyFutureSubscriber
public AnyFutureSubscriber(Object oCompletionMonitor)
Constructs aAnyFutureSubscriber.- Parameters:
oCompletionMonitor- object monitor to track whether the task is done either via completion or exception
-
-
Method Detail
-
onComplete
public void onComplete()
Description copied from interface:Task.SubscriberInvoked by aTask.Coordinatorwhen it is known that no additionalTask.Subscribermethod invocations will occur or has already been terminated by an error.After this method is invoked no other
Task.Subscribermethods will be called.If this method throws an exception, the
Task.Subscriberwill be closed.- Specified by:
onCompletein interfaceTask.Subscriber<T>- Overrides:
onCompletein classFutureSubscriber<T>
-
onError
public void onError(Throwable throwable)
Description copied from interface:Task.SubscriberInvoked by aTask.Coordinatorwhen an unrecoverable error was encountered, after which no otherTask.Subscribermethods are invoked.If this method throws an exception, the
Task.Subscriberwill be closed.- Specified by:
onErrorin interfaceTask.Subscriber<T>- Overrides:
onErrorin classFutureSubscriber<T>- Parameters:
throwable- the error
-
-