org.jgroups.util

## Class HashedTimingWheel.MyTask

- java.lang.Object
- - org.jgroups.util.HashedTimingWheel.MyTask

- All Implemented Interfaces:
    java.lang.Runnable, java.util.concurrent.Future
  Enclosing class:
    HashedTimingWheel

      protected static class HashedTimingWheel.MyTask
      extends java.lang.Object
      implements java.util.concurrent.Future, java.lang.Runnable

  Simple task wrapper, always executed by at most 1 thread.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected boolean` | `cancelled`
    `protected boolean` | `done`
    `protected HashedTimingWheel.MyTask` | `next`
    `protected int` | `round`
    `protected java.lang.Runnable` | `task`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HashedTimingWheel.MyTask(java.lang.Runnable task, int round)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `cancel(boolean mayInterruptIfRunning)`
    `java.lang.Object` | `get()`
    `java.lang.Object` | `get(long timeout, java.util.concurrent.TimeUnit unit)`
    `int` | `getAndDecrementRound()`
    `int` | `getRound()`
    `boolean` | `isCancelled()`
    `boolean` | `isDone()`
    `void` | `run()`
    `void` | `setRound(int round)`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### task

          protected final java.lang.Runnable task

    - #### cancelled

          protected volatile boolean cancelled

    - #### done

          protected volatile boolean done

    - #### next

          protected HashedTimingWheel.MyTask next

    - #### round

          protected int round

  - ### Constructor Detail

    - #### HashedTimingWheel.MyTask

          public HashedTimingWheel.MyTask(java.lang.Runnable task,
                                  int round)

  - ### Method Detail

    - #### getRound

          public int getRound()

    - #### getAndDecrementRound

          public int getAndDecrementRound()

    - #### setRound

          public void setRound(int round)

    - #### cancel

          public boolean cancel(boolean mayInterruptIfRunning)

      Specified by:
        `cancel` in interface `java.util.concurrent.Future`

    - #### isCancelled

          public boolean isCancelled()

      Specified by:
        `isCancelled` in interface `java.util.concurrent.Future`

    - #### isDone

          public boolean isDone()

      Specified by:
        `isDone` in interface `java.util.concurrent.Future`

    - #### get

          public java.lang.Object get()
                               throws java.lang.InterruptedException,
                                      java.util.concurrent.ExecutionException

      Specified by:
        `get` in interface `java.util.concurrent.Future`
      Throws:
        `java.lang.InterruptedException`
        `java.util.concurrent.ExecutionException`

    - #### get

          public java.lang.Object get(long timeout,
                             java.util.concurrent.TimeUnit unit)
                               throws java.lang.InterruptedException,
                                      java.util.concurrent.ExecutionException,
                                      java.util.concurrent.TimeoutException

      Specified by:
        `get` in interface `java.util.concurrent.Future`
      Throws:
        `java.lang.InterruptedException`
        `java.util.concurrent.ExecutionException`
        `java.util.concurrent.TimeoutException`

    - #### run

          public void run()

      Specified by:
        `run` in interface `java.lang.Runnable`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

Copyright © 1998-2009 Bela Ban / Red Hat. All Rights Reserved.