public class DurableExecutorServiceProxy extends AbstractDistributedObject<DistributedDurableExecutorService> implements DurableExecutorService
PARTITIONING_STRATEGY
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
void |
disposeResult(long uniqueId)
Disposes the result with the given taskId
|
void |
execute(Runnable task) |
void |
executeOnKeyOwner(Runnable task,
Object key)
Executes a task on the owner of the specified key.
|
String |
getName()
Returns the unique name for this DistributedObject.
|
String |
getServiceName()
Returns the service name for this object.
|
<T> List<Future<T>> |
invokeAll(Collection<? extends Callable<T>> tasks) |
<T> List<Future<T>> |
invokeAll(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit) |
<T> T |
invokeAny(Collection<? extends Callable<T>> tasks) |
<T> T |
invokeAny(Collection<? extends Callable<T>> tasks,
long timeout,
TimeUnit unit) |
boolean |
isShutdown() |
boolean |
isTerminated() |
<T> Future<T> |
retrieveAndDisposeResult(long uniqueId)
Retrieves and disposes the result with the given taskId
|
<T> Future<T> |
retrieveResult(long uniqueId)
Retrieves the result with the given taskId
|
void |
shutdown() |
List<Runnable> |
shutdownNow() |
<T> DurableExecutorServiceFuture<T> |
submit(Callable<T> task)
Submits a value-returning task for execution and returns a
Future representing the pending results of the task.
|
DurableExecutorServiceFuture<?> |
submit(Runnable task)
Submits a Runnable task for execution and returns a Future
representing that task.
|
<T> DurableExecutorServiceFuture<T> |
submit(Runnable task,
T result)
Submits a Runnable task for execution 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.
|
DurableExecutorServiceFuture<?> |
submitToKeyOwner(Runnable task,
Object key)
Submits a task to the owner of the specified key and returns a Future
representing that task.
|
protected void |
throwNotActiveException() |
destroy, equals, getDistributedObjectName, getNameAsPartitionAwareData, getNodeEngine, getOperationService, getPartitionId, getPartitionKey, getService, hashCode, invalidate, invokeOnPartition, postDestroy, preDestroy, toData, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
destroy, getPartitionKey
public <T> Future<T> retrieveResult(long uniqueId)
DurableExecutorService
retrieveResult
in interface DurableExecutorService
T
- the type of the task's resultuniqueId
- combination of partitionId and sequencepublic void disposeResult(long uniqueId)
DurableExecutorService
disposeResult
in interface DurableExecutorService
uniqueId
- combination of partitionId and sequencepublic <T> Future<T> retrieveAndDisposeResult(long uniqueId)
DurableExecutorService
retrieveAndDisposeResult
in interface DurableExecutorService
T
- the type of the task's resultuniqueId
- combination of partitionId and sequencepublic void executeOnKeyOwner(Runnable task, Object key)
DurableExecutorService
executeOnKeyOwner
in interface DurableExecutorService
task
- a task executed on the owner of the specified keykey
- the specified keypublic <T> DurableExecutorServiceFuture<T> submit(Runnable task, T result)
DurableExecutorService
get
method will
return the given result upon successful completion.submit
in interface DurableExecutorService
submit
in interface ExecutorService
T
- the type of the resulttask
- the task to submitresult
- the result to returnpublic DurableExecutorServiceFuture<?> submit(Runnable task)
DurableExecutorService
get
method will
return null
upon successful completion.submit
in interface DurableExecutorService
submit
in interface ExecutorService
task
- the task to submitpublic <T> DurableExecutorServiceFuture<T> submit(Callable<T> task)
DurableExecutorService
get
method 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 Executors
class includes a set of methods
that can convert some other common closure-like objects,
for example, PrivilegedAction
to
Callable
form so they can be submitted.
submit
in interface DurableExecutorService
submit
in interface ExecutorService
T
- the type of the task's resulttask
- the task to submitpublic <T> DurableExecutorServiceFuture<T> submitToKeyOwner(Callable<T> task, Object key)
DurableExecutorService
submitToKeyOwner
in interface DurableExecutorService
task
- task submitted to the owner of the specified keykey
- the specified keypublic DurableExecutorServiceFuture<?> submitToKeyOwner(Runnable task, Object key)
DurableExecutorService
submitToKeyOwner
in interface DurableExecutorService
task
- task submitted to the owner of the specified keykey
- the specified keypublic <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks) throws InterruptedException
invokeAll
in interface ExecutorService
InterruptedException
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException
invokeAll
in interface ExecutorService
InterruptedException
public <T> T invokeAny(Collection<? extends Callable<T>> tasks) throws InterruptedException, ExecutionException
invokeAny
in interface ExecutorService
InterruptedException
ExecutionException
public <T> T invokeAny(Collection<? extends Callable<T>> tasks, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
invokeAny
in interface ExecutorService
InterruptedException
ExecutionException
TimeoutException
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
awaitTermination
in interface ExecutorService
InterruptedException
public void shutdown()
shutdown
in interface ExecutorService
public List<Runnable> shutdownNow()
shutdownNow
in interface ExecutorService
public boolean isShutdown()
isShutdown
in interface ExecutorService
public boolean isTerminated()
isTerminated
in interface ExecutorService
public String getName()
DistributedObject
DistributedObjectUtil.getName(DistributedObject)
because this might be also a PrefixedDistributedObject
.getName
in interface DistributedObject
public String getServiceName()
DistributedObject
getServiceName
in interface DistributedObject
getServiceName
in class AbstractDistributedObject<DistributedDurableExecutorService>
protected void throwNotActiveException()
throwNotActiveException
in class AbstractDistributedObject<DistributedDurableExecutorService>
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.