Package com.hazelcast.scheduledexecutor
Class ScheduledTaskHandler
- java.lang.Object
-
- com.hazelcast.scheduledexecutor.ScheduledTaskHandler
-
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
public abstract class ScheduledTaskHandler extends java.lang.Object implements IdentifiedDataSerializable
Resource handler pointing to aIScheduledFuture
. The handler is used to interact with theScheduledFuture
in aIScheduledExecutorService
.To access the handler, see
IScheduledFuture.getHandler()
. To re-acquire access to a previously scheduled task, having only the handler at hand, seeIScheduledExecutorService.getScheduledFuture(ScheduledTaskHandler)
-
-
Constructor Summary
Constructors Constructor Description ScheduledTaskHandler()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract int
getPartitionId()
Returns the partition ID the task is associated with.abstract java.lang.String
getSchedulerName()
Return the name of the ScheduledExecutor this tasks is running on.abstract java.lang.String
getTaskName()
Returns the name of the task.abstract java.util.UUID
getUuid()
Returns the uuid of the member the task is associated with.abstract boolean
isAssignedToMember()
abstract boolean
isAssignedToPartition()
static ScheduledTaskHandler
of(java.lang.String urn)
Reconstructs aScheduledTaskHandler
from a URN String.abstract java.lang.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
-
-
-
-
Method Detail
-
getUuid
public abstract java.util.UUID 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
public abstract java.lang.String getSchedulerName()
Return the name of the ScheduledExecutor this tasks is running on.- Returns:
- the name of the scheduler
-
getTaskName
public abstract java.lang.String 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
public abstract java.lang.String 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
public static ScheduledTaskHandler of(java.lang.String urn)
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
-
-