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
Class that provides the ability to send requests and register listeners to this requests.
- Author:
- Lion Wagner
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal IRequestUpdateListenerProxy that forwards events to all listeners while letting the event be consumable.Fields inherited from class desmoj.core.simulator.Schedulable
_schedule -
Constructor Summary
ConstructorsConstructorDescriptionRequestSender(desmoj.core.simulator.Model model, String name, boolean showInTrace) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddUpdateListener(IRequestUpdateListener listener) Adds a listener to this sender.final voidaddUpdateListeners(Iterable<IRequestUpdateListener> listeners) Adds multiple listeners.final NetworkRequestSendEventsendRequest(String eventName, Request request, Microservice target) Starts a RequestSendingProcess.final NetworkRequestSendEventsendRequest(String eventName, Request request, MicroserviceInstance target) Starts a RequestSendingProcess.final NetworkRequestSendEventsendRequest(String eventName, Request request, MicroserviceInstance target, desmoj.core.simulator.TimeSpan delay) Starts a RequestSendingProcess.final NetworkRequestSendEventsendRequest(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, renameMethods 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, 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, 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
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
-