Class RequestSender

java.lang.Object
desmoj.core.simulator.NamedObject
desmoj.core.simulator.ModelComponent
desmoj.core.simulator.Schedulable
desmoj.core.simulator.Entity
de.rss.fachstudie.MiSim.entities.networking.RequestSender
Direct Known Subclasses:
Generator, MicroserviceInstance

public class RequestSender
extends desmoj.core.simulator.Entity
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
    IRequestUpdateListener updateListenerProxy
    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 s, boolean b)  
  • Method Summary

    Modifier and Type Method Description
    void addUpdateListener​(IRequestUpdateListener listener)
    Adds a listener to this sender.
    void addUpdateListeners​(Iterable<IRequestUpdateListener> listeners)
    Adds multiple listeners.
    NetworkRequestSendEvent sendRequest​(String eventName, Request request, Microservice target)
    Starts a RequestSendingProcess
    NetworkRequestSendEvent sendRequest​(String eventName, Request request, MicroserviceInstance target)
    Starts a RequestSendingProcess
    NetworkRequestSendEvent sendRequest​(String eventName, Request request, MicroserviceInstance target, desmoj.core.simulator.TimeSpan delay)
    Starts a RequestSendingProcess
    NetworkRequestSendEvent sendRequest​(String eventName, Request request, Microservice target, desmoj.core.simulator.TimeSpan delay)
    Starts a RequestSendingProcess

    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, rename, 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, getQuotedName, 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 s, boolean b)
  • Method Details

    • addUpdateListeners

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