Mercurial > hg > Database > Alice
changeset 602:8a9fd716c335 dispose
change topology class extends CodeSegment from MetaCodeSegment, Chat minor fix
line wrap: on
line diff
--- a/src/main/java/alice/test/chat/ChatWindow.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/test/chat/ChatWindow.java Tue May 03 20:09:45 2016 +0900 @@ -35,7 +35,7 @@ final JTextField textField = new JTextField(); textField.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - send("(" + name+ ") " + textField.getText() + "\n"); + send("(" + name.asString() + ") " + textField.getText() + "\n"); textField.setText(""); } });
--- a/src/main/java/alice/test/chat/FirstWindow.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/test/chat/FirstWindow.java Tue May 03 20:09:45 2016 +0900 @@ -18,7 +18,6 @@ public void run() { final JFrame mainFrame = new JFrame("ChatInfo"); final JTextField TopM_IP; - final JTextField Port; final JTextField Name; mainFrame.setBounds(400, 400, 300, 250); @@ -27,7 +26,6 @@ JPanel p = new JPanel(); TopM_IP = new JTextField(10); - Port = new JTextField(10); Name = new JTextField(10); JButton button = new JButton("Submit"); @@ -35,11 +33,10 @@ public void actionPerformed(ActionEvent e) { //もし未入力があればアラートを出す - String[] config = new String[]{"-host", TopM_IP.getText(), "-p", Port.getText()}; + String[] config = new String[]{"-host", TopM_IP.getText()}; ods.put("userName", Name.getText()); - //new TopologyNode(new TopologyNodeConfig(config), new CreateChatWindow()); - new CreateChatWindow(); + new TopologyNode(new TopologyNodeConfig(config), new CreateChatWindow()); mainFrame.dispose(); } @@ -48,8 +45,6 @@ p.setLayout(new FlowLayout()); p.add(new JLabel("TopologyManagerIP:", SwingConstants.LEFT)); p.add(TopM_IP); - p.add(new JLabel("TopologyManagerPort:", SwingConstants.LEFT)); - p.add(Port); p.add(new JLabel("Name:", SwingConstants.LEFT)); p.add(Name); p.add(button);
--- a/src/main/java/alice/topology/manager/CheckComingHost.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/CheckComingHost.java Tue May 03 20:09:45 2016 +0900 @@ -10,7 +10,7 @@ /** * This class check hash and put "newHost"(host info) for CreateTopology when putted "host"(join request) from topology node */ -public class CheckComingHost extends MetaCodeSegment { +public class CheckComingHost extends CodeSegment { // checkIncomingHost private Receiver host = ids.create(CommandType.TAKE); private Receiver absCookieTable = ids.create(CommandType.PEEK); // cookie, AbsName HashMap
--- a/src/main/java/alice/topology/manager/ComingServiceHosts.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/ComingServiceHosts.java Tue May 03 20:09:45 2016 +0900 @@ -8,7 +8,7 @@ /** * This class create topology when putted newHost by CheckComingHost */ -public class ComingServiceHosts extends MetaCodeSegment { +public class ComingServiceHosts extends CodeSegment { private Receiver info = ids.create(CommandType.PEEK);
--- a/src/main/java/alice/topology/manager/ComingStarHosts.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/ComingStarHosts.java Tue May 03 20:09:45 2016 +0900 @@ -1,6 +1,6 @@ package alice.topology.manager; -import alice.codesegment.MetaCodeSegment; +import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.DataSegment; import alice.datasegment.Receiver; @@ -13,7 +13,7 @@ * Created by e125769 on 4/12/16. * this class put root info */ -public class ComingStarHosts extends MetaCodeSegment { +public class ComingStarHosts extends CodeSegment { private Receiver info = ids.create(CommandType.TAKE); private Receiver info1 = ids.create(CommandType.TAKE); private Receiver info2 = ids.create(CommandType.TAKE); @@ -25,7 +25,7 @@ } @Override - public void run() { + public void run() {// first node HostMessage host = info.asClass(HostMessage.class); int comingHostCount = info1.asInteger(); @@ -44,6 +44,6 @@ ods.put("start", ValueFactory.createNilValue()); ods.put(info2.key, nameTable); - new CreateStarTopology(); + new CreateStarTopology();//next node } }
--- a/src/main/java/alice/topology/manager/ConfigWaiter.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/ConfigWaiter.java Tue May 03 20:09:45 2016 +0900 @@ -7,7 +7,7 @@ import alice.datasegment.CommandType; import alice.datasegment.Receiver; -public class ConfigWaiter extends MetaCodeSegment { +public class ConfigWaiter extends CodeSegment { public Receiver done = ids.create(CommandType.TAKE); public int count;
--- a/src/main/java/alice/topology/manager/CreateHash.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/CreateHash.java Tue May 03 20:09:45 2016 +0900 @@ -14,7 +14,7 @@ /** * create host cookie */ -public class CreateHash extends MetaCodeSegment { +public class CreateHash extends CodeSegment { // this CodeSegment change raw string to MD5 private Receiver info = ids.create(CommandType.TAKE); // order to create
--- a/src/main/java/alice/topology/manager/CreateStarTopology.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/CreateStarTopology.java Tue May 03 20:09:45 2016 +0900 @@ -1,6 +1,6 @@ package alice.topology.manager; -import alice.codesegment.MetaCodeSegment; +import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.DataSegment; import alice.datasegment.Receiver; @@ -13,7 +13,7 @@ * Created by e125769 on 4/12/16. * this class put node info */ -public class CreateStarTopology extends MetaCodeSegment { +public class CreateStarTopology extends CodeSegment { private Receiver info = ids.create(CommandType.TAKE); private Receiver info1 = ids.create(CommandType.TAKE);
--- a/src/main/java/alice/topology/manager/CreateTreeTopology.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/CreateTreeTopology.java Tue May 03 20:09:45 2016 +0900 @@ -11,7 +11,7 @@ import alice.datasegment.Receiver; import alice.topology.HostMessage; -public class CreateTreeTopology extends MetaCodeSegment { +public class CreateTreeTopology extends CodeSegment { private Receiver info = ids.create(CommandType.TAKE); private Receiver info1 = ids.create(CommandType.TAKE);
--- a/src/main/java/alice/topology/manager/IncomingHosts.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/IncomingHosts.java Tue May 03 20:09:45 2016 +0900 @@ -12,7 +12,7 @@ import alice.datasegment.Receiver; import alice.topology.HostMessage; -public class IncomingHosts extends MetaCodeSegment { +public class IncomingHosts extends CodeSegment { private Receiver topology = ids.create(CommandType.TAKE); // Topology from parse file private Receiver nodeNames = ids.create(CommandType.TAKE); // nodeName list
--- a/src/main/java/alice/topology/manager/RecodeTopology.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/RecodeTopology.java Tue May 03 20:09:45 2016 +0900 @@ -13,7 +13,7 @@ * This class update "topology"(topology info). * "topology" has HashMap<String:nodeName, LinkedList<HostMessage>> */ -public class RecodeTopology extends MetaCodeSegment { +public class RecodeTopology extends CodeSegment { private Receiver info = ids.create(CommandType.TAKE); // NodeInfo private Receiver info1 = ids.create(CommandType.TAKE); // HashMap
--- a/src/main/java/alice/topology/manager/SearchHostName.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/SearchHostName.java Tue May 03 20:09:45 2016 +0900 @@ -12,7 +12,7 @@ import alice.datasegment.Receiver; import alice.topology.HostMessage; -public class SearchHostName extends MetaCodeSegment { +public class SearchHostName extends CodeSegment { private Receiver info = ids.create(CommandType.TAKE); // reconnect NodeInfo private Receiver info1 = ids.create(CommandType.TAKE); // topology recode (HashMap)
--- a/src/main/java/alice/topology/manager/StartTopologyManager.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/StartTopologyManager.java Tue May 03 20:09:45 2016 +0900 @@ -20,7 +20,7 @@ import com.alexmerz.graphviz.objects.Graph; import com.alexmerz.graphviz.objects.Node; -public class StartTopologyManager extends MetaCodeSegment { +public class StartTopologyManager extends CodeSegment { TopologyManagerConfig conf; Logger logger = Logger.getLogger(StartTopologyManager.class);
--- a/src/main/java/alice/topology/manager/TopologyFinish.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/TopologyFinish.java Tue May 03 20:09:45 2016 +0900 @@ -5,7 +5,7 @@ import alice.datasegment.CommandType; import alice.datasegment.Receiver; -public class TopologyFinish extends MetaCodeSegment { +public class TopologyFinish extends CodeSegment { public Receiver finish = ids.create(CommandType.TAKE); @Override public void run() {
--- a/src/main/java/alice/topology/manager/TopologyManagerConfig.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/manager/TopologyManagerConfig.java Tue May 03 20:09:45 2016 +0900 @@ -18,12 +18,17 @@ String typeName = args[++i]; if ("tree".equals(typeName)) { type = TopologyType.Tree; + } else if ("star".equals(typeName)){ + type = TopologyType.Star; + } } else if ("--Child".equals(args[i])) { hasChild = Integer.parseInt(args[++i]); } } + localPort = 20000; + if (confFilePath == null) dynamic = true; }
--- a/src/main/java/alice/topology/node/CloseRemoteDataSegment.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/CloseRemoteDataSegment.java Tue May 03 20:09:45 2016 +0900 @@ -7,7 +7,7 @@ import alice.datasegment.Receiver; import alice.topology.manager.keeparive.ListManager; -public class CloseRemoteDataSegment extends MetaCodeSegment { +public class CloseRemoteDataSegment extends CodeSegment { private Receiver info = ids.create(CommandType.TAKE); private Receiver info1 = ids.create(CommandType.TAKE);
--- a/src/main/java/alice/topology/node/ClosedEventManager.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/ClosedEventManager.java Tue May 03 20:09:45 2016 +0900 @@ -7,7 +7,7 @@ import alice.datasegment.CommandType; import alice.datasegment.Receiver; -public class ClosedEventManager extends MetaCodeSegment{ +public class ClosedEventManager extends CodeSegment{ private Receiver info = ids.create(CommandType.PEEK); private static ClosedEventManager instance = new ClosedEventManager();
--- a/src/main/java/alice/topology/node/ConfigurationFinish.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/ConfigurationFinish.java Tue May 03 20:09:45 2016 +0900 @@ -8,7 +8,7 @@ import alice.datasegment.Receiver; import alice.topology.manager.keeparive.StartKeepAlive; -public class ConfigurationFinish extends MetaCodeSegment { +public class ConfigurationFinish extends CodeSegment { public Receiver reverseCount = ids.create(CommandType.PEEK); public Receiver configNodeNum = ids.create(CommandType.PEEK);
--- a/src/main/java/alice/topology/node/CreateConnectionList.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/CreateConnectionList.java Tue May 03 20:09:45 2016 +0900 @@ -7,7 +7,7 @@ import alice.datasegment.CommandType; import alice.datasegment.Receiver; -public class CreateConnectionList extends MetaCodeSegment { +public class CreateConnectionList extends CodeSegment { private Receiver info = ids.create(CommandType.TAKE); // connection List private Receiver info1 = ids.create(CommandType.TAKE); // connection names
--- a/src/main/java/alice/topology/node/ExecuteEvent.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/ExecuteEvent.java Tue May 03 20:09:45 2016 +0900 @@ -8,7 +8,7 @@ import alice.datasegment.CommandType; import alice.datasegment.Receiver; -public class ExecuteEvent<T> extends MetaCodeSegment { +public class ExecuteEvent<T> extends CodeSegment { public Receiver info = ids.create(CommandType.TAKE); public Receiver info1 = ids.create(CommandType.TAKE);
--- a/src/main/java/alice/topology/node/IncomingAbstractHostName.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/IncomingAbstractHostName.java Tue May 03 20:09:45 2016 +0900 @@ -5,7 +5,7 @@ import alice.datasegment.CommandType; import alice.datasegment.Receiver; -public class IncomingAbstractHostName extends MetaCodeSegment { +public class IncomingAbstractHostName extends CodeSegment { public Receiver absName = ids.create(CommandType.PEEK); private int topMNumber;
--- a/src/main/java/alice/topology/node/IncomingConnectionInfo.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/IncomingConnectionInfo.java Tue May 03 20:09:45 2016 +0900 @@ -7,7 +7,7 @@ import alice.datasegment.Receiver; import alice.topology.HostMessage; -public class IncomingConnectionInfo extends MetaCodeSegment { +public class IncomingConnectionInfo extends CodeSegment { public Receiver hostInfo = ids.create(CommandType.TAKE); private String absName;//nodeName
--- a/src/main/java/alice/topology/node/IncomingReverseKey.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/IncomingReverseKey.java Tue May 03 20:09:45 2016 +0900 @@ -6,7 +6,7 @@ import alice.datasegment.DataSegment; import alice.datasegment.Receiver; -public class IncomingReverseKey extends MetaCodeSegment { +public class IncomingReverseKey extends CodeSegment { public Receiver reverseKey = ids.create(CommandType.TAKE); public Receiver reverseCount = ids.create(CommandType.PEEK);
--- a/src/main/java/alice/topology/node/PrepareToAddList.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/PrepareToAddList.java Tue May 03 20:09:45 2016 +0900 @@ -5,7 +5,7 @@ import alice.datasegment.CommandType; import alice.datasegment.Receiver; -public class PrepareToAddList extends MetaCodeSegment { +public class PrepareToAddList extends CodeSegment { public Receiver info = ids.create(CommandType.TAKE); public Receiver info2 = ids.create(CommandType.TAKE);
--- a/src/main/java/alice/topology/node/PrepareToClose.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/PrepareToClose.java Tue May 03 20:09:45 2016 +0900 @@ -9,7 +9,7 @@ import alice.datasegment.DataSegmentManager; import alice.datasegment.Receiver; -public class PrepareToClose extends MetaCodeSegment { +public class PrepareToClose extends CodeSegment { private Receiver info = ids.create(CommandType.PEEK); private Receiver info1 = ids.create(CommandType.TAKE);
--- a/src/main/java/alice/topology/node/ReceiveCloseMessage.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/ReceiveCloseMessage.java Tue May 03 20:09:45 2016 +0900 @@ -5,7 +5,7 @@ import alice.datasegment.CommandType; import alice.datasegment.Receiver; -public class ReceiveCloseMessage extends MetaCodeSegment { +public class ReceiveCloseMessage extends CodeSegment { private Receiver info;
--- a/src/main/java/alice/topology/node/RegisterEvent.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/RegisterEvent.java Tue May 03 20:09:45 2016 +0900 @@ -7,7 +7,7 @@ import alice.datasegment.CommandType; import alice.datasegment.Receiver; -public class RegisterEvent<T> extends MetaCodeSegment { +public class RegisterEvent<T> extends CodeSegment { private Receiver info = ids.create(CommandType.TAKE); // new event private Receiver info1 = ids.create(CommandType.TAKE); // event list
--- a/src/main/java/alice/topology/node/SaveCookie.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/SaveCookie.java Tue May 03 20:09:45 2016 +0900 @@ -5,7 +5,7 @@ import alice.datasegment.CommandType; import alice.datasegment.Receiver; -public class SaveCookie extends MetaCodeSegment { +public class SaveCookie extends CodeSegment { private Receiver info = ids.create(CommandType.PEEK);
--- a/src/main/java/alice/topology/node/Start.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/Start.java Tue May 03 20:09:45 2016 +0900 @@ -7,7 +7,7 @@ import alice.datasegment.CommandType; import alice.datasegment.Receiver; -public class Start extends MetaCodeSegment { +public class Start extends CodeSegment { public Receiver done = ids.create(CommandType.PEEK);
--- a/src/main/java/alice/topology/node/StartTopologyNode.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/StartTopologyNode.java Tue May 03 20:09:45 2016 +0900 @@ -10,7 +10,7 @@ import alice.datasegment.DataSegment; import alice.topology.HostMessage; -public class StartTopologyNode extends MetaCodeSegment { +public class StartTopologyNode extends CodeSegment { private LinkedList<TopologyNodeConfig> configs; private TopologyNodeConfig conf;
--- a/src/main/java/alice/topology/node/TopologyNode.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/TopologyNode.java Tue May 03 20:09:45 2016 +0900 @@ -12,7 +12,7 @@ new AliceDaemon(conf).listen(); LinkedList<TopologyNodeConfig> confs = new LinkedList<TopologyNodeConfig>(); confs.addFirst(conf); - new StartTopologyNode(confs, startCS, 0).execute(); + new StartTopologyNode(confs, startCS, 1).execute(); } public TopologyNode(LinkedList<TopologyNodeConfig> configs, CodeSegment startCS) {
--- a/src/main/java/alice/topology/node/TopologyNodeConfig.java Wed Apr 27 16:28:10 2016 +0900 +++ b/src/main/java/alice/topology/node/TopologyNodeConfig.java Tue May 03 20:09:45 2016 +0900 @@ -9,7 +9,7 @@ public class TopologyNodeConfig extends Config { private String managerHostName; - private int managerPort = 10000; + private int managerPort = 20000; public String cookie; private ArrayList<Class> eventList = new ArrayList<Class>();