-
public interface ProducerListenerInstrumentation for Producers.
Implementation of a producer should call these methods when appropriate to notify other components interested in execution progress.
-
-
Method Summary
Modifier and Type Method Description abstract voidonProducerStart(String requestId, String producerName)Called whenever a producer starts processing unit of work. abstract voidonProducerEvent(String requestId, String producerName, String eventName)Called whenever an important producer-specific event occurs. abstract voidonProducerFinishWithSuccess(String requestId, String producerName, @Nullable() Map<String, String> extraMap)Called when a producer successfully finishes processing current unit of work. abstract 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. abstract voidonProducerFinishWithCancellation(String requestId, String producerName, @Nullable() Map<String, String> extraMap)Called once when producer finishes due to cancellation. abstract voidonUltimateProducerReached(String requestId, String producerName, boolean successful)Called when the producer which can create the final result for a given request has completed. abstract booleanrequiresExtraMap(String requestId)-
-
Method Detail
-
onProducerStart
abstract 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.
-
onProducerEvent
abstract void onProducerEvent(String requestId, String producerName, String eventName)
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.
-
onProducerFinishWithSuccess
abstract 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
abstract 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
abstract 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.
-
onUltimateProducerReached
abstract 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.
-
requiresExtraMap
abstract boolean requiresExtraMap(String requestId)
-
-
-
-