-
- All Implemented Interfaces:
-
com.facebook.imagepipeline.listener.RequestListener,com.facebook.imagepipeline.producers.ProducerListener
public class ForwardingRequestListener implements RequestListener
-
-
Constructor Summary
Constructors Constructor Description ForwardingRequestListener(Set<RequestListener> requestListeners)ForwardingRequestListener(Array<RequestListener> requestListeners)
-
Method Summary
Modifier and Type Method Description voidaddRequestListener(RequestListener requestListener)voidonRequestStart(ImageRequest request, Object callerContext, String requestId, boolean isPrefetch)Called when request is about to be submitted to the Orchestrator's executor queue. voidonProducerStart(String requestId, String producerName)Called whenever a producer starts processing unit of work. voidonProducerFinishWithSuccess(String requestId, String producerName, @Nullable() Map<String, String> extraMap)Called when a producer successfully finishes processing current unit of work. voidonProducerFinishWithFailure(String requestId, String producerName, Throwable t, @Nullable() Map<String, String> extraMap)Called when producer finishes processing current unit of work due to an error. voidonProducerFinishWithCancellation(String requestId, String producerName, @Nullable() Map<String, String> extraMap)Called once when producer finishes due to cancellation. voidonProducerEvent(String requestId, String producerName, String producerEventName)Called whenever an important producer-specific event occurs. voidonUltimateProducerReached(String requestId, String producerName, boolean successful)Called when the producer which can create the final result for a given request has completed. voidonRequestSuccess(ImageRequest request, String requestId, boolean isPrefetch)Called after successful completion of the request (all producers completed successfully). voidonRequestFailure(ImageRequest request, String requestId, Throwable throwable, boolean isPrefetch)Called after failure to complete the request (some producer failed). voidonRequestCancellation(String requestId)Called after the request is cancelled. booleanrequiresExtraMap(String id)-
-
Constructor Detail
-
ForwardingRequestListener
ForwardingRequestListener(Set<RequestListener> requestListeners)
-
ForwardingRequestListener
ForwardingRequestListener(Array<RequestListener> requestListeners)
-
-
Method Detail
-
addRequestListener
void addRequestListener(RequestListener requestListener)
-
onRequestStart
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 eventcallerContext- context of the caller of the requestrequestId- unique id generated automatically for each request submissionisPrefetch- whether the request is a prefetch or not
-
onProducerStart
void onProducerStart(String requestId, String producerName)
Called whenever a producer starts processing unit of work. This method might be called multipletimes, but between any two consecutive calls to onProducerStart onProducerFinishWithSuccesswill be called exactly once.
-
onProducerFinishWithSuccess
void onProducerFinishWithSuccess(String requestId, String producerName, @Nullable() Map<String, String> extraMap)
Called when a producer successfully finishes processing current unit of work.
- Parameters:
extraMap- Additional parameters about the producer.
-
onProducerFinishWithFailure
void onProducerFinishWithFailure(String requestId, String producerName, Throwable t, @Nullable() Map<String, String> extraMap)
Called when producer finishes processing current unit of work due to an error.
- Parameters:
extraMap- Additional parameters about the producer.
-
onProducerFinishWithCancellation
void onProducerFinishWithCancellation(String requestId, String producerName, @Nullable() Map<String, String> extraMap)
Called once when producer finishes due to cancellation.
- Parameters:
extraMap- Additional parameters about the producer.
-
onProducerEvent
void onProducerEvent(String requestId, String producerName, String producerEventName)
Called whenever an important producer-specific event occurs. This may only be called ifonProducerStart has been called, but corresponding onProducerFinishWith* method has not beencalled yet.
-
onUltimateProducerReached
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.
-
onRequestSuccess
void onRequestSuccess(ImageRequest request, String requestId, boolean isPrefetch)
Called after successful completion of the request (all producers completed successfully).
- Parameters:
request- which triggered the eventrequestId- unique id generated automatically for each request submissionisPrefetch- whether the request is a prefetch or not
-
onRequestFailure
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 eventrequestId- unique id generated automatically for each request submissionthrowable- cause of failureisPrefetch- whether the request is a prefetch or not
-
onRequestCancellation
void onRequestCancellation(String requestId)
Called after the request is cancelled.
- Parameters:
requestId- unique id generated automatically for each request submission
-
requiresExtraMap
boolean requiresExtraMap(String id)
-
-
-
-