JanosVM v1.0 API

edu.utah.janosvm.kit.comm.amiga
Class MsgPort

java.lang.Object
  |
  +--edu.utah.janosvm.kit.comm.amiga.MsgPort

public final class MsgPort
extends java.lang.Object

A MsgPort is a simple communication mechanism for threads within the same team.


Field Summary
private  SignalSet listener
          The SignalSet that should be signalled when a message is received.
private  List msgQueue
          The queue of messages received by this port.
private  int signalNumber
          The SignalNumber that should be signalled when a message is received.
 
Constructor Summary
MsgPort(SignalSet listener)
          Construct a MsgPort with the given values.
MsgPort(SignalSet listener, int signalNumber)
          Construct a MsgPort with the given values.
 
Method Summary
protected  void finalize()
           
 Message getMessage()
           
 int getSignalNumber()
           
 void putMessage(Message msg)
           
 java.lang.String toString()
           
 Message waitForMessage()
          Wait for and return the first Message received.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0
 

Field Detail

msgQueue

private final List msgQueue
The queue of messages received by this port.

listener

private final SignalSet listener
The SignalSet that should be signalled when a message is received.

signalNumber

private final int signalNumber
The SignalNumber that should be signalled when a message is received.
Constructor Detail

MsgPort

public MsgPort(SignalSet listener,
               int signalNumber)
Construct a MsgPort with the given values.
Parameters:
listener - The SignalSet that the RemoteFaxPort should signal when it receives a fax.
signalNumber - The SignalNumber that the RemoteFaxPort should signal when it receives a fax.

MsgPort

public MsgPort(SignalSet listener)
Construct a MsgPort with the given values.
Parameters:
listener - The SignalSet that the RemoteFaxPort should signal when it receives a fax.
Method Detail

getSignalNumber

public int getSignalNumber()
Returns:
The signal number that will get signalled when a fax is received.

putMessage

public void putMessage(Message msg)
Parameters:
msg - The Message to add to the queue. Note: The message isn't copied so you mustn't change any values until you receive the reply.

getMessage

public Message getMessage()
Returns:
The Message at the head of the queue or null if the queue is empty.

waitForMessage

public Message waitForMessage()
                       throws java.lang.InterruptedException
Wait for and return the first Message received.
Returns:
The first message.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object

JanosVM v1.0 API

This documentation is Copyright (C) 2000-2003 The University of Utah. All Rights Reserved. See the documentation license for distribution terms and restrictions.
Documentation, software, and mailing lists for the JanosVM can be found at the Janos Project web page: http://www.cs.utah.edu/flux/janos/
Generated on Feb 13, 2003