JanosVM v1.0 API

edu.utah.janosvm.kit.comm.commspace
Class CommQueue

java.lang.Object
  |
  +--edu.utah.janosvm.sys.Exportable
        |
        +--edu.utah.janosvm.kit.comm.commspace.CommQueue
All Implemented Interfaces:
TemporaryExport

final class CommQueue
extends Exportable
implements TemporaryExport

A shareable FIFO queue of CommSpaceElements.

Author:
Janos Ministry of Development

Field Summary
private  java.util.Vector elements
           
 
Fields inherited from class edu.utah.janosvm.sys.Exportable
anonManager, owner
 
Constructor Summary
(package private) CommQueue()
           
 
Method Summary
(package private)  void enqueue(CommSpaceElement elem)
           
(package private)  void enqueue(CommSpaceElement[] elems)
           
 boolean expired()
          This method is called when there are no more imports for the export.
 java.lang.Object getName()
          Used to determine the name of this TemporaryObject object during revocation.
 java.lang.String toString()
           
(package private)  CommSpaceElement waitToTake()
          Wait to take an element from the queue.
 
Methods inherited from class edu.utah.janosvm.sys.Exportable
getAnonymousManager, pushOwnerReservation, returnFromOwner, setAnonymousManager, switchToOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0
 

Field Detail

elements

private final java.util.Vector elements
Constructor Detail

CommQueue

CommQueue()
Method Detail

getName

public java.lang.Object getName()
Description copied from interface: TemporaryExport
Used to determine the name of this TemporaryObject object during revocation. Should return null for an anonymous export.
Specified by:
getName in interface TemporaryExport

enqueue

void enqueue(CommSpaceElement elem)
Parameters:
elem - The element to copy and enqueue.

enqueue

void enqueue(CommSpaceElement[] elems)
Parameters:
elems - The array of elements to copy and atomically add to the queue.

waitToTake

CommSpaceElement waitToTake()
                      throws java.lang.InterruptedException
Wait to take an element from the queue.

May throw InterruptedException if the wait() is interrupted. The caller will have to restart the waitToTake().

Returns:
The next element on the queue.

expired

public boolean expired()
Description copied from interface: TemporaryExport
This method is called when there are no more imports for the export. If it returns true than the export is revoked otherwise it will continue to be available for importing.
Specified by:
expired in interface TemporaryExport
Following copied from interface: edu.utah.janosvm.sys.TemporaryExport
Returns:
True if the export has expired and should be revoked.

toString

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

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