Mercurial > hg > Database > Alice
diff src/main/java/alice/topology/node/StartTopologyNode.java @ 374:5ceb1c4db167 multicast
create setter and getter for TopologyNodeConfig member-variables
author | sugi |
---|---|
date | Wed, 04 Jun 2014 00:18:26 +0900 |
parents | 8f71c3e6f11d |
children | 3a0056e03040 |
line wrap: on
line diff
--- a/src/main/java/alice/topology/node/StartTopologyNode.java Tue Jun 03 17:14:17 2014 +0900 +++ b/src/main/java/alice/topology/node/StartTopologyNode.java Wed Jun 04 00:18:26 2014 +0900 @@ -1,11 +1,7 @@ package alice.topology.node; import java.net.InetAddress; -import java.net.NetworkInterface; -import java.net.SocketException; import java.net.UnknownHostException; -import java.util.Enumeration; - import alice.codesegment.CodeSegment; import alice.datasegment.DataSegment; import alice.topology.HostMessage; @@ -22,7 +18,7 @@ @Override public void run() { - DataSegment.connect("manager", "", conf.managerHostName, conf.managerPort, false); + DataSegment.connect("manager", "", conf.getManagerHostName(), conf.getManagerPort(), false); String localHostName = null; try { localHostName = InetAddress.getLocalHost().getHostName(); @@ -47,23 +43,5 @@ cs3.configNodeNum.setKey("local", "configNodeNum"); } - - @SuppressWarnings("unused") - private String getIPAddress() throws SocketException { - Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); - - while(interfaces.hasMoreElements()){ - NetworkInterface network = interfaces.nextElement(); - Enumeration<InetAddress> addresses = network.getInetAddresses(); - - while(addresses.hasMoreElements()){ - String address = addresses.nextElement().getHostAddress(); - if(!"127.0.0.1".equals(address) && !"0.0.0.0".equals(address)){ - return address; - } - } - } - return "127.0.0.1"; - } - + }