- if( node != null )
- {
- System.out.println( "Using Node " + node.getName() + " in order to replace " + nom + "\n" ) ;
-
- node.setAliveFlag(true);
- node.setAliveTime();
-
- // rajouter le noeud ds le Register
- node.setAppliName(RunningApplication.Instance().getName());
-
- // lui envoyer mon stub pr qu'il commence a me pinguer des
- // maintenant
- // TODO a mettre ds un thread ????
-
- /*
- * TaskId
- * neighborTask=Register.Instance().getListeOfTasks().getTaskIdOfRank
- * ((theRank+1)%Register.Instance().getListeOfTasks().getSize());
- * try{ node.getStub().updateHeart(neighborTask.getHostStub()); }
- * catch(Exception e) {
- * System.out.println("nvx noeud deja plu dispo2"); //node = null; }
- */
- // TODO verif pourkoi superNode me le redonne
- // alors qu'il fait deja du calcul
- // int is = Register.Instance().existNode(node.getIP());
- int is = Register.Instance().existNode( node ) ;
+// if( node != null )
+// {
+// System.out.println( "Using Node " + node.getName() + " in order to replace " + nom + "\n" ) ;
+//
+// node.setAliveFlag(true);
+// node.setAliveTime();
+//
+// // rajouter le noeud ds le Register
+// node.setAppliName(RunningApplication.Instance().getName());
+//
+// // lui envoyer mon stub pr qu'il commence a me pinguer des
+// // maintenant
+// // TODO a mettre ds un thread ????
+//
+// /*
+// * TaskId
+// * neighborTask=Register.Instance().getListeOfTasks().getTaskIdOfRank
+// * ((theRank+1)%Register.Instance().getListeOfTasks().getSize());
+// * try{ node.getStub().updateHeart(neighborTask.getHostStub()); }
+// * catch(Exception e) {
+// * System.out.println("nvx noeud deja plu dispo2"); //node = null; }
+// */
+// // TODO verif pourkoi superNode me le redonne
+// // alors qu'il fait deja du calcul
+// // int is = Register.Instance().existNode(node.getIP());
+// int is = Register.Instance().existNode( node ) ;
+//
+// if( is != -1 )
+// {
+// System.out.println("The Node is already in the register ! I don't add it.");
+// System.out.println("Node " + node.getName() + " not added !") ;
+// node = null;
+// } else {
+// Register.Instance().addNode(node);
+//
+// // !!!!!!!!!!!!!!actualiser le ListeTask
+// TaskId myTaskId = Register.Instance().getListeOfTasks()
+// .getTaskIdOfRank(theRank);
+// myTaskId.setHostIP(node.getIP());
+// myTaskId.setHostName(node.getName());
+// myTaskId.setHostStub(node.getStub());
+//
+// int neighborRank;
+// if (theRank == 0)
+// {
+// neighborRank = Register.Instance().getSize() - 1;
+// } else {
+// neighborRank = theRank - 1;
+// }
+//
+// TaskId neighborTask2 = Register.Instance().getListeOfTasks()
+// .getTaskIdOfRank( neighborRank ) ;
+//
+// int loop = 0, MAX_LOOP = 1 ;
+// boolean ok = false ;
+// JaceInterface jaceStub = null ;
+//
+// while( !ok && loop < MAX_LOOP )
+// {
+// try {
+// jaceStub = neighborTask2.getHostStub();
+// jaceStub.updateHeart(node.getStub());
+//
+// ok = true ;
+// } catch( Exception e ) {
+// loop++ ;
+//
+// if( loop < MAX_LOOP )
+// {
+// try {
+// Thread.sleep( loop * 2000 ) ;
+// } catch (InterruptedException e1) {}
+// }
+//
+// if( loop == MAX_LOOP )
+// {
+// System.err.println( "Next node unreachable! " + e ) ;
+// }
+// }
+// }
+//
+// if( loop == MAX_LOOP )
+// {
+//
+// try {
+// node.getStub().suicide2( "Not reachable!" ) ;
+// } catch (RemoteException e1) {
+// System.err.println( "Unable to suicide the node!\n"+e1 ) ;
+// return null ;
+// //signalDeadNode( null, neighborTask2.getRank(), 1 ) ;
+// }
+//
+// try {
+// centralServer.delGNodeFromList( node, 0, LocalHost.Instance().getIP() ) ;
+// } catch( RemoteException e ) {
+// System.err.println( "Unable to signal dead node to SuperNode!" ) ;
+// e.printStackTrace() ;
+// }
+// }
+//
+// }
+//
+// } else {
+// System.out.println( "I didn't receive a new Node !" ) ;
+// }