org.jgroups.util
Class TimeScheduler3.Task

java.lang.Object
  extended by org.jgroups.util.TimeScheduler3.Task
All Implemented Interfaces:
java.lang.Comparable<java.util.concurrent.Delayed>, java.lang.Runnable, java.util.concurrent.Delayed, java.util.concurrent.Future
Direct Known Subclasses:
TimeScheduler3.RecurringTask
Enclosing class:
TimeScheduler3

protected static class TimeScheduler3.Task
extends java.lang.Object
implements java.lang.Runnable, java.util.concurrent.Delayed, java.util.concurrent.Future


Field Summary
protected  boolean cancelled
           
protected  boolean done
           
protected  long execution_time
           
protected  java.lang.Runnable runnable
           
 
Constructor Summary
TimeScheduler3.Task(java.lang.Runnable runnable)
           
TimeScheduler3.Task(java.lang.Runnable runnable, long initial_delay, java.util.concurrent.TimeUnit unit)
           
 
Method Summary
 boolean cancel(boolean mayInterruptIfRunning)
           
 int compareTo(java.util.concurrent.Delayed o)
           
 java.lang.Object get()
           
 java.lang.Object get(long timeout, java.util.concurrent.TimeUnit unit)
           
 long getDelay(java.util.concurrent.TimeUnit unit)
           
 java.lang.Runnable getRunnable()
           
 boolean isCancelled()
           
 boolean isDone()
           
 void run()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

runnable

protected final java.lang.Runnable runnable

execution_time

protected long execution_time

cancelled

protected volatile boolean cancelled

done

protected volatile boolean done
Constructor Detail

TimeScheduler3.Task

public TimeScheduler3.Task(java.lang.Runnable runnable)

TimeScheduler3.Task

public TimeScheduler3.Task(java.lang.Runnable runnable,
                           long initial_delay,
                           java.util.concurrent.TimeUnit unit)
Method Detail

getRunnable

public java.lang.Runnable getRunnable()

compareTo

public int compareTo(java.util.concurrent.Delayed o)
Specified by:
compareTo in interface java.lang.Comparable<java.util.concurrent.Delayed>

getDelay

public long getDelay(java.util.concurrent.TimeUnit unit)
Specified by:
getDelay in interface java.util.concurrent.Delayed

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-2012 Bela Ban / Red Hat. All Rights Reserved.