From: Sébastien Miquée Date: Wed, 3 Aug 2011 00:00:48 +0000 (+0200) Subject: Correction of the start application time setup. X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/hpcvm.git/commitdiff_plain/b956a81261e5bebb70d8fffc2756b09cfdf9ea91 Correction of the start application time setup. --- diff --git a/src/and/hpcvm/Client.java b/src/and/hpcvm/Client.java index 232a58c..e3233eb 100644 --- a/src/and/hpcvm/Client.java +++ b/src/and/hpcvm/Client.java @@ -1532,6 +1532,7 @@ public class Client extends UnicastRemoteObject implements ServicesClient /* Close streams */ reader.close() ; reader = null ; socket.close() ; socket = null ; + System.out.println( "Application is starting." ) ; try { LocalHost.Instance().getServerStub().goApplication() ; diff --git a/src/and/hpcvm/RunningApplication.java b/src/and/hpcvm/RunningApplication.java index 5e79522..c3307de 100644 --- a/src/and/hpcvm/RunningApplication.java +++ b/src/and/hpcvm/RunningApplication.java @@ -15,6 +15,7 @@ public class RunningApplication implements Serializable private boolean running ; private long startTime ; private long endTime ; + private boolean start_mark ; public RunningApplication( String _name ) { @@ -22,10 +23,14 @@ public class RunningApplication implements Serializable computingsNodes = new ArrayList() ; lastSaveDate = 0 ; running = false ; - startTime = 0 ; + startTime = -1 ; endTime = 0 ; + start_mark = false ; } + public void setStartMark() { start_mark = true ; } + + public boolean getStartMark() { return start_mark ; } public void clear() { computingsNodes.clear() ; } diff --git a/src/and/hpcvm/Server.java b/src/and/hpcvm/Server.java index 7c31580..390d580 100644 --- a/src/and/hpcvm/Server.java +++ b/src/and/hpcvm/Server.java @@ -841,7 +841,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 +1055,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() ) ; + } + } }