GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
com.jogamp.common.util.TaskBase Class Referenceabstract

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

Inheritance diagram for com.jogamp.common.util.TaskBase:
Collaboration diagram for com.jogamp.common.util.TaskBase:

Public Member Functions

final Thread getExecutionThread ()
 Returns the execution thread or null if not yet run(). More...
 
final Object getSyncObject ()
 Return the synchronization object if any. More...
 
final void setAttachment (final Object o)
 Attach a custom object to this task. More...
 
final Object getAttachment ()
 Return the attachment object if any. More...
 
abstract void run ()
 
final void flush (final Throwable t)
 Simply flush this task and notify a waiting executor. More...
 
final boolean isInQueue ()
 
final boolean isExecuted ()
 
final boolean isFlushed ()
 
final boolean hasWaiter ()
 
final Throwable getThrowable ()
 
final long getTimestampCreate ()
 
final long getTimestampBeforeExec ()
 
final long getTimestampAfterExec ()
 
final long getDurationInQueue ()
 
final long getDurationInExec ()
 
final long getDurationTotal ()
 
String toString ()
 

Protected Member Functions

 TaskBase (final Object syncObject, final boolean catchExceptions, final PrintStream exceptionOut)
 
final String getExceptionOutIntro ()
 
final void printSourceTrace ()
 

Protected Attributes

final Object syncObject
 
final boolean catchExceptions
 
final PrintStream exceptionOut
 
final Throwable sourceStack
 
Object attachment
 
Throwable runnableException
 
long tCreated
 
long tStarted
 
volatile long tExecuted
 
volatile boolean isExecuted
 
volatile boolean isFlushed
 
volatile Thread execThread
 

Detailed Description

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

Definition at line 39 of file TaskBase.java.

Constructor & Destructor Documentation

◆ TaskBase()

com.jogamp.common.util.TaskBase.TaskBase ( final Object  syncObject,
final boolean  catchExceptions,
final PrintStream  exceptionOut 
)
protected
Parameters
syncObjectThe synchronization object if caller wait until runnable execution is completed, or null if waiting is not desired.
catchExceptionsInfluence an occurring exception during runnable execution. If true, the exception is silenced and can be retrieved via getThrowable(), otherwise the exception is thrown.
exceptionOutIf not null, exceptions are written to this PrintStream.

Definition at line 69 of file TaskBase.java.

Member Function Documentation

◆ flush()

final void com.jogamp.common.util.TaskBase.flush ( final Throwable  t)

Simply flush this task and notify a waiting executor.

The executor which might have been blocked until notified will be unblocked and the task removed from the queue.

Parameters
toptional Throwable to be assigned for later getThrowable() query in case of an error.
See also
isFlushed()
isInQueue()

Definition at line 136 of file TaskBase.java.

Here is the call graph for this function:

◆ getAttachment()

final Object com.jogamp.common.util.TaskBase.getAttachment ( )

Return the attachment object if any.

See also
setAttachment(Object)

Definition at line 119 of file TaskBase.java.

◆ getDurationInExec()

final long com.jogamp.common.util.TaskBase.getDurationInExec ( )

Definition at line 177 of file TaskBase.java.

Here is the caller graph for this function:

◆ getDurationInQueue()

final long com.jogamp.common.util.TaskBase.getDurationInQueue ( )

Definition at line 176 of file TaskBase.java.

Here is the caller graph for this function:

◆ getDurationTotal()

final long com.jogamp.common.util.TaskBase.getDurationTotal ( )

Definition at line 178 of file TaskBase.java.

Here is the caller graph for this function:

◆ getExceptionOutIntro()

final String com.jogamp.common.util.TaskBase.getExceptionOutIntro ( )
protected

Definition at line 82 of file TaskBase.java.

Here is the caller graph for this function:

◆ getExecutionThread()

final Thread com.jogamp.common.util.TaskBase.getExecutionThread ( )

Returns the execution thread or null if not yet run().

Since
2.3.2

Definition at line 95 of file TaskBase.java.

◆ getSyncObject()

final Object com.jogamp.common.util.TaskBase.getSyncObject ( )

Return the synchronization object if any.

See also
#RunnableTask(Runnable, Object, boolean)

