public abstract class

StatefulProducerRunnable

extends StatefulRunnable<T>
java.lang.Object
   ↳ com.facebook.common.executors.StatefulRunnable<T>
     ↳ com.facebook.imagepipeline.producers.StatefulProducerRunnable<T>

Class Overview

StatefulRunnable intended to be used by producers.

Class implements common functionality related to handling producer instrumentation and resource management.

Summary

[Expand]
Inherited Constants
From class com.facebook.common.executors.StatefulRunnable
[Expand]
Inherited Fields
From class com.facebook.common.executors.StatefulRunnable
Public Constructors
StatefulProducerRunnable(Consumer<T> consumer, ProducerListener2 producerListener, ProducerContext producerContext, String producerName)
Protected Methods
abstract void disposeResult(T result)
Called after onSuccess callback completes in order to dispose the result.
Map<String, String> getExtraMapOnCancellation()
Create extra map for cancellation
Map<String, String> getExtraMapOnFailure(Exception exception)
Create extra map for exception
Map<String, String> getExtraMapOnSuccess(T result)
Create extra map for result
void onCancellation()
Called when the runnable is cancelled.
void onFailure(Exception e)
Called if exception occurred during computation.
void onSuccess(T result)
Called after computing result successfully.
[Expand]
Inherited Methods
From class com.facebook.common.executors.StatefulRunnable
From class java.lang.Object
From interface java.lang.Runnable

Public Constructors

public StatefulProducerRunnable (Consumer<T> consumer, ProducerListener2 producerListener, ProducerContext producerContext, String producerName)

Protected Methods

protected abstract void disposeResult (T result)

Called after onSuccess callback completes in order to dispose the result.

protected Map<String, String> getExtraMapOnCancellation ()

Create extra map for cancellation

protected Map<String, String> getExtraMapOnFailure (Exception exception)

Create extra map for exception

protected Map<String, String> getExtraMapOnSuccess (T result)

Create extra map for result

protected void onCancellation ()

Called when the runnable is cancelled.

protected void onFailure (Exception e)

Called if exception occurred during computation.

protected void onSuccess (T result)

Called after computing result successfully.