KickJava   Java API By Example, From Geeks To Geeks.

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


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.cache.Cacheable;
7 import com.tc.object.dna.api.DNA;
8 import com.tc.object.dna.api.DNAException;
9 import com.tc.object.dna.api.DNAWriter;
10
11 import gnu.trove.TLinkable;
12
13 public interface TCObject extends Cacheable {
14   public static final Long JavaDoc NULL_OBJECT_ID = new Long JavaDoc(-1);
15   public static final int NULL_INDEX = -1;
16
17   public void setNext(TLinkable link);
18
19   public void setPrevious(TLinkable link);
20
21   public TLinkable getNext();
22
23   public TLinkable getPrevious();
24
25   public ObjectID getObjectID();
26
27   public boolean isShared();
28
29   /**
30    * Returns the Object that this TCObject is wrapping. This value will be null if the peer Object is null.
31    */

32   public Object JavaDoc getPeerObject();
33
34   /**
35    * Returns the TCClass for this TCObject. The TCClass is a peer of the Class of the peer Object.
36    */

37   public TCClass getTCClass();
38
39   /**
40    * @param toClear - the number of references to clear atmost
41    * @return - the number of references actually cleared
42    */

43   public int clearReferences(int toClear);
44
45   public Object JavaDoc getResolveLock();
46
47   public void objectFieldChanged(String JavaDoc classname, String JavaDoc fieldname, Object JavaDoc newValue, int index);
48
49   public void booleanFieldChanged(String JavaDoc classname, String JavaDoc fieldname, boolean newValue, int index);
50
51   public void byteFieldChanged(String JavaDoc classname, String JavaDoc fieldname, byte newValue, int index);
52
53   public void charFieldChanged(String JavaDoc classname, String JavaDoc fieldname, char newValue, int index);
54
55   public void doubleFieldChanged(String JavaDoc classname, String JavaDoc fieldname, double newValue, int index);
56
57   public void floatFieldChanged(String JavaDoc classname, String JavaDoc fieldname, float newValue, int index);
58
59   public void intFieldChanged(String JavaDoc classname, String JavaDoc fieldname, int newValue, int index);
60
61   public void longFieldChanged(String JavaDoc classname, String JavaDoc fieldname, long newValue, int index);
62
63   public void shortFieldChanged(String JavaDoc classname, String JavaDoc fieldname, short newValue, int index);
64
65   public void objectArrayChanged(int startPos, Object JavaDoc[] array, int length);
66
67   public void primitiveArrayChanged(int startPos, Object JavaDoc array, int length);
68
69   public void literalValueChanged(Object JavaDoc newValue, Object JavaDoc oldValue);
70
71   public void setLiteralValue(Object JavaDoc newValue);
72
73   /**
74    * Takes a DNA strand and hydrates the object with it.
75    *
76    * @param force true if the DNA should be applied w/o any version checking
77    * @throws ClassNotFoundException
78    */

79   public void hydrate(DNA from, boolean force) throws ClassNotFoundException JavaDoc;
80
81   public ArrayIndexOutOfBoundsException JavaDoc checkArrayIndex(int index);
82
83   public void resolveReference(String JavaDoc fieldName);
84
85   public void resolveArrayReference(int index);
86
87   public void resolveAllReferences();
88
89   public void setReference(String JavaDoc fieldName, ObjectID id);
90
91   public void clearReference(String JavaDoc fieldName);
92
93   public void setValue(String JavaDoc fieldName, Object JavaDoc obj);
94
95   public long getVersion();
96
97   public void setVersion(long version);
98
99   /**
100    * Writers all of the object data to the given DNAWriter
101    */

102   public void dehydrate(DNAWriter writer) throws DNAException;
103
104   public boolean getAndResetNew();
105
106   public void setIsNew();
107
108   public boolean isNew();
109
110   public void objectFieldChangedByOffset(String JavaDoc classname, long fieldOffset, Object JavaDoc newValue, int index);
111
112   public String JavaDoc getFieldNameByOffset(long fieldOffset);
113
114   public void logicalInvoke(int method, String JavaDoc methodSignature, Object JavaDoc[] params);
115
116   public void disableAutoLocking();
117
118   public boolean autoLockingDisabled();
119 }
120
121
122
Popular Tags