public class

BaseProducerContext

extends Object
implements ProducerContext
java.lang.Object
   ↳ com.facebook.imagepipeline.producers.BaseProducerContext
Known Direct Subclasses

Class Overview

ProducerContext that can be cancelled. Exposes low level API to manipulate state of the ProducerContext.

Summary

Public Constructors
BaseProducerContext(ImageRequest imageRequest, String id, ProducerListener producerListener, Object callerContext, ImageRequest.RequestLevel lowestPermittedRequestLevel, boolean isPrefetch, boolean isIntermediateResultExpected, Priority priority)
Public Methods
void addCallbacks(ProducerContextCallbacks callbacks)
Adds callbacks to the set of callbacks that are executed at various points during the processing of a request.
static void callOnCancellationRequested(List<ProducerContextCallbacks> callbacks)
Calls onCancellationRequested on each element of the list.
static void callOnIsIntermediateResultExpectedChanged(List<ProducerContextCallbacks> callbacks)
Calls onIsIntermediateResultExpected on each element of the list.
static void callOnIsPrefetchChanged(List<ProducerContextCallbacks> callbacks)
Calls onIsPrefetchChanged on each element of the list.
static void callOnPriorityChanged(List<ProducerContextCallbacks> callbacks)
Calls onPriorityChanged on each element of the list.
void cancel()
Cancels the request processing and calls appropriate callbacks.
synchronized List<ProducerContextCallbacks> cancelNoCallbacks()
Marks this ProducerContext as cancelled.
Object getCallerContext()
String getId()
ImageRequest getImageRequest()
ProducerListener getListener()
ImageRequest.RequestLevel getLowestPermittedRequestLevel()
synchronized Priority getPriority()
synchronized boolean isCancelled()
synchronized boolean isIntermediateResultExpected()
synchronized boolean isPrefetch()
synchronized List<ProducerContextCallbacks> setIsIntermediateResultExpectedNoCallbacks(boolean isIntermediateResultExpected)
Changes isIntermediateResultExpected property.
synchronized List<ProducerContextCallbacks> setIsPrefetchNoCallbacks(boolean isPrefetch)
Changes isPrefetch property.
synchronized List<ProducerContextCallbacks> setPriorityNoCallbacks(Priority priority)
Changes priority.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.facebook.imagepipeline.producers.ProducerContext

Public Constructors

public BaseProducerContext (ImageRequest imageRequest, String id, ProducerListener producerListener, Object callerContext, ImageRequest.RequestLevel lowestPermittedRequestLevel, boolean isPrefetch, boolean isIntermediateResultExpected, Priority priority)

Public Methods

public void addCallbacks (ProducerContextCallbacks callbacks)

Adds callbacks to the set of callbacks that are executed at various points during the processing of a request.

Parameters
callbacks callbacks to be executed

public static void callOnCancellationRequested (List<ProducerContextCallbacks> callbacks)

Calls onCancellationRequested on each element of the list. Does nothing if list == null

public static void callOnIsIntermediateResultExpectedChanged (List<ProducerContextCallbacks> callbacks)

Calls onIsIntermediateResultExpected on each element of the list. Does nothing if list == null

public static void callOnIsPrefetchChanged (List<ProducerContextCallbacks> callbacks)

Calls onIsPrefetchChanged on each element of the list. Does nothing if list == null

public static void callOnPriorityChanged (List<ProducerContextCallbacks> callbacks)

Calls onPriorityChanged on each element of the list. Does nothing if list == null

public void cancel ()

Cancels the request processing and calls appropriate callbacks.

public synchronized List<ProducerContextCallbacks> cancelNoCallbacks ()

Marks this ProducerContext as cancelled.

This method does not call any callbacks. Instead, caller of this method is responsible for iterating over returned list and calling appropriate method on each callback object.

Returns
  • list of callbacks if the value actually changes, null otherwise

public Object getCallerContext ()

public String getId ()

public ImageRequest getImageRequest ()

public ProducerListener getListener ()

public ImageRequest.RequestLevel getLowestPermittedRequestLevel ()

public synchronized Priority getPriority ()

public synchronized boolean isCancelled ()

public synchronized boolean isIntermediateResultExpected ()

public synchronized boolean isPrefetch ()

public synchronized List<ProducerContextCallbacks> setIsIntermediateResultExpectedNoCallbacks (boolean isIntermediateResultExpected)

Changes isIntermediateResultExpected property.

This method does not call any callbacks. Instead, caller of this method is responsible for iterating over returned list and calling appropriate method on each callback object.

Returns
  • list of callbacks if the value actually changes, null otherwise
See Also
  • #callOnIntermediateResultChanged

public synchronized List<ProducerContextCallbacks> setIsPrefetchNoCallbacks (boolean isPrefetch)

Changes isPrefetch property.

This method does not call any callbacks. Instead, caller of this method is responsible for iterating over returned list and calling appropriate method on each callback object.

Returns
  • list of callbacks if the value actually changes, null otherwise

public synchronized List<ProducerContextCallbacks> setPriorityNoCallbacks (Priority priority)

Changes priority.

This method does not call any callbacks. Instead, caller of this method is responsible for iterating over returned list and calling appropriate method on each callback object.

Returns
  • list of callbacks if the value actually changes, null otherwise