PriorityAsyncTask

public abstract class PriorityAsyncTask extends AsyncTask<Params, Progress, Result>
implements Dependency<Task> PriorityProvider Task DelegateProvider

AsyncTask that provides priority for PriorityThreadPoolExecutor

Inherited Field Summary

io.fabric.sdk.android.services.concurrency.AsyncTask
public static final Executor SERIAL_EXECUTOR An Executor that executes tasks one at a time in serial order.
public static final Executor THREAD_POOL_EXECUTOR An Executor that can be used to execute tasks in parallel.

Public Constructor Summary

Public Method Summary

void
boolean
areDependenciesMet()
Returns true when the dependencies have been met
int
compareTo(Object another)
final void
executeOnExecutor(ExecutorService exec, Params... params)
<T extends Dependency<Task> & PriorityProvider & Task> T
getDelegate()
Returns a delegate to be used when the parent class of the implementor can extend from a PriorityTask
Collection<Task>
getDependencies()
fulfilled before the Dependency instance.
Throwable
Priority
boolean
void
setError(Throwable throwable)
void
setFinished(boolean finished)
Marks Task as finished

Inherited Method Summary

io.fabric.sdk.android.services.concurrency.AsyncTask
final boolean
cancel(boolean mayInterruptIfRunning)

Attempts to cancel execution of this task.

abstract Result
doInBackground(Params... params)
Override this method to perform a computation on a background thread.
final AsyncTask<Params, Progress, Result>
execute(Params... params)
Executes the task with the specified parameters.
static void
execute(Runnable runnable)
Convenience version of execute(Object) for use with a simple Runnable object.
final AsyncTask<Params, Progress, Result>
executeOnExecutor(Executor exec, Params... params)
Executes the task with the specified parameters.
final Result
get(long timeout, TimeUnit unit)
Waits if necessary for at most the given time for the computation to complete, and then retrieves its result.
final Result
get()
Waits if necessary for the computation to complete, and then retrieves its result.
final AsyncTask.Status
getStatus()
Returns the current status of this task.
final boolean
isCancelled()
Returns true if this task was cancelled before it completed normally.
void
onCancelled()

Applications should preferably override onCancelled(Object).

void
onCancelled(Result result)

Runs on the UI thread after cancel(boolean) is invoked and doInBackground(Object[]) has finished.

void
onPostExecute(Result result)

Runs on the UI thread after doInBackground(Params...).

void
onPreExecute()
Runs on the UI thread before doInBackground(Params...).
void
onProgressUpdate(Progress... values)
Runs on the UI thread after publishProgress(Progress...) is invoked.
final void
publishProgress(Progress... values)
This method can be invoked from doInBackground(Params...) to publish updates on the UI thread while the background computation is still running.
Object
clone()
boolean
equals(Object arg0)
void
finalize()
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()
io.fabric.sdk.android.services.concurrency.Dependency
abstract void
addDependency(Task dependable)
Assign dependency on specified T.
abstract boolean
areDependenciesMet()
Returns true when the dependencies have been met
abstract Collection<Task>
getDependencies()
fulfilled before the Dependency instance.
io.fabric.sdk.android.services.concurrency.PriorityProvider
abstract Priority
io.fabric.sdk.android.services.concurrency.Task
abstract Throwable
abstract boolean
abstract void
setError(Throwable throwable)
abstract void
setFinished(boolean finished)
Marks Task as finished
io.fabric.sdk.android.services.concurrency.DelegateProvider
abstract <T extends Dependency<Task> & PriorityProvider & Task> T
getDelegate()
Returns a delegate to be used when the parent class of the implementor can extend from a PriorityTask
abstract int
compareTo(T arg0)

Public Constructors

public PriorityAsyncTask ()

Public Methods

public void addDependency (Task task)

Adds a Dependency

Parameters
task
Throws
IllegalStateException if @{link Fabric} has not been initialized.

public boolean areDependenciesMet ()

Returns true when the dependencies have been met

public int compareTo (Object another)

Parameters
another

public final void executeOnExecutor (ExecutorService exec, Params... params)

Parameters
exec
params

public T getDelegate ()

Returns a delegate to be used when the parent class of the implementor can extend from a PriorityTask

public Collection<Task> getDependencies ()

fulfilled before the Dependency instance.

Returns
  • Collection of T to be fulfilled before the Dependency instance.

public Throwable getError ()

public Priority getPriority ()

public boolean isFinished ()

public void setError (Throwable throwable)

Parameters
throwable

public void setFinished (boolean finished)

Marks Task as finished

Parameters
finished