# HG changeset patch # User sugi # Date 1340009666 -32400 # Node ID 7982324d4329d46942f9ddb5312c366b351cc96b # Parent 38f4021353c58d11d3a4ae40b5a2f58c6bb9d335 "setKey" move in the instance diff -r 38f4021353c5 -r 7982324d4329 src/alice/test/topology/fish/CheckMyName.java --- a/src/alice/test/topology/fish/CheckMyName.java Mon Jun 18 17:10:23 2012 +0900 +++ b/src/alice/test/topology/fish/CheckMyName.java Mon Jun 18 17:54:26 2012 +0900 @@ -9,7 +9,11 @@ public class CheckMyName extends CodeSegment { - Receiver host = ids.create(CommandType.PEEK); + private Receiver host = ids.create(CommandType.PEEK); + + public CheckMyName(){ + host.setKey("local", "host"); + } @Override public void run() { diff -r 38f4021353c5 -r 7982324d4329 src/alice/test/topology/fish/StartFish.java --- a/src/alice/test/topology/fish/StartFish.java Mon Jun 18 17:10:23 2012 +0900 +++ b/src/alice/test/topology/fish/StartFish.java Mon Jun 18 17:54:26 2012 +0900 @@ -6,8 +6,8 @@ @Override public void run() { - CheckMyName cs = new CheckMyName(); - cs.host.setKey("local", "host"); + new CheckMyName(); // separate processing + } } diff -r 38f4021353c5 -r 7982324d4329 src/alice/topology/node/IncomingAbstractHostName.java --- a/src/alice/topology/node/IncomingAbstractHostName.java Mon Jun 18 17:10:23 2012 +0900 +++ b/src/alice/topology/node/IncomingAbstractHostName.java Mon Jun 18 17:54:26 2012 +0900 @@ -6,7 +6,11 @@ public class IncomingAbstractHostName extends CodeSegment { - public Receiver absName = ids.create(CommandType.PEEK); + private Receiver absName = ids.create(CommandType.PEEK); + + public IncomingAbstractHostName(){ + absName.setKey("local", "host"); + } @Override public void run() { diff -r 38f4021353c5 -r 7982324d4329 src/alice/topology/node/StartTopologyNode.java --- a/src/alice/topology/node/StartTopologyNode.java Mon Jun 18 17:10:23 2012 +0900 +++ b/src/alice/topology/node/StartTopologyNode.java Mon Jun 18 17:54:26 2012 +0900 @@ -26,12 +26,10 @@ } catch (UnknownHostException e) { e.printStackTrace(); } - HostMessage host; - host = new HostMessage(localHostName, conf.localPort); + HostMessage host = new HostMessage(localHostName, conf.localPort); ods.put("manager", "host", host); - IncomingAbstractHostName cs1 = new IncomingAbstractHostName(); - cs1.absName.setKey("local", "host"); + new IncomingAbstractHostName(); IncomingReverseKey cs2 = new IncomingReverseKey(); cs2.reverseKey.setKey("local", "reverseKey");