KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > TCClass


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.object;
5
6 import com.tc.object.dna.api.DNA;
7 import com.tc.object.dna.api.DNAWriter;
8 import com.tc.object.field.TCField;
9 import com.tc.object.tx.optimistic.OptimisticTransactionManager;
10
11 import java.io.IOException JavaDoc;
12 import java.lang.reflect.Constructor JavaDoc;
13 import java.lang.reflect.Field JavaDoc;
14 import java.util.Map JavaDoc;
15
16 /**
17  * Interface for peer to java.lang.Class. The Class of every object under management is represented by an instance of
18  * TCClass. Keeping a peer of each Class object allows us to organize the class elements in useful ways and to cache
19  * that organization so we only have to do it once per class.
20  * <p>
21  * <b>Important </b>-- It is likely that we will enforce the Serializable contract and only manage those classes which
22  * implement Serializable.
23  * <p>
24  * TODO: Add support for using a serialized instance of classes with no nullary constructor to rehydrate into. <br>
25  * TODO:
26  *
27  * @author Orion Letizi
28  */

29 public interface TCClass {
30
31   public Class JavaDoc getPeerClass();
32
33   public boolean hasOnLoadExecuteScript();
34
35   public boolean hasOnLoadMethod();
36
37   public String JavaDoc getOnLoadMethod();
38
39   public String JavaDoc getOnLoadExecuteScript();
40
41   public Field getParentField();
42
43   public String JavaDoc getParentFieldName();
44
45   public TCField[] getPortableFields();
46
47   /**
48    * Connects the original object to the copy object and creates new copies of referened objects but leaves them
49    * unconnected (mostly this is about doing a deep connected clone without recurrsion so that we don't get stack
50    * overflows
51    */

52   public Map JavaDoc connectedCopy(Object JavaDoc source, Object JavaDoc dest, Map JavaDoc visited, OptimisticTransactionManager txManager);
53
54   public TraversedReferences getPortableObjects(Object JavaDoc pojo, TraversedReferences addTo);
55
56   public Constructor JavaDoc getConstructor() throws NoSuchMethodException JavaDoc, SecurityException JavaDoc;
57
58   public String JavaDoc getName();
59
60   public Class JavaDoc getComponentType();
61
62   public boolean isLogical();
63
64   public ClientObjectManager getObjectManager();
65
66   public TCClass getSuperclass();
67
68   public boolean isNonStaticInner();
69
70   public boolean isEnum();
71
72   public boolean isUseNonDefaultConstructor();
73
74   public Object JavaDoc getNewInstanceFromNonDefaultConstructor(DNA dna) throws IOException JavaDoc, ClassNotFoundException JavaDoc;
75
76   public TCField getField(String JavaDoc name);
77
78   public boolean isIndexed();
79
80   public void hydrate(TCObject tcObject, DNA dna, Object JavaDoc pojo, boolean force) throws IOException JavaDoc,
81       ClassNotFoundException JavaDoc;
82
83   public void dehydrate(TCObject tcObject, DNAWriter writer, Object JavaDoc pojo);
84
85   public String JavaDoc getDefiningLoaderDescription();
86
87   public TCObject createTCObject(ObjectID id, Object JavaDoc peer);
88
89   public String JavaDoc getFieldNameByOffset(long fieldOffset);
90
91   public boolean isProxyClass();
92
93   public String JavaDoc getExtendingClassName();
94 }
95
Popular Tags