Package com.hazelcast.scheduledexecutor
Class ScheduledTaskHandler
java.lang.Object
com.hazelcast.scheduledexecutor.ScheduledTaskHandler
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
Resource handler pointing to a
IScheduledFuture
. The handler is used to interact with the ScheduledFuture
in a IScheduledExecutorService
.
To access the handler, see IScheduledFuture.getHandler()
. To re-acquire access to a previously scheduled task,
having only the handler at hand, see IScheduledExecutorService.getScheduledFuture(ScheduledTaskHandler)
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract int
Returns the partition ID the task is associated with.abstract String
Return the name of the ScheduledExecutor this tasks is running on.abstract String
Returns the name of the task.abstract UUID
getUuid()
Returns the uuid of the member the task is associated with.abstract boolean
abstract boolean
static ScheduledTaskHandler
Reconstructs aScheduledTaskHandler
from a URN String.abstract String
toUrn()
Returns the String representation of the handler.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.hazelcast.nio.serialization.DataSerializable
readData, writeData
Methods inherited from interface com.hazelcast.nio.serialization.IdentifiedDataSerializable
getClassId, getFactoryId
-
Constructor Details
-
ScheduledTaskHandler
public ScheduledTaskHandler()
-
-
Method Details
-
getUuid
Returns the uuid of the member the task is associated with.The uuid will be
null
, if the task was scheduled to particular partition.- Returns:
- The uuid of the member
-
getPartitionId
public abstract int getPartitionId()Returns the partition ID the task is associated with.If the task was scheduled to a particular member, then the partition ID will have the value of -1.
- Returns:
- The partition ID
-
getSchedulerName
Return the name of the ScheduledExecutor this tasks is running on.- Returns:
- the name of the scheduler
-
getTaskName
Returns the name of the task.- Returns:
- the task name
-
isAssignedToPartition
public abstract boolean isAssignedToPartition()- Returns:
true
when the associated task was scheduled on a specific partition
-
isAssignedToMember
public abstract boolean isAssignedToMember()- Returns:
true
when the associated task was scheduled on a specific member in the cluster
-
toUrn
Returns the String representation of the handler.Useful for persisting and/or communicating this info. A
ScheduledTaskHandler
can be constructed again from the Urn String usingof(String)
- Returns:
- URN representing the handler in a String format
-
of
Reconstructs aScheduledTaskHandler
from a URN String.- Parameters:
urn
- The URN of the handler as retrieved fromtoUrn()
- Returns:
- A
ScheduledTaskHandler
instance that can be used to access the scheduled task
-