edu.rit.m2mi
Class InterfaceExportMap

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

public class InterfaceExportMap
extends ExportMap

Class InterfaceExportMap provides a mapping from a target interface name to a set of objects that have been exported with that interface. This is used to determine the target objects for an omnihandle invocation for a certain target interface.

Note: Class InterfaceExportMap is not multiple thread safe.


Constructor Summary
InterfaceExportMap(M2MIMessagePrefix theMessagePrefixBag)
          Construct a new, empty interface export map.
 
Method Summary
 void export(String intf, Object obj)
          Export the given object with the given interface in this export map.
 boolean isExported(String intf, Object obj)
          Determine if the given object is exported with the given interface in this export map.
 Iterator iterator(String intf)
          Obtain an iterator for visiting the objects exported with the given interface in this export map.
 void unexport(String intf, Object obj)
          Unexport the given object from the given interface 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

InterfaceExportMap

public InterfaceExportMap(M2MIMessagePrefix theMessagePrefixBag)
Construct a new, empty interface export map.

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

export

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

Parameters:
intf - Fully-qualified name of the target interface.
obj - Object to export.
Throws:
NullPointerException - (unchecked exception) Thrown if intf is null or obj is null.
ExportException - (unchecked exception) Thrown if there was a problem exporting the object.

unexport

public void unexport(String intf,
                     Object obj)
Unexport the given object from the given interface in this export map. If the given object is exported with any other interfaces, it remains exported with those interfaces.

Parameters:
intf - Fully-qualified name of the target interface.
obj - Object to unexport.
Throws:
NullPointerException - (unchecked exception) Thrown if intf is null or obj is null.
ExportException - (unchecked exception) Thrown if there was a problem unexporting the object.

isExported

public boolean isExported(String intf,
                          Object obj)
Determine if the given object is exported with the given interface in this export map.

Parameters:
intf - Fully-qualified name of the target interface.
obj - Object.
Returns:
True if obj is exported with intf, false otherwise.
Throws:
NullPointerException - (unchecked exception) Thrown if intf is null or obj is null.

iterator

public Iterator iterator(String intf)
Obtain an iterator for visiting the objects exported with the given interface 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:
intf - Fully-qualified name of the target interface.
Returns:
Iterator.
Throws:
NullPointerException - (unchecked exception) Thrown if intf is null.


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