Mercurial > hg > Database > Alice
view src/main/java/alice/topology/manager/reconnection/ReceiveError.java @ 345:8f71c3e6f11d
Change directory structure Maven standard
author | sugi |
---|---|
date | Wed, 16 Apr 2014 18:26:07 +0900 |
parents | |
children |
line wrap: on
line source
package alice.topology.manager.reconnection; import java.io.IOException; import java.net.Socket; import alice.codesegment.CodeSegment; import alice.datasegment.CommandType; import alice.datasegment.Receiver; import alice.topology.HostMessage; public class ReceiveError extends CodeSegment { public Receiver reportInfo = ids.create(CommandType.TAKE); public ReceiveError(){ reportInfo.setKey("_ERROR"); } @Override public void run() { HostMessage message = reportInfo.asClass(HostMessage.class); try { System.out.println("Receive Error "+ message.port); Socket socket = new Socket(message.name, message.port); socket.close(); System.out.println("alive "+message.port); } catch (IOException e) { System.out.println("Receive Error "+ message.port); new CheckABSName(message); return; } new ReceiveError(); } }