Mercurial > hg > Members > nobuyasu > jungle-network
changeset 193:89c15aa2bc6d
change transaction
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/.idea/uiDesigner.xml Fri Mar 20 16:18:42 2015 +0900 @@ -0,0 +1,124 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="Palette2"> + <group name="Swing"> + <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" /> + </item> + <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" /> + </item> + <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true"> + <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" /> + <initial-values> + <property name="text" value="Button" /> + </initial-values> + </item> + <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="RadioButton" /> + </initial-values> + </item> + <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="CheckBox" /> + </initial-values> + </item> + <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" /> + <initial-values> + <property name="text" value="Label" /> + </initial-values> + </item> + <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1"> + <preferred-size width="150" height="-1" /> + </default-constraints> + </item> + <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3"> + <preferred-size width="150" height="50" /> + </default-constraints> + </item> + <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> + <preferred-size width="200" height="200" /> + </default-constraints> + </item> + <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3"> + <preferred-size width="200" height="200" /> + </default-constraints> + </item> + <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" /> + </item> + <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" /> + </item> + <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" /> + </item> + <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1"> + <preferred-size width="-1" height="20" /> + </default-constraints> + </item> + <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false"> + <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" /> + </item> + <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false"> + <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" /> + </item> + </group> + </component> +</project> \ No newline at end of file
--- a/.settings/org.eclipse.jdt.core.prefs Tue Jan 20 09:30:59 2015 +0900 +++ b/.settings/org.eclipse.jdt.core.prefs Fri Mar 20 16:18:42 2015 +0900 @@ -1,5 +1,5 @@ # -#Thu Jan 15 09:34:36 JST 2015 +#Wed Mar 11 12:29:02 JST 2015 org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve @@ -8,8 +8,8 @@ org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.debug.lineNumber=generate -eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
--- a/src/main/java/alice/jungle/core/NetworkDefaultJungle.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/alice/jungle/core/NetworkDefaultJungle.java Fri Mar 20 16:18:42 2015 +0900 @@ -8,15 +8,14 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTree; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.Journal; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeContext; 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.store.operations.TreeOperation; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultChangeSet; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeContext; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeNode; -import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.Index; import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.ParentIndex; +import fj.Ord; import fj.data.List; import fj.data.TreeMap; @@ -58,10 +57,9 @@ } }; TreeNode root = new DefaultTreeNode(); - TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> indexList = new Index().getIndex(); + TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> indexList = TreeMap.empty(Ord.stringOrd); TreeMap<TreeNode, TreeNode> parentIndex = new ParentIndex().getParentIndex(); - ChangeSet set = new DefaultChangeSet(root, null, list, uuid, name, 0, indexList, parentIndex); - DefaultTreeContext tc = new DefaultTreeContext(root, set); + TreeContext tc = new DefaultTreeContext(root, null, list, uuid, name, 0, indexList, parentIndex); JungleTree newTree = new NetworkDefaultJungleTree(name, tc, uuid, journal.getWriter(), editor); if (trees.putIfAbsent(name, newTree) != null) { return null;
--- a/src/main/java/alice/jungle/operations/NetworkDeleteAttributeOperation.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/alice/jungle/operations/NetworkDeleteAttributeOperation.java Fri Mar 20 16:18:42 2015 +0900 @@ -7,7 +7,6 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.DeleteAttribute; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error;
--- a/src/main/java/alice/jungle/operations/NetworkDeleteChildAtOperation.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/alice/jungle/operations/NetworkDeleteChildAtOperation.java Fri Mar 20 16:18:42 2015 +0900 @@ -7,7 +7,6 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.DeleteChildAt; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error;
--- a/src/main/java/alice/jungle/operations/NetworkNodeOperation.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/alice/jungle/operations/NetworkNodeOperation.java Fri Mar 20 16:18:42 2015 +0900 @@ -5,10 +5,6 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.AppendChildAt; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.DeleteAttribute; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.DeleteChildAt; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.PutAttribute; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error;
--- a/src/main/java/alice/jungle/operations/NetworkPutAttributeOperation.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/alice/jungle/operations/NetworkPutAttributeOperation.java Fri Mar 20 16:18:42 2015 +0900 @@ -7,7 +7,6 @@ import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.Command; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.NodeOperation; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.trasnformer.PutAttribute; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; @Message
--- a/src/main/java/alice/jungle/persistent/PersistentChangeList.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/alice/jungle/persistent/PersistentChangeList.java Fri Mar 20 16:18:42 2015 +0900 @@ -4,7 +4,7 @@ import alice.jungle.operations.NetworkTreeOperationLog; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeContext; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.TreeOperationLog; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; @@ -26,7 +26,7 @@ uuid = _log.getUUID(); } - public PersistentChangeList(ChangeSet cs) { + public PersistentChangeList(TreeContext cs) { treeName = cs.getTreeName(); uuid = cs.uuid(); log = new NetworkTreeOperationLog(cs.getChangeList());
--- a/src/main/java/alice/jungle/persistent/PersistentChangeSet.java Tue Jan 20 09:30:59 2015 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,78 +0,0 @@ -package alice.jungle.persistent; - -import fj.data.TreeMap; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; -import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.Index; -import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.ParentIndex; - -public class PersistentChangeSet implements ChangeSet { - private final TreeNode root; - private final ChangeSet previous; - private final ChangeList changeList; - private final String uuid; - private final long revision; - private final String treeName; - private final TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> indexList; - private final TreeMap<TreeNode, TreeNode> parentIndex; - - public PersistentChangeSet(TreeNode _node, ChangeSet _prev, ChangeList _log, String _uuid, String _treeName, - long _revision, TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> indexList, - TreeMap<TreeNode, TreeNode> parentIndex) { - root = _node; - previous = _prev; - changeList = _log; - uuid = _uuid; - revision = _revision; - treeName = _treeName; - this.indexList = indexList; - this.parentIndex = parentIndex; - } - - @Override - public TreeNode getRoot() { - return root; - } - - @Override - public ChangeSet prev() { - return previous; - } - - @Override - public ChangeList getChangeList() { - return changeList; - } - - @Override - public String uuid() { - return uuid; - } - - @Override - public long revision() { - return revision; - } - - @Override - public Iterable<TreeOperation> getOperations() { - return changeList; - } - - public String getTreeName() { - return treeName; - } - - @Override - public Index getIndex() { - return new Index(indexList); - } - - @Override - public ParentIndex getParentIndex() { - return new ParentIndex(parentIndex); - } - -}
--- a/src/main/java/alice/jungle/persistent/PersistentJungle.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/alice/jungle/persistent/PersistentJungle.java Fri Mar 20 16:18:42 2015 +0900 @@ -3,18 +3,17 @@ import java.util.Iterator; import java.util.concurrent.ConcurrentHashMap; +import fj.Ord; import fj.data.List; import fj.data.TreeMap; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.Jungle; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.JungleTree; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeContext; 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.store.operations.TreeOperation; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeContext; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeNode; -import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.Index; import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.ParentIndex; public class PersistentJungle implements Jungle { @@ -55,10 +54,9 @@ } }; TreeNode root = new DefaultTreeNode(); - TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> indexList = new Index().getIndex(); + TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> indexList = TreeMap.empty(Ord.stringOrd); TreeMap<TreeNode, TreeNode> parentIndex = new ParentIndex().getParentIndex(); - ChangeSet set = new PersistentChangeSet(root, null, list, uuid, name, 0, indexList, parentIndex); - DefaultTreeContext tc = new DefaultTreeContext(root, set); + TreeContext tc = new PersistentTreeContext(root, null, list, uuid, name, 0, indexList, parentIndex); JungleTree newTree = new PersistentJungleTree(name, tc, uuid, journal.getWriter(), editor); if (trees.putIfAbsent(name, newTree) != null) { return null;
--- a/src/main/java/alice/jungle/persistent/PersistentJungleTree.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/alice/jungle/persistent/PersistentJungleTree.java Fri Mar 20 16:18:42 2015 +0900 @@ -1,30 +1,26 @@ package alice.jungle.persistent; -import fj.data.List; import fj.data.TreeMap; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.DefaultJungleTree; 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.persistent.ChangeListWriter; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeContext; 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.DefaultJungleTreeEditor; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeContext; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.TreeContext; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser.InterfaceTraverser; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.GetOldTreeError; -import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.Index; -import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.IndexManager; import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.ParentIndex; +import java.util.concurrent.atomic.AtomicReference; + public class PersistentJungleTree implements JungleTree { - private final AtomicReservableReference<TreeContext> repository; + private final AtomicReference<TreeContext> repository; private final String uuid; private final String treeName; private final ChangeListWriter writer; @@ -33,7 +29,7 @@ public PersistentJungleTree(String _treeName, TreeContext _tc,String _uuid, ChangeListWriter _writer,TreeEditor _editor) { treeName = _treeName; - repository = new AtomicReservableReference<TreeContext>(_tc); + repository = new AtomicReference<TreeContext>(_tc); uuid = _uuid; writer = _writer; editor = _editor; @@ -44,7 +40,7 @@ { TreeContext tc = repository.get(); PersistentTransactionManager txManager = new PersistentTransactionManager(treeName, writer,tc,repository,uuid); - TreeNode root = tc.getTreeNode(); + TreeNode root = tc.getRoot(); return new DefaultJungleTreeEditor(root,txManager,editor); } @@ -52,8 +48,7 @@ public TreeNode getRootNode() { TreeContext tc = repository.get(); - ChangeSet cs = tc.getChangeSet(); - return cs.getRoot(); + return tc.getRoot(); } @Override @@ -64,64 +59,56 @@ @Override public long revision() { TreeContext tc = repository.get(); - ChangeSet cs = tc.getChangeSet(); - return cs.revision(); + return tc.revision(); } - @Override - public Either<Error, JungleTree> getOldTree(long revision) { - TreeContext tc = repository.get(); - ChangeSet cs = tc.getChangeSet(); + @Override + public Either<Error, JungleTree> getOldTree(long revision) { + TreeContext tc = repository.get(); - for (; cs.revision() != revision;) { - cs = cs.prev(); - if (cs == null) - return DefaultEither.newA(GetOldTreeError.OLD_TREE_NOT_FOUND); - } + for (; tc.revision() != revision;) { + tc = tc.prev(); + if (tc == null) + return DefaultEither.newA(GetOldTreeError.OLD_TREE_NOT_FOUND); + } - TreeNode root = cs.getRoot(); - TreeContext oldTc = new DefaultTreeContext(root, cs); - String oldTreeUuid = uuid + revision; - JungleTree oldTree = new DefaultJungleTree(oldTc, oldTreeUuid, writer, editor); - return DefaultEither.newB(oldTree); - } + String oldTreeUuid = uuid + revision; + JungleTree oldTree = new DefaultJungleTree(tc, oldTreeUuid, writer, editor); + return DefaultEither.newB(oldTree); + } @Override public ParentIndex getParentIndex() { TreeContext tc = repository.get(); - ChangeSet cs = tc.getChangeSet(); - return cs.getParentIndex(); + return tc.getParentIndex(); } @Override - public Index getIndex() { + public TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> getIndex() { TreeContext tc = repository.get(); - ChangeSet cs = tc.getChangeSet(); - return cs.getIndex(); + return tc.getIndex(); } @Override public InterfaceTraverser getTraverser(boolean useIndex) { - AtomicReservableReference<TreeContext>.Reservation reservation = repository.getReservation(); - IndexManager indexManager = new IndexManager(reservation); - Index index = getIndex(); + TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> index = getIndex(); ParentIndex parentIndex = getParentIndex(); - return new InterfaceTraverser(getRootNode(), index, parentIndex, indexManager, useIndex); + return new InterfaceTraverser(getRootNode(), index, parentIndex, useIndex); } - @Override - public Either<Error, TreeNode> getNodeOfPath(NodePath path) { - TreeNode node = repository.get().getTreeNode(); - for (int num : path) { - if (num == -1) - continue; - Either<Error, TreeNode> either = node.getChildren().at(num); - if (either.isA()) - return either; - node = either.b(); + @Override + public Either<Error, TreeNode> getNodeOfPath(NodePath path) { + TreeNode node = repository.get().getRoot(); + for (int num : path) { + if (num == -1) + continue; + Either<Error, TreeNode> either = node.getChildren().at(num); + if (either.isA()) + return either; + node = either.b(); + } + return DefaultEither.newB(node); } - return DefaultEither.newB(node); - } }
--- a/src/main/java/alice/jungle/persistent/PersistentTransactionManager.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/alice/jungle/persistent/PersistentTransactionManager.java Fri Mar 20 16:18:42 2015 +0900 @@ -1,34 +1,30 @@ package alice.jungle.persistent; +import fj.data.TreeMap; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeListWriter; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.Result; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeContext; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.TreeOperationLog; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.AtomicReservableReference; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeContext; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.TransactionManager; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.TreeContext; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.AtomicReservableReference.Reservation; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser.InterfaceTraverser; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultError; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.Index; -import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.IndexManager; import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.ParentIndex; +import java.util.concurrent.atomic.AtomicReference; + public class PersistentTransactionManager implements TransactionManager { - private final AtomicReservableReference<TreeContext> repository; + private final AtomicReference<TreeContext> repository; private final TreeContext tip; private final ChangeListWriter writer; private final String uuid; private final String treeName; public PersistentTransactionManager(String _treeName, ChangeListWriter _writer,TreeContext _tip, - AtomicReservableReference<TreeContext> _repository,String _uuid) + AtomicReference<TreeContext> _repository,String _uuid) { repository = _repository; tip = _tip; @@ -39,38 +35,29 @@ @Override public Either<Error, TransactionManager> commit(TreeNode _newRoot,final TreeOperationLog _log) { - ChangeSet cs = tip.getChangeSet(); - long currentRevision = cs.revision(); + long currentRevision = tip.revision(); long nextRevision = currentRevision + 1; - - PersistentChangeList list = new PersistentChangeList(uuid, treeName, _log); - IndexManager indexManager = new IndexManager(repository.getReservation()); - InterfaceTraverser traverser = new InterfaceTraverser(_newRoot, indexManager, false); + + PersistentChangeList list = new PersistentChangeList(uuid, treeName, _log); + InterfaceTraverser traverser = new InterfaceTraverser(_newRoot,false); traverser.createIndex(); - Index index = traverser.getIndex(); + TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> index = traverser.getIndex(); ParentIndex parentIndex = traverser.getParentIndex(); - PersistentChangeSet newCs = new PersistentChangeSet(_newRoot, cs, list, uuid, treeName, nextRevision, index.getIndex(), parentIndex.getParentIndex()); - DefaultTreeContext newContext = new DefaultTreeContext(_newRoot,newCs); - - @SuppressWarnings("rawtypes") - Reservation reservation = repository.makeReservation(tip, newContext); - if(reservation == null) { - return DefaultEither.newA((Error)new DefaultError()); - } - Result r = writer.write(list); - if(r != Result.SUCCESS) { - return DefaultEither.newA((Error)new DefaultError()); - } - reservation.confirm(); - TransactionManager txManager = new PersistentTransactionManager(treeName, writer, newContext, repository, uuid); - return DefaultEither.newB(txManager); + PersistentTreeContext newContext = new PersistentTreeContext(_newRoot, tip, list, uuid, treeName, nextRevision, index, parentIndex.getParentIndex()); + + if (repository.compareAndSet(newContext.prev(),newContext)) { + TransactionManager txManager = new PersistentTransactionManager(treeName, writer, newContext, repository, uuid); + return DefaultEither.newB(txManager); + } + + return DefaultEither.newA((Error) new DefaultError()); + } @Override public long getRevision() { - ChangeSet cs = tip.getChangeSet(); - return cs.revision(); + return tip.revision(); } @Override
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/main/java/alice/jungle/persistent/PersistentTreeContext.java Fri Mar 20 16:18:42 2015 +0900 @@ -0,0 +1,87 @@ +package alice.jungle.persistent; + +import fj.Ord; +import fj.data.TreeMap; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeContext; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; +import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.ParentIndex; + +public class PersistentTreeContext implements TreeContext { + private final TreeNode root; + private final TreeContext previous; + private final ChangeList changeList; + private final String uuid; + private final long revision; + private final String treeName; + private TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> indexList; + private TreeMap<TreeNode, TreeNode> parentIndex; + + public PersistentTreeContext(TreeNode _node, TreeContext _prev, ChangeList _log, String _uuid, String _treeName, + long _revision, TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> indexList, + TreeMap<TreeNode, TreeNode> parentIndex) { + root = _node; + previous = _prev; + changeList = _log; + uuid = _uuid; + revision = _revision; + treeName = _treeName; + this.indexList = indexList; + this.parentIndex = parentIndex; + } + + @Override + public TreeNode getRoot() { + return root; + } + + @Override + public TreeContext prev() { + return previous; + } + + @Override + public ChangeList getChangeList() { + return changeList; + } + + @Override + public String uuid() { + return uuid; + } + + @Override + public long revision() { + return revision; + } + + @Override + public Iterable<TreeOperation> getOperations() { + return changeList; + } + + public String getTreeName() { + return treeName; + } + @Override + public TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> getIndex() { + return indexList; + } + + @Override + public ParentIndex getParentIndex() { + return new ParentIndex(parentIndex); + } + + @Override + public void setIndex(TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> indexList) { + this.indexList = indexList; + } + + @Override + public void setParentIndex(ParentIndex parentIndex) { + this.parentIndex = parentIndex.getParentIndex(); + } + +}
--- a/src/main/java/alice/jungle/transaction/NetworkDefaultJungleTree.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/alice/jungle/transaction/NetworkDefaultJungleTree.java Fri Mar 20 16:18:42 2015 +0900 @@ -1,37 +1,36 @@ package alice.jungle.transaction; +import fj.data.TreeMap; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.DefaultJungleTree; 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.persistent.ChangeListWriter; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.NodePath; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeContext; 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.DefaultTreeContext; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.TreeContext; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser.InterfaceTraverser; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.GetOldTreeError; -import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.Index; -import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.IndexManager; import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.ParentIndex; +import java.util.concurrent.atomic.AtomicReference; + public class NetworkDefaultJungleTree implements JungleTree { - private final AtomicReservableReference<TreeContext> repository; + private final AtomicReference<TreeContext> repository; private final String uuid; private final String treeName; private final ChangeListWriter writer; private final TreeEditor editor; - + public NetworkDefaultJungleTree(String _treeName, TreeContext _tc,String _uuid,ChangeListWriter _writer,TreeEditor _editor) { treeName = _treeName; - repository = new AtomicReservableReference<TreeContext>(_tc); + repository = new AtomicReference<TreeContext>(_tc); uuid = _uuid; writer = _writer; editor = _editor; @@ -42,7 +41,7 @@ { TreeContext tc = repository.get(); NetworkTransactionManager txManager = new NetworkTransactionManager(treeName, writer,tc,repository,uuid); - TreeNode root = tc.getTreeNode(); + TreeNode root = tc.getRoot(); return new NetworkDefaultJungleTreeEditor(treeName, root,txManager,editor); } @@ -51,7 +50,7 @@ { TreeContext tc = repository.get(); NetworkTransactionManager txManager = new NetworkTransactionManager(treeName, writer,tc,repository,uuid); - TreeNode root = tc.getTreeNode(); + TreeNode root = tc.getRoot(); return NetworkDefaultJungleTreeEditor.NewLocalJungleTreeEditor(treeName,root,txManager, editor); } @@ -59,64 +58,55 @@ public TreeNode getRootNode() { TreeContext tc = repository.get(); - ChangeSet cs = tc.getChangeSet(); - return cs.getRoot(); + return tc.getRoot(); } @Override public long revision() { TreeContext tc = repository.get(); - ChangeSet cs = tc.getChangeSet(); - return cs.revision(); + return tc.revision(); } - @Override - public Either<Error, JungleTree> getOldTree(long revision) { - TreeContext tc = repository.get(); - ChangeSet cs = tc.getChangeSet(); + @Override + public Either<Error, JungleTree> getOldTree(long revision) { + TreeContext tc = repository.get(); - for (; cs.revision() != revision;) { - cs = cs.prev(); - if (cs == null) - return DefaultEither.newA(GetOldTreeError.OLD_TREE_NOT_FOUND); - } + for (; tc.revision() != revision;) { + tc = tc.prev(); + if (tc == null) + return DefaultEither.newA(GetOldTreeError.OLD_TREE_NOT_FOUND); + } - TreeNode root = cs.getRoot(); - TreeContext oldTc = new DefaultTreeContext(root, cs); - String oldTreeUuid = uuid + revision; - JungleTree oldTree = new DefaultJungleTree(oldTc, oldTreeUuid, writer, editor); - return DefaultEither.newB(oldTree); - } + String oldTreeUuid = uuid + revision; + JungleTree oldTree = new DefaultJungleTree(tc, oldTreeUuid, writer, editor); + return DefaultEither.newB(oldTree); + } @Override public ParentIndex getParentIndex() { TreeContext tc = repository.get(); - ChangeSet cs = tc.getChangeSet(); - return cs.getParentIndex(); + return tc.getParentIndex(); } @Override - public Index getIndex() { + public TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> getIndex() { TreeContext tc = repository.get(); - ChangeSet cs = tc.getChangeSet(); - return cs.getIndex(); + return tc.getIndex(); } @Override public InterfaceTraverser getTraverser(boolean useIndex) { - AtomicReservableReference<TreeContext>.Reservation reservation = repository.getReservation(); - IndexManager indexManager = new IndexManager(reservation); - Index index = getIndex(); + TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> index = getIndex(); ParentIndex parentIndex = getParentIndex(); - return new InterfaceTraverser(getRootNode(), index, parentIndex, indexManager, useIndex); + return new InterfaceTraverser(getRootNode(), index, parentIndex, useIndex); } @Override public Either<Error, TreeNode> getNodeOfPath(NodePath path) { - TreeNode node = repository.get().getTreeNode(); + TreeNode node = repository.get().getRoot(); for (int num : path) { if (num == -1) continue;
--- a/src/main/java/alice/jungle/transaction/NetworkDefaultJungleTreeEditor.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/alice/jungle/transaction/NetworkDefaultJungleTreeEditor.java Fri Mar 20 16:18:42 2015 +0900 @@ -182,4 +182,10 @@ CodeSegment cs = new LogPutCodeSegment(netLog); cs.execute(); } + + @Override + public Either<Error, JungleTreeEditor> replaceNewRootNode() { + // TODO Auto-generated method stub + return null; + } }
--- a/src/main/java/alice/jungle/transaction/NetworkTransactionManager.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/alice/jungle/transaction/NetworkTransactionManager.java Fri Mar 20 16:18:42 2015 +0900 @@ -1,39 +1,34 @@ package alice.jungle.transaction; import java.util.Iterator; +import java.util.concurrent.atomic.AtomicReference; +import fj.data.TreeMap; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeList; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.ChangeListWriter; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.persistent.Result; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.ChangeSet; +import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.TreeContext; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.TreeNode; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.logger.TreeOperationLog; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.operations.TreeOperation; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.AtomicReservableReference; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.AtomicReservableReference.Reservation; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultChangeSet; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.DefaultTreeContext; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.TransactionManager; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.transaction.TreeContext; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.traverser.InterfaceTraverser; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultEither; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.DefaultError; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Either; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.util.Error; -import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.Index; -import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.IndexManager; import jp.ac.u_ryukyu.ie.cr.tatsuki.jungle.store.index.ParentIndex; public class NetworkTransactionManager implements TransactionManager { - - private final AtomicReservableReference<TreeContext> repository; + private final AtomicReference<TreeContext> repository; private final TreeContext tip; private final ChangeListWriter writer; private final String uuid; private final String treeName; public NetworkTransactionManager(String _treeName, ChangeListWriter _writer, TreeContext _tip, - AtomicReservableReference<TreeContext> _repository, String _uuid) { + AtomicReference<TreeContext> _repository, String _uuid) { repository = _repository; tip = _tip; writer = _writer; @@ -42,9 +37,8 @@ } @Override - public Either<Error, TransactionManager> commit(TreeNode _newRoot, final TreeOperationLog _log) { - ChangeSet cs = tip.getChangeSet(); - long currentRevision = cs.revision(); + public Either<Error, TransactionManager> commit(TreeNode newRoot, final TreeOperationLog _log) { + long currentRevision = tip.revision(); long nextRevision = currentRevision + 1; ChangeList list = new ChangeList() { @@ -64,33 +58,25 @@ } }; - IndexManager indexManager = new IndexManager(repository.getReservation()); - InterfaceTraverser traverser = new InterfaceTraverser(_newRoot, indexManager, true); - traverser.createIndex(); - Index index = traverser.getIndex(); - ParentIndex parentIndex = traverser.getParentIndex(); - DefaultChangeSet newCs = new DefaultChangeSet(_newRoot, cs, list, uuid, treeName, nextRevision, index.getIndex(), parentIndex.getParentIndex()); + InterfaceTraverser traverser = new InterfaceTraverser(newRoot, true); + traverser.createIndex(); + TreeMap<String, TreeMap<String, TreeMap<TreeNode, TreeNode>>> index = traverser.getIndex(); + ParentIndex parentIndex = traverser.getParentIndex(); + TreeContext newTreeContext = new DefaultTreeContext(newRoot , tip, list, uuid, treeName, nextRevision,index,parentIndex.getParentIndex()); - DefaultTreeContext newContext = new DefaultTreeContext(_newRoot, newCs); - @SuppressWarnings("rawtypes") - Reservation reservation = repository.makeReservation(tip, newContext); - if (reservation == null) { + if (repository.compareAndSet(newTreeContext.prev(),newTreeContext)) { + TransactionManager txManager = new NetworkTransactionManager(treeName, writer, newTreeContext, repository, uuid); + return DefaultEither.newB(txManager); + } + return DefaultEither.newA((Error) new DefaultError()); - } - Result r = writer.write(list); - if (r != Result.SUCCESS) { - return DefaultEither.newA((Error) new DefaultError()); - } - reservation.confirm(); - TransactionManager txManager = new NetworkTransactionManager(treeName, writer, newContext, repository, uuid); - return DefaultEither.newB(txManager); + } @Override public long getRevision() { - ChangeSet cs = tip.getChangeSet(); - return cs.revision(); + return tip.revision(); } @Override
--- a/src/main/java/app/bbs/DistributeApp.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/app/bbs/DistributeApp.java Fri Mar 20 16:18:42 2015 +0900 @@ -7,7 +7,7 @@ public class DistributeApp { public static void main(String[] args) throws Exception { RemoteConfig conf = new RemoteConfig(args); - System.out.println(System.getProperty("java.version")); + System.out.println("test"); if (conf.getManagerHostName() == null) { // String localHostName ="localhost"; // HostMessage host = new HostMessage(localHostName, conf.localPort);
--- a/src/main/java/app/bbs/ShowMessageWithTimeStampServlet.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/app/bbs/ShowMessageWithTimeStampServlet.java Fri Mar 20 16:18:42 2015 +0900 @@ -9,9 +9,7 @@ import org.eclipse.jetty.util.thread.ThreadPool; import fj.data.List; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.BoardMessage; import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.bbs.GetAttributeImp; -import jp.ac.u_ryukyu.ie.cr.shoshi.jungle.store.impl.DefaultNodePath; public class ShowMessageWithTimeStampServlet extends HttpServlet { /** @@ -20,15 +18,13 @@ private static final long serialVersionUID = 1L; private final NetworkBulletinBoard bbs; private final String createBoardMessagePath; - private final String editMessagePath; private static final String PARAM_BOARD_NAME = "bname"; public ShowMessageWithTimeStampServlet(NetworkBulletinBoard _bbs, - String _createBoardMessagePath, String _editMessagePath,ThreadPool thp) { + String _createBoardMessagePath, ThreadPool thp) { bbs = _bbs; createBoardMessagePath = _createBoardMessagePath; - editMessagePath = _editMessagePath; } public void doGet(HttpServletRequest _req, HttpServletResponse _res) {
--- a/src/main/java/app/bbs/codesegment/StartBBSCodeSegment.java Tue Jan 20 09:30:59 2015 +0900 +++ b/src/main/java/app/bbs/codesegment/StartBBSCodeSegment.java Fri Mar 20 16:18:42 2015 +0900 @@ -82,7 +82,7 @@ Servlet editBoardMessage = new EditMessageServlet(cassaBBS); Servlet index = new ShowBoardsServlet(cassaBBS,createBoardPath,showBoardMessagePath); // Servlet board = new ShowBoardMessageServlet(cassaBBS,createBoardMessagePath,editMessagePath); - Servlet board = new ShowMessageWithTimeStampServlet(cassaBBS,createBoardMessagePath,editMessagePath,thp); + Servlet board = new ShowMessageWithTimeStampServlet(cassaBBS,createBoardMessagePath,thp); ServletHandler context = new ServletHandler(); context.addServletWithMapping(new ServletHolder(createBoardMessage),createBoardMessagePath);