public class ScheduledExecutorServiceProxy extends AbstractDistributedObject<DistributedScheduledExecutorService> implements IScheduledExecutorService
PARTITIONING_STRATEGY
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.
|
String |
getName()
Returns the unique name for this DistributedObject.
|
IScheduledFuture<?> |
getScheduledFuture(ScheduledTaskHandler handler)
Creates a new
IScheduledFuture from the given handler. |
String |
getServiceName()
Returns the service name for this object.
|
<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
Member s. |
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
Member s. |
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
Member s. |
<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
Member s 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
Member s 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
Member s given. |
void |
shutdown()
Initiates an orderly shutdown in which previously submitted tasks are executed, but no new tasks will be accepted.
|
destroy, equals, getDistributedObjectName, getNameAsPartitionAwareData, getNodeEngine, getOperationService, getPartitionId, getPartitionKey, getService, hashCode, invalidate, invokeOnPartition, isClusterVersionEqualTo, isClusterVersionGreaterOrEqual, isClusterVersionGreaterThan, isClusterVersionLessOrEqual, isClusterVersionLessThan, isClusterVersionUnknown, isClusterVersionUnknownOrGreaterOrEqual, isClusterVersionUnknownOrGreaterThan, isClusterVersionUnknownOrLessOrEqual, isClusterVersionUnknownOrLessThan, postDestroy, preDestroy, throwNotActiveException, toData, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
destroy, getPartitionKey
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<DistributedScheduledExecutorService>
public IScheduledFuture schedule(Runnable command, long delay, TimeUnit unit)
IScheduledExecutorService
schedule
in interface IScheduledExecutorService
command
- 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)
IScheduledExecutorService
schedule
in interface IScheduledExecutorService
command
- 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)
IScheduledExecutorService
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.scheduleAtFixedRate
in interface IScheduledExecutorService
command
- 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)
IScheduledExecutorService
Member
.scheduleOnMember
in interface IScheduledExecutorService
command
- 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)
IScheduledExecutorService
Member
.scheduleOnMember
in interface IScheduledExecutorService
command
- 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)
IScheduledExecutorService
Member
. 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 IScheduledExecutorService
command
- 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)
IScheduledExecutorService
scheduleOnKeyOwner
in interface IScheduledExecutorService
command
- 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)
IScheduledExecutorService
scheduleOnKeyOwner
in interface IScheduledExecutorService
command
- 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)
IScheduledExecutorService
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.scheduleOnKeyOwnerAtFixedRate
in interface IScheduledExecutorService
command
- 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)
IScheduledExecutorService
Member
s.
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 IScheduledExecutorService
command
- 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)
IScheduledExecutorService
Member
s.
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 IScheduledExecutorService
command
- 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)
IScheduledExecutorService
Member
s. 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 IScheduledExecutorService
command
- 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)
IScheduledExecutorService
Member
s given.
Note: In the event of Member leaving the cluster, for whatever reason, the task is lost.
scheduleOnMembers
in interface IScheduledExecutorService
command
- 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)
IScheduledExecutorService
Member
s given.
Note: In the event of Member leaving the cluster, for whatever reason, the task is lost.
scheduleOnMembers
in interface IScheduledExecutorService
command
- 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)
IScheduledExecutorService
Member
s 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 IScheduledExecutorService
command
- 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 IScheduledFuture<?> getScheduledFuture(ScheduledTaskHandler handler)
IScheduledExecutorService
IScheduledFuture
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 IScheduledExecutorService
handler
- The handler of the task as found from IScheduledFuture.getHandler()
IScheduledFuture
from the given handler.public <V> Map<Member,List<IScheduledFuture<V>>> getAllScheduledFutures()
IScheduledExecutorService
Map
.getAllScheduledFutures
in interface IScheduledExecutorService
Map
with Member
keys and a List of IScheduledFuture
found for this scheduler.public void shutdown()
IScheduledExecutorService
This method does not wait for previously submitted tasks to complete execution.
shutdown
in interface IScheduledExecutorService
Copyright © 2020 Hazelcast, Inc.. All Rights Reserved.