Mercurial > hg > Database > jungle-network
annotate src/alice/jungle/transaction/NetworkDefaultJungleTree.java @ 92:e95faa202b4f
Modified NetworkDefaultJungleTreeEditor class. Removed uuid and serverUpdater fields
author | one |
---|---|
date | Mon, 11 Nov 2013 19:35:22 +0900 |
parents | 2c7b3f2b2ee1 |
children | 75cf01a430a6 |
rev | line source |
---|---|
31 | 1 package alice.jungle.transaction; |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
2 |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
3 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTree; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
4 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
5 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
6 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeListWriter; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
7 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
8 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeEditor; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
9 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
10 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.AtomicReservableReference; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
11 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.TreeContext; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
12 |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
13 public class NetworkDefaultJungleTree<T extends TreeNode<T>> implements JungleTree { |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
14 private final AtomicReservableReference<TreeContext<T>> repository; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
15 private final String uuid; |
32 | 16 private final String treeName; |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
17 private final ChangeListWriter writer; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
18 private final TreeEditor editor; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
19 |
91 | 20 public NetworkDefaultJungleTree(String _treeName, TreeContext<T> _tc,String _uuid,ChangeListWriter _writer,TreeEditor _editor) |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
21 { |
32 | 22 treeName = _treeName; |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
23 repository = new AtomicReservableReference<TreeContext<T>>(_tc); |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
24 uuid = _uuid; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
25 writer = _writer; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
26 editor = _editor; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
27 } |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
28 |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
29 @Override |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
30 public JungleTreeEditor getTreeEditor() |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
31 { |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
32 TreeContext<T> tc = repository.get(); |
91 | 33 NetworkTransactionManager<T> txManager = new NetworkTransactionManager<T>(treeName, writer,tc,repository,uuid); |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
34 T root = tc.getTreeNode(); |
92
e95faa202b4f
Modified NetworkDefaultJungleTreeEditor class. Removed uuid and serverUpdater fields
one
parents:
91
diff
changeset
|
35 return new NetworkDefaultJungleTreeEditor<T>(treeName, root,txManager,editor); |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
36 } |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
37 |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
38 @Override |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
39 public Node getRootNode() |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
40 { |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
41 TreeContext<T> tc = repository.get(); |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
42 ChangeSet cs = tc.getChangeSet(); |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
43 return cs.getRoot(); |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
44 } |
67 | 45 |
46 | |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
47 } |