public class ClientScheduledExecutorProxy extends ClientProxy implements IScheduledExecutorService
IScheduledExecutorService.name| Constructor and Description |
|---|
ClientScheduledExecutorProxy(String serviceName,
String objectId,
ClientContext context) |
| Modifier and Type | Method and Description |
|---|---|
<V> Map<Member,List<IScheduledFuture<V>>> |
getAllScheduledFutures()
Fetches and returns all scheduled (not disposed yet) futures from all members in the cluster.
|
<V> IScheduledFuture<V> |
getScheduledFuture(ScheduledTaskHandler handler)
Creates a new
IScheduledFuture from the given handler. |
protected ClientMessage |
invokeOnPartition(ClientMessage req) |
protected <T> T |
invokeOnPartition(ClientMessage clientMessage,
long invocationTimeoutSeconds) |
protected <T> ClientDelegatingFuture<T> |
invokeOnPartitionAsync(ClientMessage clientMessage,
ClientMessageDecoder clientMessageDecoder) |
protected <T> T |
invokeOnPartitionInterruptibly(ClientMessage clientMessage) |
protected <T> T |
invokeOnPartitionInterruptibly(ClientMessage clientMessage,
long invocationTimeoutSeconds) |
protected void |
onInitialize()
Called when proxy is created.
|
<V> IScheduledFuture<V> |
schedule(Callable<V> command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay.
|
IScheduledFuture<?> |
schedule(Runnable command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay.
|
IScheduledFuture<?> |
scheduleAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the
given period.
|
<V> Map<Member,IScheduledFuture<V>> |
scheduleOnAllMembers(Callable<V> command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay on all cluster
Members. |
Map<Member,IScheduledFuture<?>> |
scheduleOnAllMembers(Runnable command,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay on all cluster
Members. |
Map<Member,IScheduledFuture<?>> |
scheduleOnAllMembersAtFixedRate(Runnable command,
long initialDelay,
long period,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the
given period on all cluster
Members. |
<V> IScheduledFuture<V> |
scheduleOnKeyOwner(Callable<V> command,
Object key,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay on the partition owner of the given key.
|
IScheduledFuture<?> |
scheduleOnKeyOwner(Runnable command,
Object key,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay on the partition owner of the given key.
|
IScheduledFuture<?> |
scheduleOnKeyOwnerAtFixedRate(Runnable command,
Object key,
long initialDelay,
long period,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the
given period on the partition owner of the given key.
|
<V> IScheduledFuture<V> |
scheduleOnMember(Callable<V> command,
Member member,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay at the given
Member. |
IScheduledFuture<?> |
scheduleOnMember(Runnable command,
Member member,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay at the given
Member. |
IScheduledFuture<?> |
scheduleOnMemberAtFixedRate(Runnable command,
Member member,
long initialDelay,
long period,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the
given period at the given
Member. |
<V> Map<Member,IScheduledFuture<V>> |
scheduleOnMembers(Callable<V> command,
Collection<Member> members,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay on all
Members given. |
Map<Member,IScheduledFuture<?>> |
scheduleOnMembers(Runnable command,
Collection<Member> members,
long delay,
TimeUnit unit)
Creates and executes a one-shot action that becomes enabled after the given delay on all
Members given. |
Map<Member,IScheduledFuture<?>> |
scheduleOnMembersAtFixedRate(Runnable command,
Collection<Member> members,
long initialDelay,
long period,
TimeUnit unit)
Creates and executes a periodic action that becomes enabled first after the given initial delay, and subsequently with the
given period on all
Members given. |
void |
shutdown()
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
|
String |
toString() |
deregisterListener, destroy, destroyLocally, destroyRemotely, equals, getClient, getConnectedServerVersion, getContext, getDistributedObjectName, getId, getName, getPartitionKey, getSerializationService, getServiceName, hashCode, invoke, invoke, invokeOnAddress, invokeOnPartition, invokeOnPartitionInterruptibly, onDestroy, onShutdown, postDestroy, preDestroy, registerListener, setContext, toData, toObjectclone, finalize, getClass, notify, notifyAll, wait, wait, waitdestroy, getName, getPartitionKey, getServiceNamepublic ClientScheduledExecutorProxy(String serviceName, String objectId, ClientContext context)
public IScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit)
IScheduledExecutorServiceschedule in interface IScheduledExecutorServicecommand - the task to executedelay - the time from now to delay executionunit - the time unit of the delay parameterget() method will return null upon completionpublic <V> IScheduledFuture<V> schedule(Callable<V> command, long delay, TimeUnit unit)
IScheduledExecutorServiceschedule in interface IScheduledExecutorServicecommand - the task to executedelay - the time from now to delay executionunit - the time unit of the delay parameterget() method will return null upon completionpublic IScheduledFuture<?> scheduleAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
IScheduledExecutorServiceinitialDelay then initialDelay+period, then initialDelay + 2 * period, and so on. If any execution of this task takes longer than its period, then subsequent
execution will be skipped. If any execution of the task encounters an exception, subsequent executions are suppressed.
Otherwise, the task will only terminate via cancellation or termination of the executor.scheduleAtFixedRate in interface IScheduledExecutorServicecommand - the task to executeinitialDelay - the time to delay first executionperiod - the period between successive executionsunit - the time unit of the initialDelay and period parametersget() method will throw an
exception upon cancellationpublic IScheduledFuture<?> scheduleOnMember(Runnable command, Member member, long delay, TimeUnit unit)
IScheduledExecutorServiceMember.scheduleOnMember in interface IScheduledExecutorServicecommand - the task to executemember - the member to execute the taskdelay - the time from now to delay executionunit - the time unit of the delay parameterget() method will return null upon completionpublic <V> IScheduledFuture<V> scheduleOnMember(Callable<V> command, Member member, long delay, TimeUnit unit)
IScheduledExecutorServiceMember.scheduleOnMember in interface IScheduledExecutorServicecommand - the task to executemember - the member to execute the taskdelay - the time from now to delay executionunit - the time unit of the delay parameterget() method will return null upon completionpublic IScheduledFuture<?> scheduleOnMemberAtFixedRate(Runnable command, Member member, long initialDelay, long period, TimeUnit unit)
IScheduledExecutorServiceMember. Executions will commence after initialDelay then initialDelay+period, then initialDelay + 2 * period, and so on. If any execution of this task takes longer than
its period, then subsequent execution will be skipped. If any execution of the task encounters an exception,
subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the
executor.scheduleOnMemberAtFixedRate in interface IScheduledExecutorServicecommand - the task to executemember - the member to execute the taskinitialDelay - the time to delay first executionperiod - the period between successive executionsunit - the time unit of the initialDelay and period parametersget() method will throw an
exception upon cancellationpublic IScheduledFuture<?> scheduleOnKeyOwner(Runnable command, Object key, long delay, TimeUnit unit)
IScheduledExecutorServicescheduleOnKeyOwner in interface IScheduledExecutorServicecommand - the task to executekey - the key to identify the partition owner, which will execute the taskdelay - the time from now to delay executionunit - the time unit of the delay parameterget() method will return null upon completionpublic <V> IScheduledFuture<V> scheduleOnKeyOwner(Callable<V> command, Object key, long delay, TimeUnit unit)
IScheduledExecutorServicescheduleOnKeyOwner in interface IScheduledExecutorServicecommand - the task to executekey - the key to identify the partition owner, which will execute the taskdelay - the time from now to delay executionunit - the time unit of the delay parameterget() method will return null upon completionpublic IScheduledFuture<?> scheduleOnKeyOwnerAtFixedRate(Runnable command, Object key, long initialDelay, long period, TimeUnit unit)
IScheduledExecutorServiceinitialDelay then initialDelay+period, then initialDelay + 2 * period, and so on. If any execution of this task takes longer than
its period, then subsequent execution will be skipped. If any execution of the task encounters an exception,
subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the
executor.scheduleOnKeyOwnerAtFixedRate in interface IScheduledExecutorServicecommand - the task to executekey - the key to identify the partition owner, which will execute the taskinitialDelay - the time to delay first executionperiod - the period between successive executionsunit - the time unit of the initialDelay and period parametersget() method will throw an
exception upon cancellationpublic Map<Member,IScheduledFuture<?>> scheduleOnAllMembers(Runnable command, long delay, TimeUnit unit)
IScheduledExecutorServiceMembers.
Note: In the event of Member leaving the cluster, for whatever reason, the task is lost. If a new member is added, the task will not get scheduled there automatically.
scheduleOnAllMembers in interface IScheduledExecutorServicecommand - the task to executedelay - the time from now to delay executionunit - the time unit of the delay parameterget() method will return null upon completionpublic <V> Map<Member,IScheduledFuture<V>> scheduleOnAllMembers(Callable<V> command, long delay, TimeUnit unit)
IScheduledExecutorServiceMembers.
Note: In the event of Member leaving the cluster, for whatever reason, the task is lost. If a new member is added, the task will not get scheduled there automatically.
scheduleOnAllMembers in interface IScheduledExecutorServicecommand - the task to executedelay - the time from now to delay executionunit - the time unit of the delay parameterget() method will return null upon completionpublic Map<Member,IScheduledFuture<?>> scheduleOnAllMembersAtFixedRate(Runnable command, long initialDelay, long period, TimeUnit unit)
IScheduledExecutorServiceMembers. Executions will commence after initialDelay then initialDelay+period, then initialDelay + 2 * period, and so on. If any execution of this task takes longer than
its period, then subsequent execution will be skipped. If any execution of the task encounters an exception,
subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the
executor.
Note: In the event of Member leaving the cluster, for whatever reason, the task is lost. If a new member is added, the task will not get scheduled there automatically.
scheduleOnAllMembersAtFixedRate in interface IScheduledExecutorServicecommand - the task to executeinitialDelay - the time to delay first executionperiod - the period between successive executionsunit - the time unit of the initialDelay and period parametersget() method will throw an
exception upon cancellationpublic Map<Member,IScheduledFuture<?>> scheduleOnMembers(Runnable command, Collection<Member> members, long delay, TimeUnit unit)
IScheduledExecutorServiceMembers given.
Note: In the event of Member leaving the cluster, for whatever reason, the task is lost.
scheduleOnMembers in interface IScheduledExecutorServicecommand - the task to executemembers - the collections of members - where to execute the taskdelay - the time from now to delay executionunit - the time unit of the delay parameterget() method will return null upon completionpublic <V> Map<Member,IScheduledFuture<V>> scheduleOnMembers(Callable<V> command, Collection<Member> members, long delay, TimeUnit unit)
IScheduledExecutorServiceMembers given.
Note: In the event of Member leaving the cluster, for whatever reason, the task is lost.
scheduleOnMembers in interface IScheduledExecutorServicecommand - the task to executemembers - the collections of members - where to execute the taskdelay - the time from now to delay executionunit - the time unit of the delay parameterget() method will return null upon completionpublic Map<Member,IScheduledFuture<?>> scheduleOnMembersAtFixedRate(Runnable command, Collection<Member> members, long initialDelay, long period, TimeUnit unit)
IScheduledExecutorServiceMembers given. Executions will commence after initialDelay then initialDelay+period, then initialDelay + 2 * period, and so on. If any execution of this task takes longer than
its period, then subsequent execution will be skipped. If any execution of the task encounters an exception,
subsequent executions are suppressed. Otherwise, the task will only terminate via cancellation or termination of the
executor.
Note: In the event of Member leaving the cluster, for whatever reason, the task is lost.
scheduleOnMembersAtFixedRate in interface IScheduledExecutorServicecommand - the task to executemembers - the collections of members - where to execute the taskinitialDelay - the time to delay first executionperiod - the period between successive executionsunit - the time unit of the initialDelay and period parametersget() method will throw an
exception upon cancellationpublic <V> IScheduledFuture<V> getScheduledFuture(ScheduledTaskHandler handler)
IScheduledExecutorServiceIScheduledFuture from the given handler. This is useful in case your member node or client from which
the original scheduling happened, went down, and now you want to access the ScheduledFuture again.getScheduledFuture in interface IScheduledExecutorServiceV - The return type of callable taskshandler - The handler of the task as found from IScheduledFuture.getHandler()IScheduledFuture from the given handler.public <V> Map<Member,List<IScheduledFuture<V>>> getAllScheduledFutures()
IScheduledExecutorServiceMap.getAllScheduledFutures in interface IScheduledExecutorServiceMap with Member keys and a List of IScheduledFuture found for this scheduler.public void shutdown()
IScheduledExecutorServiceThis method does not wait for previously submitted tasks to complete execution.
shutdown in interface IScheduledExecutorServiceprotected void onInitialize()
ClientProxyonInitialize in class ClientProxyprotected ClientMessage invokeOnPartition(ClientMessage req)
protected <T> T invokeOnPartitionInterruptibly(ClientMessage clientMessage) throws InterruptedException
InterruptedExceptionprotected <T> ClientDelegatingFuture<T> invokeOnPartitionAsync(ClientMessage clientMessage, ClientMessageDecoder clientMessageDecoder)
protected <T> T invokeOnPartition(ClientMessage clientMessage, long invocationTimeoutSeconds)
protected <T> T invokeOnPartitionInterruptibly(ClientMessage clientMessage, long invocationTimeoutSeconds) throws InterruptedException
InterruptedExceptionCopyright © 2020 Hazelcast, Inc.. All Rights Reserved.