Mercurial > hg > Database > Christie
view src/main/java/christie/topology/manager/CheckComingHost.java @ 272:b592fe1d4a4e default tip
create example Attendance
author | matac42 <matac@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 01 Jul 2021 20:41:07 +0900 |
parents | 87a203c99177 |
children |
line wrap: on
line source
package christie.topology.manager; import christie.annotation.Peek; import christie.annotation.Take; import christie.codegear.CodeGear; import christie.codegear.CodeGearManager; import christie.topology.HostMessage; import java.util.HashMap; public class CheckComingHost extends CodeGear { @Take HostMessage hostMessage; @Peek HashMap<String, String> absCookieTable; public CheckComingHost(){ } @Override protected void run(CodeGearManager cgm) { String cookie = hostMessage.getCookie(); // check cookie if (cookie != null) { if (absCookieTable.containsKey(cookie)) { hostMessage.setNodeName(cookie); System.out.println("match"); // coming host has ever joined this App getLocalDGM().put("reconnectHost", hostMessage); cgm.setup(new SearchHostName()); } }else { getLocalDGM().put("orderHash", "order"); getLocalDGM().put("newHost", hostMessage); } cgm.setup(new CheckComingHost()); } }