1 5 package com.tc.object.tx.optimistic; 6 7 11 12 import com.tc.exception.ImplementMe; 13 import com.tc.object.ObjectID; 14 import com.tc.object.TCClass; 15 import com.tc.object.TCObject; 16 import com.tc.object.dna.api.DNA; 17 import com.tc.object.dna.api.DNAException; 18 import com.tc.object.dna.api.DNAWriter; 19 20 import gnu.trove.TLinkable; 21 22 public class TCObjectClone implements TCObject { 23 private final ObjectID objectID; 24 private final long version; 25 private final OptimisticTransactionManager txManager; 26 private final TCClass tcClass; 27 private final int arrayLength; 28 29 public TCObjectClone(TCObject source, OptimisticTransactionManager txManager) { 30 this(source, txManager, -1); 31 } 32 33 public TCObjectClone(TCObject source, OptimisticTransactionManager txManager, int arrayLength) { 34 this.version = source.getVersion(); 35 this.objectID = source.getObjectID(); 36 this.txManager = txManager; 37 this.tcClass = source.getTCClass(); 38 this.arrayLength = arrayLength; 39 } 40 41 public void setNext(TLinkable link) { 42 throw new ImplementMe(); 43 } 44 45 public void setPrevious(TLinkable link) { 46 throw new ImplementMe(); 47 } 48 49 public TLinkable getNext() { 50 throw new ImplementMe(); 51 } 52 53 public TLinkable getPrevious() { 54 throw new ImplementMe(); 55 } 56 57 public ObjectID getObjectID() { 58 return objectID; 59 } 60 61 public Object getPeerObject() { 62 throw new ImplementMe(); 63 } 64 65 public TCClass getTCClass() { 66 return tcClass; 67 } 68 69 public int clearReferences(int toClear) { 70 throw new ImplementMe(); 71 } 72 73 public Object getResolveLock() { 74 return this; 75 } 76 77 public void objectFieldChanged(String classname, String fieldname, Object newValue, int index) { 78 txManager.objectFieldChanged(this, classname, fieldname, newValue, index); 79 } 80 81 public void booleanFieldChanged(String classname, String fieldname, boolean newValue, int index) { 82 this.objectFieldChanged(classname, fieldname, new Boolean (newValue), index); 83 } 84 85 public void byteFieldChanged(String classname, String fieldname, byte newValue, int index) { 86 this.objectFieldChanged(classname, fieldname, new Byte (newValue), index); 87 } 88 89 public void charFieldChanged(String classname, String fieldname, char newValue, int index) { 90 this.objectFieldChanged(classname, fieldname, new Character (newValue), index); 91 } 92 93 public void doubleFieldChanged(String classname, String fieldname, double newValue, int index) { 94 this.objectFieldChanged(classname, fieldname, new Double (newValue), index); 95 } 96 97 public void floatFieldChanged(String classname, String fieldname, float newValue, int index) { 98 this.objectFieldChanged(classname, fieldname, new Float (newValue), index); 99 } 100 101 public void intFieldChanged(String classname, String fieldname, int newValue, int index) { 102 this.objectFieldChanged(classname, fieldname, new Integer (newValue), index); 103 } 104 105 public void longFieldChanged(String classname, String fieldname, long newValue, int index) { 106 this.objectFieldChanged(classname, fieldname, new Long (newValue), index); 107 } 108 109 public void shortFieldChanged(String classname, String fieldname, short newValue, int index) { 110 this.objectFieldChanged(classname, fieldname, new Short (newValue), index); 111 } 112 113 public void logicalInvoke(int method, String methodName, Object [] parameters) { 114 txManager.logicalInvoke(this, method, methodName, parameters); 115 } 116 117 public void hydrate(DNA from, boolean force) throws DNAException { 118 throw new ImplementMe(); 119 } 120 121 public void resolveReference(String fieldName) { 122 } 124 125 public void resolveArrayReference(int index) { 126 } 128 129 public boolean isShared() { 130 return false; 131 } 132 133 public void resolveAllReferences() { 134 } 136 137 public void setReference(String fieldName, ObjectID id) { 138 throw new ImplementMe(); 139 140 } 141 142 public void clearReference(String fieldName) { 143 throw new ImplementMe(); 144 145 } 146 147 public void setValue(String fieldName, Object obj) { 148 throw new ImplementMe(); 149 150 } 151 152 public long getVersion() { 153 return version; 154 } 155 156 public void setVersion(long version) { 157 throw new ImplementMe(); 158 } 159 160 public void dehydrate(DNAWriter writer) throws DNAException { 161 throw new ImplementMe(); 162 } 163 164 public boolean getAndResetNew() { 165 throw new ImplementMe(); 166 } 167 168 public void setIsNew() { 169 throw new ImplementMe(); 170 } 171 172 public boolean isNew() { 173 return false; 174 } 175 176 public void markAccessed() { 177 throw new ImplementMe(); 178 } 179 180 public void clearAccessed() { 181 throw new ImplementMe(); 182 } 183 184 public boolean recentlyAccessed() { 185 throw new ImplementMe(); 186 } 187 188 public void objectFieldChangedByOffset(String classname, long fieldOffset, Object newValue, int index) { 189 String fieldname = tcClass.getFieldNameByOffset(fieldOffset); 190 objectFieldChanged(classname, fieldname, newValue, index); 191 } 192 193 public String getFieldNameByOffset(long fieldOffset) { 194 throw new ImplementMe(); 195 } 196 197 public void disableAutoLocking() { 198 throw new ImplementMe(); 199 } 200 201 public boolean autoLockingDisabled() { 202 return false; 203 } 204 205 public boolean canEvict() { 206 throw new ImplementMe(); 207 } 208 209 public void objectArrayChanged(int startPos, Object [] array, int length) { 210 throw new ImplementMe(); 211 } 212 213 public void primitiveArrayChanged(int startPos, Object arra, int lengthy) { 214 throw new ImplementMe(); 215 } 216 217 public int accessCount(int factor) { 218 throw new ImplementMe(); 219 } 220 221 public void literalValueChanged(Object newValue, Object oldValue) { 222 throw new ImplementMe(); 223 } 224 225 public void setLiteralValue(Object newValue) { 226 throw new ImplementMe(); 227 } 228 229 public ArrayIndexOutOfBoundsException checkArrayIndex(int index) { 230 if (arrayLength < 0) { throw new AssertionError (); } 231 if (index < 0 || index >= arrayLength) { return new ArrayIndexOutOfBoundsException (index); } 232 return null; 233 } 234 235 } 236 | Popular Tags |