Interface IRequestUpdateListener

All Superinterfaces:
Comparable<IRequestUpdateListener>
All Known Implementing Classes:
CircuitBreaker, LoadGeneratorDescriptionExecutor, MicroserviceInstance, NetworkRequestTimeoutEvent, Retry

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:
  • Method Summary

    Modifier and Type
    Method
    Description
    default int
    Natural ordering is done by IRequestUpdateListener#getListeningPriority.
    default int
    Gets the priority of this listener.
    default boolean
    onRequestArrivalAtTarget(Request request, desmoj.core.simulator.TimeInstant when)
    Listener for the successful completion of the sending process.
    default boolean
    onRequestFailed(Request request, desmoj.core.simulator.TimeInstant when, RequestFailedReason reason)
    Listener for the failure of the sending process.
    default boolean
    onRequestResultArrivedAtRequester(Request request, desmoj.core.simulator.TimeInstant when)
    Listener for the successful receiving of the answer of a request.
    default boolean
    onRequestSend(Request request, desmoj.core.simulator.TimeInstant when)
    Listener for the send-off of a request.
  • 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:
      request - request that triggered this event
      when - time of 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:
      request - request that triggered this event
      when - time of 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:
      request - request that triggered this event
      when - time of 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:
      request - request that triggered this event
      when - time of this event
      Returns:
      true if the request was terminally handled (consumed) by this instance
    • getListeningPriority

      default int getListeningPriority()
      Gets the priority of this listener. Listeners with higher priority will be notified first about the status of a request. The interaction for listeners with equal priority is undefined.
      Returns:
      the Priority of this Listener. Defaults to Priority#NORMAL
      See Also:
    • compareTo

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