Class Request
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.Request
- Direct Known Subclasses:
InternalRequest
,RequestAnswer
,UserRequest
Represents a Request that can travel between two
MicroserviceInstance
s.- Author:
- Lion Wagner
-
Field Summary
FieldsFields inherited from class desmoj.core.simulator.Schedulable
_schedule
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Request
(desmoj.core.simulator.Model model, String name, boolean showInTrace, Request parent, Operation operation, MicroserviceInstance requester) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addUpdateListener
(IRequestUpdateListener updateListener) Adds a newIRequestUpdateListener
to the request.final boolean
void
Use, to cancel this request.void
Cancels the sending process of this request.final double
final Set<ServiceDependencyInstance>
final double
final Request
getRelatedDependency
(Request request) Gets theServiceDependencyInstance
that should be completed by the given request.final double
Calculates the response time of this request.desmoj.core.simulator.TimeInstant
desmoj.core.simulator.TimeInstant
final boolean
final boolean
boolean
boolean
boolean
Tells this request that oneServiceDependencyInstance
has finished.protected void
protected void
protected void
protected void
void
void
setCanceledEvent
(NetworkRequestCanceledEvent canceledEvent) final void
Marks the request computation demand as fulfilled at the present time.void
setHandler
(MicroserviceInstance handler) void
setReceiveEvent
(NetworkRequestReceiveEvent receiveEvent) void
setSendEvent
(NetworkRequestSendEvent sendEvent) final void
stampReceived
(desmoj.core.simulator.TimeInstant stamp) final void
stampReceivedAtHandler
(desmoj.core.simulator.TimeInstant stamp) Marks the point in time this request was received at a handler.final void
stampSendoff
(desmoj.core.simulator.TimeInstant stamp) Marks the point in time this request was send.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
-
Field Details
-
operation
-
-
Constructor Details
-
Request
protected Request(desmoj.core.simulator.Model model, String name, boolean showInTrace, Request parent, Operation operation, MicroserviceInstance requester)
-
-
Method Details
-
getDependencies
-
getParent
-
hasParent
public final boolean hasParent() -
getRequester
-
isCompleted
public final boolean isCompleted() -
isComputationCompleted
public boolean isComputationCompleted() -
isDependenciesCompleted
public boolean isDependenciesCompleted() -
getTimestampReceived
public desmoj.core.simulator.TimeInstant getTimestampReceived() -
getTimestampSend
public desmoj.core.simulator.TimeInstant getTimestampSend() -
resetSendTimeStamps
public void resetSendTimeStamps() -
setSendEvent
-
setReceiveEvent
-
setCanceledEvent
-
setComputationCompleted
public final void setComputationCompleted()Marks the request computation demand as fulfilled at the present time. -
stampReceived
public final void stampReceived(desmoj.core.simulator.TimeInstant stamp) -
stampSendoff
public final void stampSendoff(desmoj.core.simulator.TimeInstant stamp) Marks the point in time this request was send. -
stampReceivedAtHandler
public final void stampReceivedAtHandler(desmoj.core.simulator.TimeInstant stamp) Marks the point in time this request was received at a handler. -
notifyDependencyHasFinished
Tells this request that oneServiceDependencyInstance
has finished.- Parameters:
dep
- dependency that was completed- Returns:
- whether all dependencies are completed
-
getRelatedDependency
Gets theServiceDependencyInstance
that should be completed by the given request.- Parameters:
request
- child request of this request.- Returns:
- the
ServiceDependencyInstance
that is related to the given request,null
otherwise. Returnsnull
specifically, if the request was a child request, that has been canceled or replaced.
-
getResponseTime
public final double getResponseTime()Calculates the response time of this request.- Returns:
- a double, describing the response time with the reference unit.
-
getDependencyWaitTime
public final double getDependencyWaitTime() -
getComputeTime
public final double getComputeTime() -
areDependenciesCompleted
public final boolean areDependenciesCompleted() -
onDependenciesComplete
protected void onDependenciesComplete() -
onComputationComplete
protected void onComputationComplete() -
onCompletion
protected void onCompletion() -
onReceive
protected void onReceive() -
getHandler
-
setHandler
-
getUpdateListeners
-
addUpdateListener
Adds a newIRequestUpdateListener
to the request.- Parameters:
updateListener
- listener to add.
-
cancelSending
public void cancelSending()Cancels the sending process of this request. Also prevents it from starting. -
cancelExecutionAtHandler
public void cancelExecutionAtHandler()Use, to cancel this request.
-