if ( INodeInfo.class.isAssignableFrom(message.getClass()))
{
if (NodeInfoSocket.class.isAssignableFrom(message.getClass()))
{
System.out.println("New Node");
NodeInfoSocket info = (NodeInfoSocket)message;
switch (info.getType())
{
case Config.NODE_CLIENT :
{
System.out.println("Client");
break;
}
case Config.NODE_SOLVER :
{
System.out.println("Solver");
break;
}
case Config.NODE_DISPATCHER :
{
System.out.println("Dispatcher");
break;
}
}
// INodeConfig config = null;
// if ((info.getType() == Config.NODE_CLIENT) || (info.getType() == Config.NODE_SOLVER))
// {
// config = new NodeConfigSocket(info.getIp(), info.getPort(), this.counterNodeId, info.getType(), info.getTaskTypes());
// }
// if (info.getType() == Config.NODE_DISPATCHER)
// {
// config = new NodeConfigSocket(info.getIp(), info.getPort(), this.counterNodeId, info.getType(), info.getTaskTypes());
// NodeInfoSocket dispatcherInfo = new NodeInfoSocket(this.ip, this.port, this.counterNodeId, null, this.id);
// this.manager.writeData(dispatcherInfo, config);
// }
INodeConfig config = new NodeConfigSocket(info.getIp(), info.getPort(), this.counterNodeId, info.getType(), info.getTaskTypes());
this.nodes.add(config);
counterNodeId++;
}
continue;
}