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 IRequestUpdateListenerupdateListenerProxyProxy 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 voidaddUpdateListener(IRequestUpdateListener listener)Adds a listener to this sender.voidaddUpdateListeners(Iterable<IRequestUpdateListener> listeners)Adds multiple listeners.NetworkRequestSendEventsendRequest(String eventName, Request request, Microservice target)Starts a RequestSendingProcessNetworkRequestSendEventsendRequest(String eventName, Request request, MicroserviceInstance target)Starts a RequestSendingProcessNetworkRequestSendEventsendRequest(String eventName, Request request, MicroserviceInstance target, desmoj.core.simulator.TimeSpan delay)Starts a RequestSendingProcessNetworkRequestSendEventsendRequest(String eventName, Request request, Microservice target, desmoj.core.simulator.TimeSpan delay)Starts a RequestSendingProcessMethods 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, setQueueingPriorityMethods inherited from class desmoj.core.simulator.Schedulable
assignReporter, cancel, getCorrespondingReportable, isCurrent, isScheduled, rename, reSchedule, reSchedule, reSchedulePreempt, scheduledNext, setCorrespondingReportableMethods 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, traceOnMethods inherited from class desmoj.core.simulator.NamedObject
getName, getQuotedName, toString
-
Field Details
-
updateListenerProxy
Proxy that forwards events to all listeners while letting the event be consumable.
-
-
Constructor Details
-
RequestSender
-
-
Method Details
-
addUpdateListeners
Adds multiple listeners.- Parameters:
listeners- listeners that are to be add.- See Also:
addUpdateListener(IRequestUpdateListener)
-
addUpdateListener
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 eventrequest- request that should traveltarget-MicroserviceInstancethat 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 eventrequest- request that should traveltarget-Microservicethat 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 eventrequest- request that should traveltarget-MicroserviceInstancethat 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 eventrequest- request that should traveltarget-Microservicethat should receive the request.delay- delays the send event by this amount- Returns:
- the created send event
-