KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > objectserver > core > api > ManagedObjectState


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.core.api;
5
6 import com.tc.object.ObjectID;
7 import com.tc.object.dna.api.DNACursor;
8 import com.tc.object.dna.api.DNAWriter;
9 import com.tc.objectserver.managedobject.BackReferences;
10 import com.tc.objectserver.managedobject.ManagedObjectTraverser;
11 import com.tc.objectserver.mgmt.ManagedObjectFacade;
12
13 import java.io.IOException JavaDoc;
14 import java.io.ObjectOutput JavaDoc;
15 import java.util.Set JavaDoc;
16
17 /**
18  * Dec 16, 2004: The internal state of a managed object.
19  */

20 public interface ManagedObjectState {
21
22   /*
23    * If you are adding new State objects, you need to add Serialization support in ManagedObjectStateFactory
24    *
25    * The unit test ManagedObjectStateSerializationTest will also need to have a test case for
26    * each of these types, which is defined to be public static final. This will ensure that
27    * Serialization support is added to ManagedObjectStateFactory.
28    */

29   public static final byte PHYSICAL_TYPE = 0x01;
30   public static final byte DATE_TYPE = 0x02;
31   public static final byte MAP_TYPE = 0x03;
32   public static final byte LINKED_HASHMAP_TYPE = 0x04;
33   public static final byte ARRAY_TYPE = 0x05;
34   public static final byte LITERAL_TYPE = 0x06;
35   public static final byte LIST_TYPE = 0x07;
36   public static final byte SET_TYPE = 0x08;
37   public static final byte TREE_SET_TYPE = 0x09;
38   public static final byte TREE_MAP_TYPE = 0x0a;
39   public static final byte QUEUE_TYPE = 0x0b;
40   public static final byte CONCURRENT_HASHMAP_TYPE = 0x0c;
41   public static final byte PROXY_TYPE = 0x0d;
42   public static final byte PARTIAL_MAP_TYPE = 0x0e;
43
44   public void apply(ObjectID objectID, DNACursor cursor, BackReferences includeIDs) throws IOException JavaDoc;
45
46   public Set JavaDoc getObjectReferences();
47
48   public void addObjectReferencesTo(ManagedObjectTraverser traverser);
49   
50   public void dehydrate(ObjectID objectID, DNAWriter writer);
51   
52   public ManagedObjectFacade createFacade(ObjectID objectID, String JavaDoc className, int limit);
53   
54   public byte getType();
55   
56   public String JavaDoc getClassName();
57   
58   public String JavaDoc getLoaderDescription();
59   
60   public void writeTo(ObjectOutput JavaDoc o) throws IOException JavaDoc;
61
62   // The readFrom() method is currently a static implementation in each state object till I figure out
63
// a cleaner way to create physical managed object as each one uses a different class object.
64
// public void readFrom(ObjectInput i) throws IOException;
65
}
66
Popular Tags