JanosVM v1.0 API

edu.utah.janosvm.sys
Class ExportManager

java.lang.Object
  |
  +--edu.utah.janosvm.sys.ExportManager

public final class ExportManager
extends java.lang.Object

Tracks the {@linkplain Importable importables} associated with a single {@linkplain Exportable exportable}. Each ExportManager is associated with exactly one Exportable. An exportable may have multiple managers (if it is exported under mutliple names, for example).

An ExportManager tracks the links between an exported object and its imports. This is required so that we can revoke any references when a team dies or the export is no longer available to other teams.

Author:
Tim Stack, Utah Janos Team
See Also:
Importable, Exportable

Inner Class Summary
 class ExportManager.ImportEnumerator
          The ImportEnumerator is used to traverse the list of importers of an export.
 
Field Summary
private  Exportable export
          The object being exported.
private  List importers
          List of objects importing our managed object.
private  TeamBackEnd owner
          The team that owns the objects managed by this ExportManager.
 
Constructor Summary
(package private) ExportManager()
          Construct an empty manager.
(package private) ExportManager(Exportable export)
          Construct a manager that is exporting the given object.
 
Method Summary
 void addImporter(Importable im)
          Add an Importable to the list of objects importing our export.
(package private)  void cancelImports()
          Disconnect all of the importers of our export.
 ExportManager.ImportEnumerator getEnumerator()
           
 Exportable getExport()
          Get the object that this manager manages.
(package private)  TeamBackEnd getOwner()
           
 ExportManager.ImportEnumerator imports()
          Similar to the above except that it constructs a new ImportEnumerator and adds that to the list.
 boolean imports(ExportManager.ImportEnumerator ie)
          Setup the given ImportEnumerator to traverse the importers list.
(package private)  boolean remImporter(Importable im)
          Remove an importer from the list of objects importing our export.
 void setExport(Exportable ex)
          If this manager is empty you can fill in its export with this function.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait, wait0
 

Field Detail

owner

private final TeamBackEnd owner
The team that owns the objects managed by this ExportManager.

export

private Exportable export
The object being exported.

importers

private final List importers
List of objects importing our managed object.
Constructor Detail

ExportManager

ExportManager(Exportable export)
Construct a manager that is exporting the given object.
Parameters:
export - The exported object this object should manage.

ExportManager

ExportManager()
Construct an empty manager.
Method Detail

getOwner

TeamBackEnd getOwner()
Returns:
The owner of the exported object.

setExport

public void setExport(Exportable ex)
If this manager is empty you can fill in its export with this function. Silently ignores you if this manager already has an exported object.
Parameters:
ex - The exported object to be managed.
Throws:
Throws - a NullPointerException if ex is null.

getExport

public Exportable getExport()
Get the object that this manager manages.
Returns:
The object that is being exported.

addImporter

public void addImporter(Importable im)
Add an Importable to the list of objects importing our export.
Parameters:
im - The Importable that wants a reference to our export.

remImporter

boolean remImporter(Importable im)
Remove an importer from the list of objects importing our export.
Parameters:
im - The Importable to remove.
Returns:
True if this was the last importer of a TemporaryExport, false otherwise.

cancelImports

void cancelImports()
Disconnect all of the importers of our export.

getEnumerator

public ExportManager.ImportEnumerator getEnumerator()
Returns:
An ImportEnumerator for this ExportManager.

imports

public boolean imports(ExportManager.ImportEnumerator ie)
Setup the given ImportEnumerator to traverse the importers list.
Parameters:
ie - The ImportEnumerator that will be inserted into the importers list.
Returns:
True if this manager is still valid and its importers can be traversed, false otherwise.

imports

public ExportManager.ImportEnumerator imports()
Similar to the above except that it constructs a new ImportEnumerator and adds that to the list.
Returns:
A new ImportEnumerator ready to traverse the list or NULL if this manager is invalid.

toString

public java.lang.String toString()
Overrides:
toString 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