Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New development version.
[jaceP2P.git] / src / jaceP2P / JaceSuperNode.java
index 7774b86..5392cf9 100644 (file)
@@ -1,14 +1,13 @@
 package jaceP2P;
 
 import java.rmi.Naming;
-
-import and.Mapping.GNode;
+import java.rmi.RemoteException;
 
 public class JaceSuperNode {
        final int NB_HEART_DECONNECT = 3;
        // attribute
        private int heartTime; // frequency of heartBeat
-       private int port = 1098; // par la suite, donner par fichier de conf
+       private int port = 1099; // par la suite, donner par fichier de conf
        private int timeBeforeKill; // wait for 3 non response of heartBeat to kill
                                                                // the Daemon
        String protocol;
@@ -30,6 +29,11 @@ public class JaceSuperNode {
                // create his list of SuperNode
                // containing the IPs and ports
                // but not already the stubs
+               if (System.getSecurityManager() == null) {
+            System.setSecurityManager(new SecurityManager());
+        }
+
+               
                SuperNodeListe.Instance().staticInitialization();
 
                HeartBeatSNode.Instance().setHeartTime(heartTime);
@@ -152,8 +156,13 @@ public class JaceSuperNode {
                                                        index)).setNbOfNodes(Register.Instance().getSize());
                                        SuperNodeListe.Instance().forwardCountNode();
                                        
-                                       GNode deadGNode = snodeServer.delGNodeFromList( host ) ;
-                                       SuperNodeListe.Instance().removeGNode( deadGNode ) ;
+                                       try {
+                                               snodeServer.delGNodeFromList( host, 0, "" ) ;
+                                       } catch (RemoteException e) {
+                                               System.err.println( "Unable to remove the dead node from the list !" ) ;
+                                               e.printStackTrace();
+                                       }
+//                                     SuperNodeListe.Instance().removeGNode( deadGNode ) ;
 
                                        // Register.Instance().viewAll();
                                        // SuperNodeListe.Instance().viewAll();