01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.objectserver.core.api;
05:
06: import com.tc.object.ObjectID;
07: import com.tc.object.dna.api.DNACursor;
08: import com.tc.object.dna.api.DNAWriter;
09: 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;
14: import java.io.ObjectOutput;
15: import java.util.Set;
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: public static final byte URL_TYPE = 0x0f;
44:
45: public void apply(ObjectID objectID, DNACursor cursor,
46: BackReferences includeIDs) throws IOException;
47:
48: public Set getObjectReferences();
49:
50: public void addObjectReferencesTo(ManagedObjectTraverser traverser);
51:
52: public void dehydrate(ObjectID objectID, DNAWriter writer);
53:
54: public ManagedObjectFacade createFacade(ObjectID objectID,
55: String className, int limit);
56:
57: public byte getType();
58:
59: public String getClassName();
60:
61: public String getLoaderDescription();
62:
63: public void writeTo(ObjectOutput o) throws IOException;
64:
65: // The readFrom() method is currently a static implementation in each state object till I figure out
66: // a cleaner way to create physical managed object as each one uses a different class object.
67: // public void readFrom(ObjectInput i) throws IOException;
68: }
|