Interface IRequestUpdateListener

All Superinterfaces:
Comparable<IRequestUpdateListener>
All Known Implementing Classes:
CircuitBreaker, Generator, IntervalGenerator, LIMBOGenerator, MicroserviceInstance, NetworkPattern, RetryManager

public interface IRequestUpdateListener
extends Comparable<IRequestUpdateListener>
Interface for listening for request updates.
Each implementing class can be registered at a RequestSender to receive updates of all its send messages.

This interface only contains optional Methods.

See Also:
RequestSender
  • Method Details

    • onRequestFailed

      default boolean onRequestFailed​(Request request, desmoj.core.simulator.TimeInstant when, RequestFailedReason reason)
      Listener for the failure of the sending process. This could for example be due to the receiving service not being available, the request being canceled or timed out. Provides a reference to the failed request.
      Parameters:
      when - time of this event
      request - request that triggered this event
      reason - reason why the request failed
      Returns:
      true if the request was terminally handled (consumed) by this instance
    • onRequestArrivalAtTarget

      default boolean onRequestArrivalAtTarget​(Request request, desmoj.core.simulator.TimeInstant when)
      Listener for the successful completion of the sending process. Provides a reference to the successfully arrived request.
      Parameters:
      when - time of this event
      request - request that triggered this event
      Returns:
      true if the request was terminally handled (consumed) by this instance
    • onRequestSend

      default boolean onRequestSend​(Request request, desmoj.core.simulator.TimeInstant when)
      Listener for the send-off of a request. Provides the send request.
      Parameters:
      when - time of this event
      request - request that triggered this event
      Returns:
      true if the request was terminally handled (consumed) by this instance
    • onRequestResultArrivedAtRequester

      default boolean onRequestResultArrivedAtRequester​(Request request, desmoj.core.simulator.TimeInstant when)
      Listener for the successful receiving of the answer of a request.
      Parameters:
      when - time of this event
      request - request that triggered this event
      Returns:
      true if the request was terminally handled (consumed) by this instance
    • getListeningPriority

      default int getListeningPriority()
      Returns:
      the Priority of this Listener. Defaults to Priority#NORMAL
      See Also:
      Priority
    • compareTo

      default int compareTo​(IRequestUpdateListener o)
      Natural ordering is done by IRequestUpdateListener#getListeningPriority.
      Specified by:
      compareTo in interface Comparable<IRequestUpdateListener>