Package ptolemy.domains.metroII.kernel
Class MetroIIPNQueueReceiver
- java.lang.Object
-
- ptolemy.actor.AbstractReceiver
-
- ptolemy.actor.QueueReceiver
-
- ptolemy.domains.pn.kernel.PNQueueReceiver
-
- ptolemy.domains.metroII.kernel.MetroIIPNQueueReceiver
-
- All Implemented Interfaces:
ProcessReceiver
,Receiver
public class MetroIIPNQueueReceiver extends PNQueueReceiver
MetroIIPNQueueReceiver adapts token transfer to MetroII semantics. Each get() or put() is associated with two MetroII events. The data token transfer will not occur until the associated MetroII events are NOTIFIED.
The implementation is obsolete and needs to be updated.
- Since:
- Ptolemy II 11.0
- Version:
- $Id$
- Author:
- Liangpeng Guo
- Pt.AcceptedRating:
- Red (glp)
- Pt.ProposedRating:
- Red (glp)
-
-
Field Summary
Fields Modifier and Type Field Description protected MetroIIPNDirector
_localDirector
The director in charge of this receiver.-
Fields inherited from class ptolemy.domains.pn.kernel.PNQueueReceiver
_boundaryDetector, _director, _readPending, _terminate, _writePending
-
Fields inherited from class ptolemy.actor.QueueReceiver
_queue, INFINITE_CAPACITY
-
-
Constructor Summary
Constructors Constructor Description MetroIIPNQueueReceiver()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Token
get()
Gets a token from this receiver.MetroIIPNDirector
getDirector()
Returns the director in charge.void
put(Token token)
Puts a token on the queue contained in this receiver.void
setContainer(IOPort port)
Sets the container.-
Methods inherited from class ptolemy.domains.pn.kernel.PNQueueReceiver
hasRoom, hasRoom, hasToken, hasToken, isConnectedToBoundary, isConnectedToBoundaryInside, isConnectedToBoundaryOutside, isConsumerReceiver, isInsideBoundary, isOutsideBoundary, isProducerReceiver, isReadBlocked, isWriteBlocked, requestFinish, reset
-
Methods inherited from class ptolemy.actor.QueueReceiver
clear, elementList, elements, get, getCapacity, getHistoryCapacity, historyElementList, historyElements, historySize, setCapacity, setHistoryCapacity, size
-
Methods inherited from class ptolemy.actor.AbstractReceiver
getArray, getContainer, getCurrentTime, getModelTime, isKnown, putArray, putArrayToAll, putToAll, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface ptolemy.actor.Receiver
clear, elementList, getArray, getContainer, isKnown, putArray, putArrayToAll, putToAll
-
-
-
-
Field Detail
-
_localDirector
protected MetroIIPNDirector _localDirector
The director in charge of this receiver.
-
-
Method Detail
-
getDirector
public MetroIIPNDirector getDirector()
Returns the director in charge.- Overrides:
getDirector
in classPNQueueReceiver
- Returns:
- the director in charge.
-
get
public Token get()
Gets a token from this receiver. If the receiver is empty then block until a token becomes available. If this receiver is terminated during the execution of this method, then throw a TerminateProcessException. The method will not return until the 'xxx.get.end' MetroII event is NOTIFIED.- Specified by:
get
in interfaceReceiver
- Overrides:
get
in classPNQueueReceiver
- Returns:
- The token contained by this receiver.
-
put
public void put(Token token)
Puts a token on the queue contained in this receiver. The 'put' will not occur until the associated MetroII event '*.put.begin' is NOTIFIED.- Specified by:
put
in interfaceReceiver
- Overrides:
put
in classPNQueueReceiver
- Parameters:
token
- The token to be put in the receiver, or null to not put anything.- Throws:
NoRoomException
- If during initialization, capacity cannot be increased enough to accommodate initial tokens.
-
setContainer
public void setContainer(IOPort port) throws IllegalActionException
Sets the container. This overrides the base class to record the director.- Specified by:
setContainer
in interfaceReceiver
- Overrides:
setContainer
in classPNQueueReceiver
- Parameters:
port
- The container.- Throws:
IllegalActionException
- If the container is not of an appropriate subclass of IOPort, or if the container's director is not an instance of PNDirector.- See Also:
AbstractReceiver.getContainer()
-
-