Class ClusteredExecutorService.CESRunnableFuture<V>
- java.lang.Object
-
- com.oracle.coherence.concurrent.executor.subscribers.internal.FutureSubscriber<V>
-
- com.oracle.coherence.concurrent.executor.ClusteredExecutorService.CESRunnableFuture<V>
-
- Type Parameters:
V- value type for encapsulated task
- All Implemented Interfaces:
Task.Subscriber<V>,com.tangosol.util.function.Remote.Runnable,Serializable,Comparable<Delayed>,Runnable,Delayed,Future<V>,RunnableFuture<V>,RunnableScheduledFuture<V>,ScheduledFuture<V>
- Enclosing class:
- ClusteredExecutorService
protected static class ClusteredExecutorService.CESRunnableFuture<V> extends FutureSubscriber<V> implements RunnableScheduledFuture<V>, com.tangosol.util.function.Remote.Runnable
CESRunnableFutureis a holder for the Callable or Runnable which will be executed byClusteredExecutorService.execute(Remote.Runnable). Callingrun()is not supported.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanf_fRunnableprotected Callable<V>m_callableThe encapsulatedCallable.protected Runnablem_runnableThe encapsulatedRunnable.protected Vm_runnableValueThe value to return on completion of the encapsulatedRunnable.-
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 CESRunnableFuture(Runnable runnable, V value)Construct aClusteredExecutorService.CESRunnableFuturewhich encapsulates the passed inRunnable.CESRunnableFuture(Callable<V> callable)Construct aClusteredExecutorService.CESRunnableFuturewhich encapsulates the passed inCallable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Delayed o)Callable<V>getCallable()Get the encapsulatedCallable.longgetDelay(TimeUnit unit)RunnablegetRunnable()Get the encapsulatedRunnable.VgetRunnableValue()Get the value to be returned on completion of the encapsulatedRunnable.booleanisCallable()Return whether aCallableis encapsulated.booleanisPeriodic()booleanisRunnable()Return whether aRunnableis encapsulated.voidrun()-
Methods inherited from class com.oracle.coherence.concurrent.executor.subscribers.internal.FutureSubscriber
cancel, get, get, getCompleted, hasResult, isCancelled, isDone, isSubscribed, onComplete, onError, onNext, onSubscribe, setCoordinator
-
-
-
-
Constructor Detail
-
CESRunnableFuture
public CESRunnableFuture(Callable<V> callable)
Construct aClusteredExecutorService.CESRunnableFuturewhich encapsulates the passed inCallable.- Parameters:
callable- theCallableto encapsulate
-
-
Method Detail
-
isRunnable
public boolean isRunnable()
Return whether aRunnableis encapsulated.- Returns:
- whether a
Runnableis encapsulated
-
isCallable
public boolean isCallable()
Return whether aCallableis encapsulated.- Returns:
- whether a
Callableis encapsulated
-
getCallable
public Callable<V> getCallable()
Get the encapsulatedCallable.- Returns:
- the encapsulated
Callable
-
getRunnable
public Runnable getRunnable()
Get the encapsulatedRunnable.- Returns:
- the encapsulated
Runnable
-
getRunnableValue
public V getRunnableValue()
Get the value to be returned on completion of the encapsulatedRunnable. May benull.- Returns:
- the value to be returned on completion of the
encapsulated
Runnable
-
run
public void run()
- Specified by:
runin interfaceRunnable- Specified by:
runin interfaceRunnableFuture<V>
-
isPeriodic
public boolean isPeriodic()
- Specified by:
isPeriodicin interfaceRunnableScheduledFuture<V>
-
compareTo
public int compareTo(Delayed o)
- Specified by:
compareToin interfaceComparable<V>
-
-