Definition at line 103 of file TaskBase.java.

Here is the caller graph for this function:

◆ getThrowable()

final Throwable com.jogamp.common.util.TaskBase.getThrowable ( )
Returns
A thrown exception while execution of the user action, if any and if caught
See also
#RunnableTask(Runnable, Object, boolean)

Definition at line 171 of file TaskBase.java.

Here is the caller graph for this function:

◆ getTimestampAfterExec()

final long com.jogamp.common.util.TaskBase.getTimestampAfterExec ( )

Definition at line 175 of file TaskBase.java.

◆ getTimestampBeforeExec()

final long com.jogamp.common.util.TaskBase.getTimestampBeforeExec ( )

Definition at line 174 of file TaskBase.java.

◆ getTimestampCreate()

final long com.jogamp.common.util.TaskBase.getTimestampCreate ( )

Definition at line 173 of file TaskBase.java.

◆ hasWaiter()

final boolean com.jogamp.common.util.TaskBase.hasWaiter ( )
Returns
True if invoking thread waits until done, ie a notifyObject was passed, otherwise false;

Definition at line 165 of file TaskBase.java.

Here is the caller graph for this function:

◆ isExecuted()

final boolean com.jogamp.common.util.TaskBase.isExecuted ( )
Returns
True if executed, otherwise false;

Definition at line 154 of file TaskBase.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isFlushed()

final boolean com.jogamp.common.util.TaskBase.isFlushed ( )
Returns
True if flushed, otherwise false;

Definition at line 159 of file TaskBase.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInQueue()

final boolean com.jogamp.common.util.TaskBase.isInQueue ( )
Returns
!isExecuted() && !isFlushed()

Definition at line 149 of file TaskBase.java.

Here is the caller graph for this function:

◆ printSourceTrace()

final void com.jogamp.common.util.TaskBase.printSourceTrace ( )
protected

Definition at line 85 of file TaskBase.java.

Here is the caller graph for this function:

◆ run()

abstract void com.jogamp.common.util.TaskBase.run ( )
abstract

◆ setAttachment()

final void com.jogamp.common.util.TaskBase.setAttachment ( final Object  o)

Attach a custom object to this task.

Useful to piggybag further information, ie tag a task final.

Definition at line 111 of file TaskBase.java.

◆ toString()

String com.jogamp.common.util.TaskBase.toString ( )

Definition at line 181 of file TaskBase.java.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ attachment

Object com.jogamp.common.util.TaskBase.attachment
protected

Definition at line 53 of file TaskBase.java.

◆ catchExceptions

final boolean com.jogamp.common.util.TaskBase.catchExceptions
protected

Definition at line 49 of file TaskBase.java.

◆ exceptionOut

final PrintStream com.jogamp.common.util.TaskBase.exceptionOut
protected

Definition at line 50 of file TaskBase.java.

◆ execThread

volatile Thread com.jogamp.common.util.TaskBase.execThread
protected

Definition at line 59 of file TaskBase.java.

◆ isExecuted

volatile boolean com.jogamp.common.util.TaskBase.isExecuted
protected

Definition at line 57 of file TaskBase.java.

◆ isFlushed

volatile boolean com.jogamp.common.util.TaskBase.isFlushed
protected

Definition at line 58 of file TaskBase.java.

◆ runnableException

Throwable com.jogamp.common.util.TaskBase.runnableException
protected

Definition at line 54 of file TaskBase.java.

◆ sourceStack

final Throwable com.jogamp.common.util.TaskBase.sourceStack
protected

Definition at line 51 of file TaskBase.java.

◆ syncObject

final Object com.jogamp.common.util.TaskBase.syncObject
protected

Definition at line 48 of file TaskBase.java.

◆ tCreated

long com.jogamp.common.util.TaskBase.tCreated
protected

Definition at line 55 of file TaskBase.java.

◆ tExecuted

volatile long com.jogamp.common.util.TaskBase.tExecuted
protected

Definition at line 56 of file TaskBase.java.

◆ tStarted

long com.jogamp.common.util.TaskBase.tStarted
protected

Definition at line 55 of file TaskBase.java.


The documentation for this class was generated from the following file: