Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Adding / completing mechanisms for fault tolerance.
[jaceP2P.git] / src / jaceP2P / SuperNodeListe.java
index 8dfbe8b..a0b1ca4 100644 (file)
@@ -393,6 +393,32 @@ public class SuperNodeListe implements Cloneable {
                        }
                }
        }
+       
+       
+       protected boolean workingOnGnodes()
+       {
+               boolean ok = true ;     
+               
+               SuperNodeData d = null ;
+               JaceSuperNodeInterface remoteStub = null ;
+
+               for( int i = 0 ; i < liste.size() ; i++ ) 
+               {
+                       d = (SuperNodeData) liste.elementAt( i ) ;
+                       if( ! d.getIP().equals(LocalHost.Instance().getIP() ) ) 
+                       {
+                               // if not me, I inform the other super nodes
+                               remoteStub = d.getStub() ;
+                               try {
+                                       ok = ok && remoteStub.blockForMapping() ;
+                               } catch( Exception e ) {
+                                       System.err.println( "Unable to remove GNode at SuperNode " + d.getIP() ) ;
+                               }
+                       }
+               }
+            
+           return ok ;
+       }
 
        public void setMapping( Algo al ) 
        {