public interface

ProducerListener2

com.facebook.imagepipeline.producers.ProducerListener2
Known Indirect Subclasses

Class Overview

Instrumentation for Producers.

Producer implementations should call these methods when appropriate to notify other components interested in the execution progress.

Summary

Public Methods
abstract void onProducerEvent(ProducerContext producerContext, String producerName, String eventName)
Called whenever an important producer-specific event occurs.
abstract void onProducerFinishWithCancellation(ProducerContext producerContext, String producerName, Map<String, String> extraMap)
Called once when producer finishes due to cancellation.
abstract void onProducerFinishWithFailure(ProducerContext producerContext, String producerName, Throwable t, Map<String, String> extraMap)
Called when producer finishes processing current unit of work due to an error.
abstract void onProducerFinishWithSuccess(ProducerContext producerContext, String producerName, Map<String, String> extraMap)
Called when a producer successfully finishes processing current unit of work.
abstract void onProducerStart(ProducerContext producerContext, String producerName)
Called whenever a producer starts processing unit of work.
abstract void onUltimateProducerReached(ProducerContext producerContext, String producerName, boolean successful)
Called when the producer which can create the final result for a given request has completed.
abstract boolean requiresExtraMap(ProducerContext producerContext, String producerName)

Public Methods

public abstract void onProducerEvent (ProducerContext producerContext, String producerName, String eventName)

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 abstract void onProducerFinishWithCancellation (ProducerContext producerContext, 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 abstract void onProducerFinishWithFailure (ProducerContext producerContext, 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 abstract void onProducerFinishWithSuccess (ProducerContext producerContext, 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 abstract void onProducerStart (ProducerContext producerContext, 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 abstract void onUltimateProducerReached (ProducerContext producerContext, 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 abstract boolean requiresExtraMap (ProducerContext producerContext, String producerName)

Returns
  • true if listener makes use of extra map