KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > tx > optimistic > DNAToChangeBufferBridge


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.tx.optimistic;
5
6 import com.tc.exception.ImplementMe;
7 import com.tc.object.ObjectID;
8 import com.tc.object.TCObject;
9 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(OptimisticTransactionManager txManager, TCChangeBuffer buffer) {
20     this.txManager = txManager;
21     this.buffer = buffer;
22     this.tcObject = buffer.getTCObject();
23   }
24
25   public long getVersion() {
26     return tcObject.getVersion();
27   }
28
29   public boolean hasLength() {
30     return tcObject.getTCClass().isIndexed();
31   }
32
33   public int getArraySize() {
34     throw new ImplementMe();
35
36   }
37
38   public boolean isDelta() {
39     return true;
40   }
41
42   public String JavaDoc getTypeName() {
43     return tcObject.getTCClass().getName();
44   }
45
46   public ObjectID getObjectID() throws DNAException {
47     return tcObject.getObjectID();
48   }
49
50   public ObjectID getParentObjectID() throws DNAException {
51     throw new ImplementMe();
52   }
53
54   public DNACursor getCursor() {
55     return buffer.getDNACursor(txManager);
56   }
57
58   public String JavaDoc getDefiningLoaderDescription() {
59     throw new ImplementMe();
60   }
61
62 }
63
Popular Tags