org.ozoneDB.collections
Interface OzoneIterator

All Superinterfaces:
java.util.Iterator, org.ozoneDB.OzoneCompatibleOrProxy, org.ozoneDB.OzoneRemote
All Known Subinterfaces:
OzoneListIterator
All Known Implementing Classes:
_BaseList_IteratorImpl, _BaseList_ListIteratorImpl, _BaseList_SubList_listIterator, _BaseTreeMap_OzoneTreeIteratorImpl, _BaseTreeMap_OzoneTreeIteratorImpl_Proxy

public interface OzoneIterator
extends java.util.Iterator, org.ozoneDB.OzoneRemote

Used by implementations of FullXxx Ozone collections. NodeXxx have no need for server side iterators. All FullXxx use non-Ozone objects for 'nodes' inside, all NodeXxx do use Ozone objects for their internal structure. As an Iterator has direct links to these internal node objects, it is possible for NodeXxx collections to have non-Ozone iterators, since they only reference Ozone objects. This means these iterators can simply be serializable and can leave the Ozone server. Iterators for FullXxx collections however can not leave the server since they reference non-Ozone objects; simply serializing them and sending them to the client would cause the internal node structure to be copied and send to the client as well. Therefor FullXxx collections need a server side iterator.

Because an OzoneIterator references non-Ozone objects that 'belong' to an other Ozone object special precautions have to be taken to assure that if the collection that an iterator is connected to is serialized, that the iterator itself does not continue using the non-Ozone objects that are serialized in the same container as the collection (or vice versa: the iterator is serialized but the collection is not). One such a precaution can be throwing a ConcurrentModificationException when one of the two have been serialized. This is slightly abusing the specs as layed out by Sun, but there is no other workaround IMHO, at least not until Ozone supports a way of storing 2 objects in 1 container or keeping objects forced in main memory.

Author:
Leo Mekenkamp (mind the anti-sp@m)

Method Summary
 java.lang.Object next()
           
 void remove()
           
 
Methods inherited from interface java.util.Iterator
hasNext
 
Methods inherited from interface org.ozoneDB.OzoneCompatibleOrProxy
getObjectID
 

Method Detail

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

remove

public void remove()
Specified by:
remove in interface java.util.Iterator


Copyright © 2004 The Ozone Database Project - www.ozone-db.org. All Rights Reserved.