X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/hpcvm.git/blobdiff_plain/c7a7de23c20d2c7403729e149aeab1f0a832a4fc..refs/heads/master:/src/and/hpcvm/Server.java diff --git a/src/and/hpcvm/Server.java b/src/and/hpcvm/Server.java index 185b5f3..90a8653 100644 --- a/src/and/hpcvm/Server.java +++ b/src/and/hpcvm/Server.java @@ -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 ) @@ -517,15 +522,17 @@ public class Server extends UnicastRemoteObject implements ServicesServer if( cl.getTimeout() > max_timeout || cl.getFail() ) { + dead = true ; if( ! cl.getFail() ) { try { cl.getStub().echo() ; cl.resetTimeout() ; + dead = false ; } catch( RemoteException e ) { dead = true ; } - } + } if( dead ) { @@ -839,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 */ @@ -1053,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() ) ; + } + } }