com.jogamp.common.util
Class RunnableTask

java.lang.Object
  extended by com.jogamp.common.util.RunnableTask
All Implemented Interfaces:
Runnable

public class RunnableTask
extends Object
implements Runnable

Helper class to provide a Runnable queue implementation with a Runnable wrapper which notifies after execution for the invokeAndWait() semantics.


Constructor Summary
RunnableTask(Runnable runnable)
           
RunnableTask(Runnable runnable, Object notifyObject)
           
RunnableTask(Runnable runnable, Object notifyObject, boolean catchExceptions)
           
 
Method Summary
 Object getAttachment()
           
 long getDurationInExec()
           
 long getDurationInQueue()
           
 long getDurationTotal()
           
 Runnable getRunnable()
           
 Throwable getThrowable()
           
 long getTimestampAfterExec()
           
 long getTimestampBeforeExec()
           
 long getTimestampCreate()
           
 boolean isExecuted()
           
 void run()
           
 void setAttachment(Object o)
          Attach a custom object to this task.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RunnableTask

public RunnableTask(Runnable runnable)

RunnableTask

public RunnableTask(Runnable runnable,
                    Object notifyObject)

RunnableTask

public RunnableTask(Runnable runnable,
                    Object notifyObject,
                    boolean catchExceptions)
Method Detail

getRunnable

public Runnable getRunnable()

setAttachment

public void setAttachment(Object o)
Attach a custom object to this task. Useful to piggybag further information, ie tag a task final.


getAttachment

public Object getAttachment()

run

public void run()
Specified by:
run in interface Runnable

isExecuted

public boolean isExecuted()
Returns:
True if executed, otherwise false;

getThrowable

public Throwable getThrowable()
Returns:
A Throwable thrown while execution if any

getTimestampCreate

public long getTimestampCreate()

getTimestampBeforeExec

public long getTimestampBeforeExec()

getTimestampAfterExec

public long getTimestampAfterExec()

getDurationInQueue

public long getDurationInQueue()

getDurationInExec

public long getDurationInExec()

getDurationTotal

public long getDurationTotal()

toString

public String toString()
Overrides:
toString in class Object