KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > collections > OzoneIterator


1 // This file is
2
// Copyright (C) 2002-@year@ Leo Mekenkamp. All rights reserved.
3
// $Id: OzoneCollection.java,v 1.4 2003/10/28 13:01:42 leomekenkamp Exp $
4
//
5
// This file is part of the Ozone Collections package.
6
//
7
// Ozone Collections is free software; you can redistribute it and/or modify
8
// it under the terms of the GNU General Public License as published by
9
// the Free Software Foundation; either version 2, or (at your option)
10
// any later version.
11
//
12
// Ozone Collections is distributed in the hope that it will be useful, but
13
// WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
// General Public License for more details.
16
//
17
// You should have received a copy of the GNU General Public License
18
// along with GNU Classpath; see the file COPYING. If not, write to the
19
// Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20
// 02111-1307 USA.
21
//
22
// Linking this library statically or dynamically with other modules is
23
// making a combined work based on this library. Thus, the terms and
24
// conditions of the GNU General Public License cover the whole
25
// combination.
26
//
27
// As a special exception, the copyright holders of this library give you
28
// permission to link this library with independent modules to produce an
29
// executable, regardless of the license terms of these independent
30
// modules, and to copy and distribute the resulting executable under
31
// terms of your choice, provided that you also meet, for each linked
32
// independent module, the terms and conditions of the license of that
33
// module. An independent module is a module which is not derived from
34
// or based on this library. If you modify this library, you may extend
35
// this exception to your version of the library, but you are not
36
// obligated to do so. If you do not wish to do so, delete this
37
// exception statement from your version.
38

39 package org.ozoneDB.collections;
40
41 import java.util.Iterator JavaDoc;
42 import org.ozoneDB.OzoneRemote;
43
44 /**
45  * <p>Used by implementations of <code>FullXxx</code> Ozone collections. <code>NodeXxx</code>
46  * have no need for server side iterators. All <code>FullXxx</code> use non-Ozone
47  * objects for 'nodes' inside, all <code>NodeXxx</code> <i>do</i> use Ozone
48  * objects for their internal structure. As an <code>Iterator</code> has direct
49  * links to these internal node objects, it is possible for <code>NodeXxx</code>
50  * collections to have non-Ozone iterators, since they only reference Ozone objects.
51  * This means these iterators can simply be serializable and can leave the
52  * Ozone server. Iterators for <code>FullXxx</code> collections however can not
53  * leave the server since they reference non-Ozone objects; simply serializing
54  * them and sending them to the client would cause the internal node structure
55  * to be copied and send to the client as well. Therefor <code>FullXxx</code>
56  * collections need a server side iterator.</p>
57  * <p>Because an <code>OzoneIterator</code> references non-Ozone objects that
58  * 'belong' to an other Ozone object special precautions have to be taken to
59  * assure that if the collection that an iterator is connected to is serialized,
60  * that the iterator itself does not continue using the non-Ozone objects that
61  * are serialized in the same container as the collection (or vice versa: the
62  * iterator is serialized but the collection is not). One such a precaution
63  * can be throwing a <code>ConcurrentModificationException</code> when one of
64  * the two have been serialized. This is slightly abusing the specs as layed out
65  * by Sun, but there is no other workaround IMHO, at least not until Ozone
66  * supports a way of storing 2 objects in 1 container or keeping objects forced
67  * in main memory.</p>
68  *
69  * @author <a HREF="mailto:ozoneATmekenkampD0Tcom">Leo Mekenkamp (mind the anti-sp@m)</a>
70  */

71 public interface OzoneIterator extends Iterator JavaDoc, OzoneRemote {
72     
73     public Object JavaDoc next(); /*update*/
74     
75     public void remove(); /*update*/
76     
77 }
Popular Tags