Mercurial > hg > Members > nobuyasu > jungle-network
view src/jungle/test/transaction/NetworkDefaultJungleTree.java @ 29:16ea4835f36e
modified LogReadCodeSegment
author | one |
---|---|
date | Mon, 01 Jul 2013 19:36:17 +0900 |
parents | 80680cfcfd3b |
children |
line wrap: on
line source
package jungle.test.transaction; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTree; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTreeEditor; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.core.Node; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeListWriter; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeEditor; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.AtomicReservableReference; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTransactionManager; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.TreeContext; public class NetworkDefaultJungleTree<T extends TreeNode<T>> implements JungleTree { private final AtomicReservableReference<TreeContext<T>> repository; private final String uuid; private final ChangeListWriter writer; private final TreeEditor editor; public NetworkDefaultJungleTree(TreeContext<T> _tc,String _uuid,ChangeListWriter _writer,TreeEditor _editor) { repository = new AtomicReservableReference<TreeContext<T>>(_tc); uuid = _uuid; writer = _writer; editor = _editor; } @Override public JungleTreeEditor getTreeEditor() { TreeContext<T> tc = repository.get(); DefaultTransactionManager<T> txManager = new DefaultTransactionManager<T>(writer,tc,repository,uuid); T root = tc.getTreeNode(); return new NetworkDefaultJungleTreeEditor<T>(root,txManager,editor); } @Override public Node getRootNode() { TreeContext<T> tc = repository.get(); ChangeSet cs = tc.getChangeSet(); return cs.getRoot(); } }