Class ScheduledTaskHandler

java.lang.Object
com.hazelcast.scheduledexecutor.ScheduledTaskHandler
All Implemented Interfaces:
DataSerializable, IdentifiedDataSerializable

public abstract class ScheduledTaskHandler extends Object implements 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 Details

    • ScheduledTaskHandler

      public ScheduledTaskHandler()
  • Method Details

    • getUuid

      public abstract 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 String getSchedulerName()
      Return the name of the ScheduledExecutor this tasks is running on.
      Returns:
      the name of the scheduler
    • getTaskName

      public abstract 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 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 using of(String)

      Returns:
      URN representing the handler in a String format
    • of

      public static ScheduledTaskHandler of(String urn)
      Reconstructs a ScheduledTaskHandler from a URN String.
      Parameters:
      urn - The URN of the handler as retrieved from toUrn()
      Returns:
      A ScheduledTaskHandler instance that can be used to access the scheduled task