public interface Task<V,C>
UIThreadWorker
with the difference that in case
of an execution exception the failed(Throwable)
method is invoked and done(Object)
is not.Modifier and Type | Interface and Description |
---|---|
static class |
Task.Mode |
static class |
Task.State |
Modifier and Type | Method and Description |
---|---|
void |
done(V value)
This method is invoked once
execute(Tracker) has successfully finished
and is called on the UI thread. |
V |
execute(Tracker<C> tracker)
This method implements the long-running work and returns a result.
|
void |
failed(Throwable cause)
This method is invoked if
execute(Tracker) threw an exception. |
String |
getId()
A id that identifies this task (or a group of tasks).
|
Task.Mode |
getMode() |
void |
process(List<C> chunks)
Calls going to
Tracker.publish(Object[]) from within
execute(Tracker) are routed to this method. |
String getId()
TaskListener
on this id that will receive events solely for tasks with a certain id.V execute(Tracker<C> tracker) throws Exception
tracker
- to publish intermediate resultsException
void done(V value)
execute(Tracker)
has successfully finished
and is called on the UI thread.value
- void failed(Throwable cause)
execute(Tracker)
threw an exception. This method
is executed on the UI thread.cause
- void process(List<C> chunks)
Tracker.publish(Object[])
from within
execute(Tracker)
are routed to this method. This method
is invoked on the UI thread.chunks
- Task.Mode getMode()