view src/main/java/alice/topology/node/IncomingReverseKey.java @ 518:fc313323c53b dispose

add reconnect event
author sugi
date Thu, 22 Jan 2015 16:01:32 +0900
parents a7f140f4bcb1
children 145c425db88d
line wrap: on
line source

package alice.topology.node;

import alice.codesegment.CodeSegment;
import alice.datasegment.CommandType;
import alice.datasegment.DataSegment;
import alice.datasegment.Receiver;

public class IncomingReverseKey extends CodeSegment {

    public Receiver reverseKey = ids.create(CommandType.TAKE);
    public Receiver reverseCount = ids.create(CommandType.PEEK);

    @Override
    public void run() {
        String reverseKey = this.reverseKey.asString();
        String from = this.reverseKey.from;
        DataSegment.getAccept(from).setReverseKey(reverseKey);

        int reverseCount = this.reverseCount.asInteger();
        reverseCount++;
        ods.update("local", "reverseCount", reverseCount);
        ods.put("connection"+reverseKey, reverseKey);
        IncomingReverseKey cs = new IncomingReverseKey();
        cs.reverseKey.setKey("local", "reverseKey");
        cs.reverseCount.setKey("local", "reverseCount");
    }

}