Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Correction and modification of save mechanisms.
[hpcvm.git] / src / and / hpcvm / Server.java
index 7c31580..90a8653 100644 (file)
@@ -94,7 +94,12 @@ public class Server extends UnicastRemoteObject implements ServicesServer
                super() ;
        }
 
-
+       
+       public void setSaveTime( int _saveTime )
+       {
+               save_interleave = _saveTime  * 60 * 1000 ;
+       }
+       
 
        @Override
        public Integer register( ServicesClient _stub ) 
@@ -841,7 +846,7 @@ public class Server extends UnicastRemoteObject implements ServicesServer
                        {
                                app.setComputingClients( tmp ) ;
                                app.setRunning( true ) ;
-//                             app.setStartTime( System.currentTimeMillis() ) ;
+                               app.setStartTime( System.currentTimeMillis() ) ;
                                
                                int index, index2 ;
                                /* Choosing save neighbors */
@@ -1055,11 +1060,14 @@ public class Server extends UnicastRemoteObject implements ServicesServer
        public void goApplication()
        {
                synchronized( applications ) {
-               if( running && applications.get( ind ).getStartTime() != 0 )
-               {
-                       applications.get( ind ).setStartTime( System.currentTimeMillis() ) ;
-                       applications.get( ind ).setLastSaveDate( System.currentTimeMillis() ) ;
-               }}
+                       if( running && ! applications.get( ind ).getStartMark() )
+                       {
+                               System.out.println( "Application is starting." ) ;
+                               applications.get( ind ).setStartMark() ;
+                               applications.get( ind ).setStartTime( System.currentTimeMillis() ) ;
+                               applications.get( ind ).setLastSaveDate( System.currentTimeMillis() ) ;
+                       }
+               }
        }