T - Parameter restricting the types of processes which can wait on a
MessageChannel.public class MessageChannel<T extends SimProcess> extends Reportable
MessageCrossbar.
MessageChannels can only be used in conjunction with a message crossbar.CrossbarMessages on them (passivating the process) and on the other
hand they allow for processes to send CrossbarMessages to them. If a
CrossbarMessage is received this leads to the immediate activation of all
process waiting on the channel.MessageCrossbar,
CrossbarMessage| Modifier and Type | Method and Description |
|---|---|
long |
getDeliveredMessages() |
java.lang.Object |
getDirectProcessActivations() |
long |
getIndirectProcessActivations() |
long |
getInterruptedWaits() |
long |
getLostMessages() |
long |
getObservations()
Returns the number of observations made by the reportable object.
|
long |
getProcessActivations() |
long |
getReceivedMessages() |
void |
reset()
Resets the counter for observations made by this reportable.
|
TimeInstant |
resetAt()
Shows the point in simulation time when the last reset of this reportable
was made.
|
void |
send(CrossbarMessage message)
Sends the given
CrossbarMessage to the channel, thereby
activating all processes that are waiting on the channel. |
CrossbarMessage |
waitForMessage()
Wait for a
CrossbarMessage on this channel, thereby passivating
the current process. |
CrossbarMessage |
waitForMessage(TimeInstant waitUntil)
Wait for a
CrossbarMessage on this channel, thereby passivating
the current process. |
CrossbarMessage |
waitForMessage(TimeSpan maxWaitTime)
Wait for a
CrossbarMessage on this channel, thereby passivating
the current process. |
getCorrespondingSchedulable, getDescription, getReporter, incrementObservations, incrementObservations, reportIsOn, reportOff, reportOn, setCorrespondingSchedulable, setDescription, setReportercurrent, currentEntity, currentEntityAll, currentEvent, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOngetName, getQuotedName, toStringpublic long getDeliveredMessages()
public java.lang.Object getDirectProcessActivations()
public long getIndirectProcessActivations()
public long getInterruptedWaits()
public long getLostMessages()
public long getObservations()
ReportablegetObservations in class Reportablepublic long getProcessActivations()
public long getReceivedMessages()
public void reset()
ReportableresetAt().reset in class Reportablepublic TimeInstant resetAt()
ReportableresetAt in class Reportablepublic void send(CrossbarMessage message)
CrossbarMessage to the channel, thereby
activating all processes that are waiting on the channel.message - The message to send to the channel.public CrossbarMessage waitForMessage() throws SuspendExecution
CrossbarMessage on this channel, thereby passivating
the current process. The process is not reactivated until a message is
received.SuspendExecutionpublic CrossbarMessage waitForMessage(TimeInstant waitUntil) throws DelayedInterruptException, SuspendExecution
CrossbarMessage on this channel, thereby passivating
the current process. The process is not reactivated until a message is
received. The parameter waitUntil specifies the point in time to which
the current process will wait for a message. If no message is received
before that time the process will be interrupted and a
DelayedInterruptException will be thrown.waitUntil - The point in time up to which the process will wait for a
message before the waiting is aborted.DelayedInterruptException - The exception that indicates the process has reached its
max wait time and has been interrupted.SuspendExecutionpublic CrossbarMessage waitForMessage(TimeSpan maxWaitTime) throws DelayedInterruptException, SuspendExecution
CrossbarMessage on this channel, thereby passivating
the current process. The process is not reactivated until a message is
received. The parameter maxWaitTime specifies the time the current
process will wait for a message. If no message is received before the
wait time has passed the process will be interrupted and a
DelayedInterruptException will be thrown.maxWaitTime - The time the process will wait for a message before the
waiting is aborted.DelayedInterruptException - The exception that indicates the process has reached its
max wait time and has been interrupted.SuspendExecution