public final class ClientDurableExecutorServiceProxy extends ClientProxy implements DurableExecutorService
DurableExecutorService
.name
Constructor and Description |
---|
ClientDurableExecutorServiceProxy(String serviceName,
String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
void |
disposeResult(long taskId)
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.
|
<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() |
protected void |
onInitialize()
Called when proxy is created.
|
<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 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.
|
deregisterListener, destroy, equals, getClient, getContext, getDistributedObjectName, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invoke, invokeOnPartition, invokeOnPartitionInterruptibly, onDestroy, onShutdown, postDestroy, preDestroy, registerListener, setContext, toData, toObject
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
destroy, getName, getPartitionKey, getServiceName
protected void onInitialize()
ClientProxy
onInitialize
in class ClientProxy
public <T> Future<T> retrieveResult(long taskId)
DurableExecutorService
retrieveResult
in interface DurableExecutorService
T
- the type of the task's resulttaskId
- combination of partitionId and sequencepublic void disposeResult(long taskId)
DurableExecutorService
disposeResult
in interface DurableExecutorService
taskId
- combination of partitionId and sequencepublic <T> Future<T> retrieveAndDisposeResult(long taskId)
DurableExecutorService
retrieveAndDisposeResult
in interface DurableExecutorService
T
- the type of the task's resulttaskId
- 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> 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> 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> 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> 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
Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.