KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > managedobject > PartialMapManagedObjectState


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.objectserver.managedobject;
5
6 import com.tc.object.ObjectID;
7
8 import java.io.IOException JavaDoc;
9 import java.io.ObjectInput JavaDoc;
10 import java.util.Map JavaDoc;
11
12 /**
13  * This class represents Maps that can handle partial collections in the L1 side. Currently supported classses are
14  * HashMap, LinkedHashMap, Hashtable and Properties. This class should eventually go away once we support partial
15  * collections to all maps.
16  */

17 public class PartialMapManagedObjectState extends MapManagedObjectState {
18
19   protected PartialMapManagedObjectState(long classID, Map JavaDoc map) {
20     super(classID, map);
21   }
22
23   public PartialMapManagedObjectState(ObjectInput JavaDoc in) throws IOException JavaDoc {
24     super(in);
25   }
26
27   public void addObjectReferencesTo(ManagedObjectTraverser traverser) {
28       traverser.addRequiredObjectIDs(getObjectReferencesFrom(references.keySet()));
29       traverser.addReachableObjectIDs(getObjectReferencesFrom(references.values()));
30   }
31
32   protected void addBackReferenceForValue(BackReferences includeIDs, ObjectID value, ObjectID map) {
33     // Not adding to the backreference so the we dont force the server to do a prefetch on apply
34
return;
35   }
36
37   public byte getType() {
38     return PARTIAL_MAP_TYPE;
39   }
40
41   static MapManagedObjectState readFrom(ObjectInput JavaDoc in) throws IOException JavaDoc, ClassNotFoundException JavaDoc {
42     if (false) {
43       // This is added to make the compiler happy. For some reason if I have readFrom() method throw
44
// ClassNotFoundException in LinkedHashMapManagedObjectState, it shows as an error !!
45
throw new ClassNotFoundException JavaDoc();
46     }
47     return new PartialMapManagedObjectState(in);
48   }
49 }
50
Popular Tags