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.CrossbarMessage
s 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, setReporter
current, currentEntity, currentEntityAll, currentEvent, currentModel, currentSimProcess, debugIsOn, debugOff, debugOn, getModel, isExperimentCompatible, isModelCompatible, presentTime, sendDebugNote, sendMessage, sendTraceNote, sendWarning, skipTraceNote, skipTraceNote, traceIsOn, traceOff, traceOn
getName, getQuotedName, toString
public long getDeliveredMessages()
public java.lang.Object getDirectProcessActivations()
public long getIndirectProcessActivations()
public long getInterruptedWaits()
public long getLostMessages()
public long getObservations()
Reportable
getObservations
in class Reportable
public long getProcessActivations()
public long getReceivedMessages()
public void reset()
Reportable
resetAt()
.reset
in class Reportable
public TimeInstant resetAt()
Reportable
resetAt
in class Reportable
public 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.SuspendExecution
public 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.SuspendExecution
public 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