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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intReturns the partition ID the task is associated with.abstract StringReturn the name of the ScheduledExecutor this tasks is running on.abstract StringReturns the name of the task.abstract UUIDgetUuid()Returns the uuid of the member the task is associated with.abstract booleanabstract booleanstatic ScheduledTaskHandlerReconstructs aScheduledTaskHandlerfrom a URN String.abstract StringtoUrn()Returns the String representation of the handler.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hazelcast.nio.serialization.DataSerializable
readData, writeDataMethods 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:
truewhen the associated task was scheduled on a specific partition
-
isAssignedToMember
public abstract boolean isAssignedToMember()- Returns:
truewhen 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
ScheduledTaskHandlercan be constructed again from the Urn String usingof(String)- Returns:
- URN representing the handler in a String format
-
of
Reconstructs aScheduledTaskHandlerfrom a URN String.- Parameters:
urn- The URN of the handler as retrieved fromtoUrn()- Returns:
- A
ScheduledTaskHandlerinstance that can be used to access the scheduled task
-