edu.utah.janosvm.kit.comm.commspace
Class CommSpace
java.lang.Object
|
+--edu.utah.janosvm.sys.Exportable
|
+--edu.utah.janosvm.kit.comm.commspace.CommSpace
- All Implemented Interfaces:
- TemporaryExport
- class CommSpace
- extends Exportable
- implements TemporaryExport
Variation on an array, with some tuple-space like properties.
Objects are not shared between flows, they are copied on read.
- Author:
- Janos Ministry of Development
Constructor Summary |
(package private) |
CommSpace(int size)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0 |
table
private final CommSpaceElement[] table
- The table mapping indicies to elements.
CommSpace
CommSpace(int size)
- Parameters:
size
- The size of CommSpace to construct.
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
size
final int size()
- Returns:
- The size of the CommSpace.
checkIndex
private final void checkIndex(int index)
- Parameters:
index
- Index to verify that it is within the bounds of the
space.- Throws:
java.lang.ArrayIndexOutOfBoundsException
- when the index is not
valid.
write
void write(int index,
CommSpaceElement elem)
throws java.lang.ArrayIndexOutOfBoundsException
- Write the given element at the given index.
take
CommSpaceElement take(int index)
throws java.lang.ArrayIndexOutOfBoundsException
waitToTake
CommSpaceElement waitToTake(int index)
throws java.lang.ArrayIndexOutOfBoundsException,
java.lang.InterruptedException
read
CommSpaceElement read(int index)
throws java.lang.ArrayIndexOutOfBoundsException
swap
CommSpaceElement swap(int index,
CommSpaceElement elem)
notifyOnIndex
private void notifyOnIndex(int index)
- Notify potential interested parties about a change at the
given index.
waitOnIndex
private void waitOnIndex(int index)
throws java.lang.InterruptedException
- Wait for something to change in the slot at the
given index.
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
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