public class MailboxBoundaryReceiver extends Mailbox implements ProcessReceiver
The second key feature of this mailbox receiver is that it can be used by opaque composite actors operating in process-oriented models of computation. Indeed the name "MailboxBoundaryReceiver" is used to indicate that this receiver can be contained on the boundary of an opaque composite actor. The get() and put() methods of mailbox boundary receiver can be invoked by a Branch object. In such cases any blocks that occur are registered with the calling branch. The branch will then serve as a proxy by communicating to the director through the branch controller.
Note that it is not necessary for a mailbox boundary receiver to be used in the ports of an opaque composite actor. It is perfectly fine for a mailbox boundary receiver to be used in the ports of an atomic actor. In such cases the get() and put() methods are called without the use of a branch object. If blocking reads or writes occur they are registered with the controlling director without the need for a branch or branch controller.
Branch,
BranchController| Yellow (davisj) |
| Green (mudit) |
| Constructor and Description |
|---|
MailboxBoundaryReceiver()
Construct an empty MailboxBoundaryReceiver with no container.
|
MailboxBoundaryReceiver(IOPort container)
Construct an empty MailboxBoundaryReceiver with the specified
container.
|
| Modifier and Type | Method and Description |
|---|---|
Token |
get()
Get a token from this receiver.
|
ProcessDirector |
getDirector()
Return the director in charge of this receiver, or null
if there is none.
|
boolean |
isConnectedToBoundary()
Return true if this receiver is connected to a boundary port.
|
boolean |
isConnectedToBoundaryInside()
Return true if this receiver is connected to the inside of an
input boundary port; return false otherwise.
|
boolean |
isConnectedToBoundaryOutside()
Return true if this receiver is connected to the outside of an
output boundary port; return false otherwise.
|
boolean |
isConsumerReceiver()
Return true if this is a consumer receiver; return false otherwise.
|
boolean |
isInsideBoundary()
Return true if this receiver is contained on the inside of a
boundary port.
|
boolean |
isOutsideBoundary()
Return true if this receiver is contained on the outside of a
boundary port.
|
boolean |
isProducerReceiver()
Return true if this is a producer receiver; return false otherwise.
|
boolean |
isReadBlocked()
Return a true or false to indicate whether there is a read block
on this receiver or not, respectively.
|
boolean |
isWriteBlocked()
Return a true or false to indicate whether there is a write block
on this receiver or not.
|
void |
put(Token token)
Put a token into this receiver.
|
void |
requestFinish()
Set a local flag requesting that execution of the actor
containing this receiver discontinue.
|
void |
reset()
Reset the local flags of this receiver.
|
void |
setContainer(IOPort port)
Set the container.
|
clear, elementList, hasRoom, hasRoom, hasToken, hasTokengetArray, getContainer, getCurrentTime, getModelTime, isKnown, putArray, putArrayToAll, putToAll, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclear, elementList, getArray, getContainer, hasRoom, hasRoom, hasToken, hasToken, isKnown, putArray, putArrayToAll, putToAllpublic MailboxBoundaryReceiver()
public MailboxBoundaryReceiver(IOPort container) throws IllegalActionException
container - The container.IllegalActionException - If the container cannot contain
this receiver.public Token get()
public ProcessDirector getDirector()
public boolean isConnectedToBoundary()
throws IllegalActionException
isConnectedToBoundary in interface ProcessReceiverIllegalActionExceptionBoundaryDetectorpublic boolean isConnectedToBoundaryInside()
throws InvalidStateException,
IllegalActionException
isConnectedToBoundaryInside in interface ProcessReceiverIllegalActionExceptionInvalidStateExceptionBoundaryDetectorpublic boolean isConnectedToBoundaryOutside()
throws IllegalActionException
isConnectedToBoundaryOutside in interface ProcessReceiverIllegalActionExceptionBoundaryDetectorpublic boolean isConsumerReceiver()
throws IllegalActionException
isConsumerReceiver in interface ProcessReceiverIllegalActionExceptionpublic boolean isInsideBoundary()
isInsideBoundary in interface ProcessReceiverBoundaryDetectorpublic boolean isOutsideBoundary()
isOutsideBoundary in interface ProcessReceiverBoundaryDetectorpublic boolean isProducerReceiver()
isProducerReceiver in interface ProcessReceiverpublic boolean isReadBlocked()
isReadBlocked in interface ProcessReceiverpublic boolean isWriteBlocked()
isWriteBlocked in interface ProcessReceiverpublic void put(Token token)
public void requestFinish()
requestFinish in interface ProcessReceiverpublic void reset()
reset in interface ProcessReceiverreset in interface Receiverreset in class AbstractReceiverpublic void setContainer(IOPort port) throws IllegalActionException
setContainer in interface ReceiversetContainer in class AbstractReceiverport - The container.IllegalActionException - If the container is not of
an appropriate subclass of IOPort, or if the container's director
is not an instance of ProcessDirector.AbstractReceiver.getContainer()