Mercurial > hg > Members > nobuyasu > jungle-network
annotate src/alice/jungle/transaction/NetworkDefaultJungleTree.java @ 46:fd3643699f83
modified pom.xml. fix conflict log4j libraries
author | one |
---|---|
date | Fri, 12 Jul 2013 11:27:00 +0900 |
parents | 4419ac56cbfd |
children | ebf42371454b |
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.DefaultTransactionManager; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
12 import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.TreeContext; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
13 |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
14 public class NetworkDefaultJungleTree<T extends TreeNode<T>> implements JungleTree { |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
15 private final AtomicReservableReference<TreeContext<T>> repository; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
16 private final String uuid; |
32 | 17 private final String treeName; |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
18 private final ChangeListWriter writer; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
19 private final TreeEditor editor; |
42 | 20 private final String serverName; |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
21 |
42 | 22 public NetworkDefaultJungleTree(String _treeName, TreeContext<T> _tc,String _uuid,ChangeListWriter _writer,TreeEditor _editor, String _serverName) |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
23 { |
32 | 24 treeName = _treeName; |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
25 repository = new AtomicReservableReference<TreeContext<T>>(_tc); |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
26 uuid = _uuid; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
27 writer = _writer; |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
28 editor = _editor; |
42 | 29 serverName = _serverName; |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
30 } |
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 @Override |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
33 public JungleTreeEditor getTreeEditor() |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
34 { |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
35 TreeContext<T> tc = repository.get(); |
42 | 36 NetworkTransactionManager<T> txManager = new NetworkTransactionManager<T>(treeName, writer,tc,repository,uuid, serverName); |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
37 T root = tc.getTreeNode(); |
46 | 38 return new NetworkDefaultJungleTreeEditor<T>(serverName, treeName, root,txManager,editor); |
12
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
39 } |
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 @Override |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
42 public Node getRootNode() |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
43 { |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
44 TreeContext<T> tc = repository.get(); |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
45 ChangeSet cs = tc.getChangeSet(); |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
46 return cs.getRoot(); |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
47 } |
80680cfcfd3b
add jungle/test/transaction, jungle/test/core/NetworkDefaultJungle
one
parents:
diff
changeset
|
48 } |