Class 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 Detail

      • _localDirector

        protected MetroIIPNDirector _localDirector
        The director in charge of this receiver.
    • Constructor Detail

      • MetroIIPNQueueReceiver

        public MetroIIPNQueueReceiver()
    • Method Detail

      • 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 interface Receiver
        Overrides:
        get in class PNQueueReceiver
        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 interface Receiver
        Overrides:
        put in class PNQueueReceiver
        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.