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.object.tx.optimistic;
05:
06: import com.tc.exception.ImplementMe;
07: import com.tc.object.ObjectID;
08: import com.tc.object.TCObject;
09: import com.tc.object.change.TCChangeBuffer;
10: import com.tc.object.dna.api.DNA;
11: import com.tc.object.dna.api.DNACursor;
12: import com.tc.object.dna.api.DNAException;
13:
14: public class DNAToChangeBufferBridge implements DNA {//, DNACursor {
15: private final OptimisticTransactionManager txManager;
16: private final TCChangeBuffer buffer;
17: private final TCObject tcObject;
18:
19: public DNAToChangeBufferBridge(
20: OptimisticTransactionManager txManager,
21: TCChangeBuffer buffer) {
22: this .txManager = txManager;
23: this .buffer = buffer;
24: this .tcObject = buffer.getTCObject();
25: }
26:
27: public long getVersion() {
28: return tcObject.getVersion();
29: }
30:
31: public boolean hasLength() {
32: return tcObject.getTCClass().isIndexed();
33: }
34:
35: public int getArraySize() {
36: throw new ImplementMe();
37:
38: }
39:
40: public boolean isDelta() {
41: return true;
42: }
43:
44: public String getTypeName() {
45: return tcObject.getTCClass().getName();
46: }
47:
48: public ObjectID getObjectID() throws DNAException {
49: return tcObject.getObjectID();
50: }
51:
52: public ObjectID getParentObjectID() throws DNAException {
53: throw new ImplementMe();
54: }
55:
56: public DNACursor getCursor() {
57: return buffer.getDNACursor(txManager);
58: }
59:
60: public String getDefiningLoaderDescription() {
61: throw new ImplementMe();
62: }
63:
64: }
|