Mercurial > hg > Members > nobuyasu > jungle-network
view src/alice/jungle/transaction/NetworkDefaultJungleTree.java @ 42:4419ac56cbfd
implemented serverName filed
author | one |
---|---|
date | Thu, 11 Jul 2013 19:58:36 +0900 |
parents | 2f1879e0acec |
children | fd3643699f83 |
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>(treeName, root,txManager,editor); } @Override public Node getRootNode() { TreeContext<T> tc = repository.get(); ChangeSet cs = tc.getChangeSet(); return cs.getRoot(); } }