Class RequestSender

java.lang.Object
desmoj.core.simulator.NamedObject
desmoj.core.simulator.ModelComponent
desmoj.core.simulator.Schedulable
desmoj.core.simulator.Entity
cambio.simulator.entities.NamedEntity
cambio.simulator.entities.networking.RequestSender
Direct Known Subclasses:
LoadGeneratorDescriptionExecutor, MicroserviceInstance

public class RequestSender extends NamedEntity
Class that provides the ability to send requests and register listeners to this requests.
Author:
Lion Wagner
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Proxy that forwards events to all listeners while letting the event be consumable.

    Fields inherited from class desmoj.core.simulator.Schedulable

    _schedule
  • Constructor Summary

    Constructors
    Constructor
    Description
    RequestSender(desmoj.core.simulator.Model model, String name, boolean showInTrace)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Adds a listener to this sender.
    final void
    Adds multiple listeners.
    sendRequest(String eventName, Request request, Microservice target)
    Starts a RequestSendingProcess.
    sendRequest(String eventName, Request request, MicroserviceInstance target)
    Starts a RequestSendingProcess.
    sendRequest(String eventName, Request request, MicroserviceInstance target, desmoj.core.simulator.TimeSpan delay)
    Starts a RequestSendingProcess.
    sendRequest(String eventName, Request request, Microservice target, desmoj.core.simulator.TimeSpan delay)
    Starts a RequestSendingProcess.

    Methods inherited from class cambio.simulator.entities.NamedEntity

    getPlainName, getQuotedName, getQuotedPlainName, rename

    Methods inherited from class desmoj.core.simulator.Entity

    clone, generateTraceForScheduling, getIdentNumber, getQueueingPriority, getQueues, getScheduledEvents, isEqual, isLarger, isLargerOrEqual, isNotEqual, isQueued, isSimProcess, isSmaller, isSmallerOrEqual, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, schedule, scheduleAfter, scheduleAfter, scheduleAfter, scheduleBefore, scheduleBefore, scheduleBefore, schedulePreempt, schedulePreempt, schedulePreempt, setQueueingPriority

    Methods inherited from class desmoj.core.simulator.Schedulable

    assignReporter, cancel, getCorrespondingReportable, isCurrent, isScheduled, reSchedule, reSchedule, reSchedulePreempt, scheduledNext, setCorrespondingReportable

    Methods inherited from class desmoj.core.simulator.ModelComponent

    current, currentEntity, currentEntityAll, currentEvent, currentlySendDebugNotes, currentlySendTraceNotes, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn

    Methods inherited from class desmoj.core.simulator.NamedObject

    getName, toString

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • updateListenerProxy

      public final IRequestUpdateListener updateListenerProxy
      Proxy that forwards events to all listeners while letting the event be consumable.
  • Constructor Details

    • RequestSender

      public RequestSender(desmoj.core.simulator.Model model, String name, boolean showInTrace)
  • Method Details

    • addUpdateListeners

      public final void addUpdateListeners(Iterable<IRequestUpdateListener> listeners)
      Adds multiple listeners.
      Parameters:
      listeners - listeners that are to be add.
      See Also:
    • addUpdateListener

      public final void addUpdateListener(IRequestUpdateListener listener)
      Adds a listener to this sender. This listener will be update about the status of all requests sent by this entity. This includes requests, that are already under way!
      Parameters:
      listener - listener that is to be added
    • sendRequest

      public final NetworkRequestSendEvent sendRequest(String eventName, Request request, MicroserviceInstance target)
      Starts a RequestSendingProcess.
      Parameters:
      eventName - trace/debug name of the send event
      request - request that should travel
      target - MicroserviceInstance that should receive the request.
      Returns:
      the created send event
    • sendRequest

      public final NetworkRequestSendEvent sendRequest(String eventName, Request request, Microservice target)
      Starts a RequestSendingProcess.
      Parameters:
      eventName - trace/debug name of the send event
      request - request that should travel
      target - Microservice that should receive the request.
      Returns:
      the created send event
    • sendRequest

      public final NetworkRequestSendEvent sendRequest(String eventName, Request request, MicroserviceInstance target, desmoj.core.simulator.TimeSpan delay)
      Starts a RequestSendingProcess.
      Parameters:
      eventName - trace/debug name of the send event
      request - request that should travel
      target - MicroserviceInstance that should receive the request.
      delay - delays the send event by this amount
      Returns:
      the created send event
    • sendRequest

      public final NetworkRequestSendEvent sendRequest(String eventName, Request request, Microservice target, desmoj.core.simulator.TimeSpan delay)
      Starts a RequestSendingProcess.
      Parameters:
      eventName - trace/debug name of the send event
      request - request that should travel
      target - Microservice that should receive the request.
      delay - delays the send event by this amount
      Returns:
      the created send event