Top Fields Constructors Methods
org.testng.internal.thread.graph

public Class TestNGFutureTask<T>

extends FutureTask<IWorker<T>>
implements IWorker<T>
Class Inheritance
All Implemented Interfaces
org.testng.thread.IWorker, java.lang.Comparable, java.lang.Runnable
Imports
java.util.List, java.util.concurrent.ExecutionException, .FutureTask, java.util.function.BiConsumer, org.testng.thread.IWorker

Field Summary

Modifier and TypeField and Description
private final BiConsumer<IWorker<T>, Throwable>
private final IWorker<T>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
compareTo(IWorker<T>
the object to be compared.
o
)

Implements java.lang.Comparable.compareTo.

Compares this object with the specified object for order.
protected void
done()

Overrides java.util.concurrent.FutureTask.done.

Protected method invoked when this task transitions to state isDone (whether normally or via cancellation).
public int
public List<T>
public long
public void
Inherited from java.util.concurrent.FutureTask:
cancelexceptionNowgetgetisCancelledisDoneresultNowrunAndResetsetsetExceptionstatetoString

Field Detail

callbackback to summary
private final BiConsumer<IWorker<T>, Throwable> callback
workerback to summary
private final IWorker<T> worker

Constructor Detail

TestNGFutureTaskback to summary
public TestNGFutureTask(IWorker<T> worker, BiConsumer<IWorker<T>, Throwable> callback)

Method Detail

compareToback to summary
public int compareTo(IWorker<T> o)

Implements java.lang.Comparable.compareTo.

Doc from java.lang.Comparable.compareTo.

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

The implementor must ensure signum(x.compareTo(y)) == -signum(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception if and only if y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y) > 0 && y.compareTo(z) > 0) implies x.compareTo(z) > 0.

Finally, the implementor must ensure that x.compareTo(y)==0 implies that signum(x.compareTo(z)) == signum(y.compareTo(z)), for all z.

Parameters
o:IWorker<T>

the object to be compared.

Returns:int

a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Annotations
@Override
doneback to summary
protected void done()

Overrides java.util.concurrent.FutureTask.done.

Doc from java.util.concurrent.FutureTask.done.

Protected method invoked when this task transitions to state isDone (whether normally or via cancellation). The default implementation does nothing. Subclasses may override this method to invoke completion callbacks or perform bookkeeping. Note that you can query status inside the implementation of this method to determine whether this task has been cancelled.

Annotations
@Override
getPriorityback to summary
public int getPriority()

Implements org.testng.thread.IWorker.getPriority.

Returns:int

Doc from org.testng.thread.IWorker.getPriority.

the priority of this task.

Annotations
@Override
getTasksback to summary
public List<T> getTasks()

Implements org.testng.thread.IWorker.getTasks.

Returns:List<T>

Doc from org.testng.thread.IWorker.getTasks.

list of tasks this worker is working on.

Annotations
@Override
getTimeOutback to summary
public long getTimeOut()

Implements org.testng.thread.IWorker.getTimeOut.

Returns:long

Doc from org.testng.thread.IWorker.getTimeOut.

the maximum time allowed for the worker to complete the task.

Annotations
@Override
runback to summary
public void run()

Overrides java.util.concurrent.FutureTask.run.

Implements java.lang.Runnable.run, java.util.concurrent.RunnableFuture.run.

Doc from java.lang.Runnable.run.

Runs this operation.

Annotations
@Override