edu.rit.m2mi
Class EoidExportMap

java.lang.Object
  extended by edu.rit.m2mi.ExportMap
      extended by edu.rit.m2mi.EoidExportMap

public class EoidExportMap
extends ExportMap

Class EoidExportMap provides a mapping from an exported object identifier (EOID) to a set of objects that have been exported with that EOID. This is used to determine the target objects for a multihandle or unihandle invocation for a certain EOID.

Note: Class EoidExportMap is not multiple thread safe.


Constructor Summary
EoidExportMap(M2MIMessagePrefix theMessagePrefixBag)
          Construct a new, empty EOID export map.
 
Method Summary
 void export(Eoid eoid, Object obj)
          Export the given object with the given EOID in this export map.
protected  boolean isExported(Eoid eoid)
          Determine if any object(s) are exported with the given EOID in this export map.
 boolean isExported(Eoid eoid, Object obj)
          Determine if the given object is exported with the given EOID in this export map.
 Iterator iterator(Eoid eoid)
          Obtain an iterator for visiting the objects exported with the given EOID in this export map.
 void unexport(Eoid eoid, Object obj)
          Unexport the given object from the given EOID in this export map.
 void unexportEoid(Eoid eoid)
          Unexport all objects from the given EOID in this export map.
 
Methods inherited from class edu.rit.m2mi.ExportMap
export, isExported, isExported, iterator, unexport, unexport, unexportKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EoidExportMap

public EoidExportMap(M2MIMessagePrefix theMessagePrefixBag)
Construct a new, empty EOID export map.

Parameters:
theMessagePrefixBag - M2MI message prefix bag.
Throws:
NullPointerException - (unchecked exception) Thrown if theMessagePrefixBag is null.
Method Detail

export

public void export(Eoid eoid,
                   Object obj)
Export the given object with the given EOID in this export map. If the given object is already exported with the given EOID, export() has no effect.

Parameters:
eoid - EOID.
obj - Object to export.
Throws:
NullPointerException - (unchecked exception) Thrown if eoid is null or obj is null.
ExportException - (unchecked exception) Thrown if there was a problem exporting the object.

unexport

public void unexport(Eoid eoid,
                     Object obj)
Unexport the given object from the given EOID in this export map. If the given object is exported with any other EOIDs, it remains exported with those EOIDs.

Parameters:
eoid - EOID.
obj - Object to unexport.
Throws:
NullPointerException - (unchecked exception) Thrown if eoid is null or obj is null.
ExportException - (unchecked exception) Thrown if there was a problem unexporting the object.

unexportEoid

public void unexportEoid(Eoid eoid)
Unexport all objects from the given EOID in this export map. If those objects are exported with any other EOIDs, they remain exported with those EOIDs.

Parameters:
eoid - EOID.
Throws:
NullPointerException - (unchecked exception) Thrown if eoid is null.
ExportException - (unchecked exception) Thrown if there was a problem unexporting the objects.

isExported

protected boolean isExported(Eoid eoid)
Determine if any object(s) are exported with the given EOID in this export map.

Parameters:
eoid - EOID
Returns:
True if any objects are exported with eoid, false otherwise.
Throws:
NullPointerException - (unchecked exception) Thrown if eoid is null.

isExported

public boolean isExported(Eoid eoid,
                          Object obj)
Determine if the given object is exported with the given EOID in this export map.

Parameters:
eoid - EOID.
obj - Object.
Returns:
True if obj is exported with eoid, false otherwise.
Throws:
NullPointerException - (unchecked exception) Thrown if eoid is null or obj is null.

iterator

public Iterator iterator(Eoid eoid)
Obtain an iterator for visiting the objects exported with the given EOID in this export map. The iterator() method takes a "snapshot" of the exported objects at the time it is called, and returns an iterator for the snapshot. Subsequent changes to this export map will have no effect on the returned iterator.

Parameters:
eoid - EOID.
Returns:
Iterator.
Throws:
NullPointerException - (unchecked exception) Thrown if eoid is null.


Copyright © 2001-2006 by Alan Kaminsky. All rights reserved. Send comments to ark­@­cs.rit.edu.