Mercurial > hg > Members > nobuyasu > jungle-network
view 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 (2013-07-12) |
parents | 4419ac56cbfd |
children | ebf42371454b |
line wrap: on
line source
package alice.jungle.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 String treeName; private final ChangeListWriter writer; private final TreeEditor editor; private final String serverName; public NetworkDefaultJungleTree(String _treeName, TreeContext<T> _tc,String _uuid,ChangeListWriter _writer,TreeEditor _editor, String _serverName) { treeName = _treeName; repository = new AtomicReservableReference<TreeContext<T>>(_tc); uuid = _uuid; writer = _writer; editor = _editor; serverName = _serverName; } @Override public JungleTreeEditor getTreeEditor() { TreeContext<T> tc = repository.get(); NetworkTransactionManager<T> txManager = new NetworkTransactionManager<T>(treeName, writer,tc,repository,uuid, serverName); T root = tc.getTreeNode(); return new NetworkDefaultJungleTreeEditor<T>(serverName, treeName, root,txManager,editor); } @Override public Node getRootNode() { TreeContext<T> tc = repository.get(); ChangeSet cs = tc.getChangeSet(); return cs.getRoot(); } }