Mercurial > hg > Database > Alice
view src/alice/topology/node/StartTopologyNode.java @ 25:50c75cb3de60
implements TopologyNode
author | kazz <kazz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 17 Jan 2012 02:40:27 +0900 |
parents | |
children | 9c6b9e032338 |
line wrap: on
line source
package alice.topology.node; import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; import org.msgpack.MessagePack; import alice.codesegment.CodeSegment; import alice.datasegment.DataSegment; import alice.datasegment.DataSegmentManager; import alice.topology.HostMessage; public class StartTopologyNode extends CodeSegment { TopologyNodeConfig conf; public StartTopologyNode(TopologyNodeConfig conf) { this.conf = conf; } @Override public void run() { DataSegmentManager manager = DataSegment.connect("topology_manager", conf.managerHostName, conf.managerPort); try { HostMessage host; host = new HostMessage(InetAddress.getLocalHost().getHostName(), conf.localPort); MessagePack msgpack = new MessagePack(); manager.put("host", msgpack.unconvert(host)); } catch (UnknownHostException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } IncomingAbstractHostName cs = new IncomingAbstractHostName(); cs.absName.setKey("local", "host"); } }