public class

ForwardingRequestListener

extends Object
implements RequestListener
java.lang.Object
   ↳ com.facebook.imagepipeline.listener.ForwardingRequestListener

Summary

Public Constructors
ForwardingRequestListener(Set<RequestListener> requestListeners)
ForwardingRequestListener(RequestListener... requestListeners)
Public Methods
void addRequestListener(RequestListener requestListener)
void onProducerEvent(String requestId, String producerName, String producerEventName)
Called whenever an important producer-specific event occurs.
void onProducerFinishWithCancellation(String requestId, String producerName, Map<String, String> extraMap)
Called once when producer finishes due to cancellation.
void onProducerFinishWithFailure(String requestId, String producerName, Throwable t, Map<String, String> extraMap)
Called when producer finishes processing current unit of work due to an error.
void onProducerFinishWithSuccess(String requestId, String producerName, Map<String, String> extraMap)
Called when a producer successfully finishes processing current unit of work.
void onProducerStart(String requestId, String producerName)
Called whenever a producer starts processing unit of work.
void onRequestCancellation(String requestId)
Called after the request is cancelled.
void onRequestFailure(ImageRequest request, String requestId, Throwable throwable, boolean isPrefetch)
Called after failure to complete the request (some producer failed).
void onRequestStart(ImageRequest request, Object callerContext, String requestId, boolean isPrefetch)
Called when request is about to be submitted to the Orchestrator's executor queue.
void onRequestSuccess(ImageRequest request, String requestId, boolean isPrefetch)
Called after successful completion of the request (all producers completed successfully).
void onUltimateProducerReached(String requestId, String producerName, boolean successful)
Called when the producer which can create the final result for a given request has completed.
boolean requiresExtraMap(String id)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.facebook.imagepipeline.listener.RequestListener
From interface com.facebook.imagepipeline.producers.ProducerListener

Public Constructors

public ForwardingRequestListener (Set<RequestListener> requestListeners)

public ForwardingRequestListener (RequestListener... requestListeners)

Public Methods

public void addRequestListener (RequestListener requestListener)

public void onProducerEvent (String requestId, String producerName, String producerEventName)

Called whenever an important producer-specific event occurs. This may only be called if onProducerStart has been called, but corresponding onProducerFinishWith* method has not been called yet.

public void onProducerFinishWithCancellation (String requestId, String producerName, Map<String, String> extraMap)

Called once when producer finishes due to cancellation.

Parameters
extraMap Additional parameters about the producer. This map is immutable and will throw an exception if attempts are made to modify it.

public void onProducerFinishWithFailure (String requestId, String producerName, Throwable t, Map<String, String> extraMap)

Called when producer finishes processing current unit of work due to an error.

Parameters
extraMap Additional parameters about the producer. This map is immutable and will throw an exception if attempts are made to modify it.

public void onProducerFinishWithSuccess (String requestId, String producerName, Map<String, String> extraMap)

Called when a producer successfully finishes processing current unit of work.

Parameters
extraMap Additional parameters about the producer. This map is immutable and will throw an exception if attempts are made to modify it.

public void onProducerStart (String requestId, String producerName)

Called whenever a producer starts processing unit of work. This method might be called multiple times, but between any two consecutive calls to onProducerStart onProducerFinishWithSuccess will be called exactly once.

public void onRequestCancellation (String requestId)

Called after the request is cancelled.

Parameters
requestId unique id generated automatically for each request submission

public void onRequestFailure (ImageRequest request, String requestId, Throwable throwable, boolean isPrefetch)

Called after failure to complete the request (some producer failed).

Parameters
request which triggered the event
requestId unique id generated automatically for each request submission
throwable cause of failure
isPrefetch whether the request is a prefetch or not

public void onRequestStart (ImageRequest request, Object callerContext, String requestId, boolean isPrefetch)

Called when request is about to be submitted to the Orchestrator's executor queue.

Parameters
request which triggered the event
callerContext context of the caller of the request
requestId unique id generated automatically for each request submission
isPrefetch whether the request is a prefetch or not

public void onRequestSuccess (ImageRequest request, String requestId, boolean isPrefetch)

Called after successful completion of the request (all producers completed successfully).

Parameters
request which triggered the event
requestId unique id generated automatically for each request submission
isPrefetch whether the request is a prefetch or not

public void onUltimateProducerReached (String requestId, String producerName, boolean successful)

Called when the producer which can create the final result for a given request has completed.

This can be used to determine which producer was best able to satisfy the request.

public boolean requiresExtraMap (String id)