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
MicroserviceInstances.- Author:
- Lion Wagner
-
Field Summary
FieldsFields inherited from class desmoj.core.simulator.Schedulable
_schedule -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRequest(desmoj.core.simulator.Model model, String name, boolean showInTrace, Request parent, Operation operation, MicroserviceInstance requester) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUpdateListener(IRequestUpdateListener updateListener) Adds a newIRequestUpdateListenerto the request.final booleanvoidUse, to cancel this request.voidCancels the sending process of this request.final doublefinal Set<ServiceDependencyInstance>final doublefinal RequestgetRelatedDependency(Request request) Gets theServiceDependencyInstancethat should be completed by the given request.final doubleCalculates the response time of this request.desmoj.core.simulator.TimeInstantdesmoj.core.simulator.TimeInstantfinal booleanfinal booleanbooleanbooleanbooleanTells this request that oneServiceDependencyInstancehas finished.protected voidprotected voidprotected voidprotected voidvoidvoidsetCanceledEvent(NetworkRequestCanceledEvent canceledEvent) final voidMarks the request computation demand as fulfilled at the present time.voidsetHandler(MicroserviceInstance handler) voidsetReceiveEvent(NetworkRequestReceiveEvent receiveEvent) voidsetSendEvent(NetworkRequestSendEvent sendEvent) final voidstampReceived(desmoj.core.simulator.TimeInstant stamp) final voidstampReceivedAtHandler(desmoj.core.simulator.TimeInstant stamp) Marks the point in time this request was received at a handler.final voidstampSendoff(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, 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
-
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 oneServiceDependencyInstancehas finished.- Parameters:
dep- dependency that was completed- Returns:
- whether all dependencies are completed
-
getRelatedDependency
Gets theServiceDependencyInstancethat should be completed by the given request.- Parameters:
request- child request of this request.- Returns:
- the
ServiceDependencyInstancethat is related to the given request,nullotherwise. Returnsnullspecifically, 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 newIRequestUpdateListenerto 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.
-