Package com.hazelcast.durableexecutor
Interface DurableExecutorService
- All Superinterfaces:
- DistributedObject,- Executor,- ExecutorService
Durable implementation of 
ExecutorService.
 DurableExecutor provides additional methods like executing tasks on a member who is owner of a specific key
 DurableExecutor also provides a way to retrieve the result of an execution with the given taskId.- 
Method SummaryModifier and TypeMethodDescriptionvoiddisposeResult(long taskId) Disposes the result with the given taskIdvoidexecuteOnKeyOwner(Runnable command, Object key) Executes a task on the owner of the specified key.<T> Future<T>retrieveAndDisposeResult(long taskId) Retrieves and disposes the result with the given taskId<T> Future<T>retrieveResult(long taskId) Retrieves the result with the given taskIdSubmits a Runnable task for execution and returns a Future representing that task.<T> DurableExecutorServiceFuture<T>Submits a Runnable task for execution and returns a Future representing that task.<T> DurableExecutorServiceFuture<T>Submits a value-returning task for execution and returns a Future representing the pending results of the task.submitToKeyOwner(Runnable task, Object key) Submits a task to the owner of the specified key and returns a Future representing that task.<T> DurableExecutorServiceFuture<T>submitToKeyOwner(Callable<T> task, Object key) Submits a task to the owner of the specified key and returns a Future representing that task.Methods inherited from interface com.hazelcast.core.DistributedObjectdestroy, getDestroyContextForTenant, getName, getPartitionKey, getServiceNameMethods inherited from interface java.util.concurrent.ExecutorServiceawaitTermination, invokeAll, invokeAll, invokeAny, invokeAny, isShutdown, isTerminated, shutdown, shutdownNow
- 
Method Details- 
submitSubmits a value-returning task for execution and returns a Future representing the pending results of the task. The Future'sgetmethod will return the task's result upon successful completion.If you would like to immediately block waiting for a task, you can use constructions of the form result = exec.submit(aCallable).get();Note: The Executorsclass includes a set of methods that can convert some other common closure-like objects, for example,PrivilegedActiontoCallableform so they can be submitted.- Specified by:
- submitin interface- ExecutorService
- Type Parameters:
- T- the type of the task's result
- Parameters:
- task- the task to submit
- Returns:
- a Future representing pending completion of the task
- Throws:
- RejectedExecutionException- if the task cannot be scheduled for execution
- NullPointerException- if the task is null
 
- 
submitSubmits a Runnable task for execution and returns a Future representing that task. The Future'sgetmethod will return the given result upon successful completion.- Specified by:
- submitin interface- ExecutorService
- Type Parameters:
- T- the type of the result
- Parameters:
- task- the task to submit
- result- the result to return
- Returns:
- a Future representing pending completion of the task
- Throws:
- RejectedExecutionException- if the task cannot be scheduled for execution
- NullPointerException- if the task is null
 
- 
submitSubmits a Runnable task for execution and returns a Future representing that task. The Future'sgetmethod will returnnullupon successful completion.- Specified by:
- submitin interface- ExecutorService
- Parameters:
- task- the task to submit
- Returns:
- a Future representing pending completion of the task
- Throws:
- RejectedExecutionException- if the task cannot be scheduled for execution
- NullPointerException- if the task is null
 
- 
retrieveResultRetrieves the result with the given taskId- Type Parameters:
- T- the type of the task's result
- Parameters:
- taskId- combination of partitionId and sequence
- Returns:
- a Future representing pending completion of the task
 
- 
disposeResultvoid disposeResult(long taskId) Disposes the result with the given taskId- Parameters:
- taskId- combination of partitionId and sequence
 
- 
retrieveAndDisposeResultRetrieves and disposes the result with the given taskId- Type Parameters:
- T- the type of the task's result
- Parameters:
- taskId- combination of partitionId and sequence
- Returns:
- a Future representing pending completion of the task
 
- 
executeOnKeyOwnerExecutes a task on the owner of the specified key.- Parameters:
- command- a task executed on the owner of the specified key
- key- the specified key
 
- 
submitToKeyOwner<T> DurableExecutorServiceFuture<T> submitToKeyOwner(@Nonnull Callable<T> task, @Nonnull Object key) Submits a task to the owner of the specified key and returns a Future representing that task.- Type Parameters:
- T- the return type of the task
- Parameters:
- task- task submitted to the owner of the specified key
- key- the specified key
- Returns:
- a Future representing pending completion of the task
 
- 
submitToKeyOwnerSubmits a task to the owner of the specified key and returns a Future representing that task.- Parameters:
- task- task submitted to the owner of the specified key
- key- the specified key
- Returns:
- a Future representing pending completion of the task
 
 
-