From: Sébastien Miquée Date: Tue, 19 Jul 2011 15:02:39 +0000 (+0200) Subject: Adding error messages and minor bug correction. X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/hpcvm.git/commitdiff_plain/21ced9062609ebd01b8937b54a8d5efbb9d4f7ba?hp=c2a0de69e20fda415c1ca6d90b04d2a4cf253acc Adding error messages and minor bug correction. --- diff --git a/src/and/hpcvm/RunningApplication.java b/src/and/hpcvm/RunningApplication.java index 5988648..5e79522 100644 --- a/src/and/hpcvm/RunningApplication.java +++ b/src/and/hpcvm/RunningApplication.java @@ -82,11 +82,14 @@ public class RunningApplication implements Serializable computingsNodes.set( i , _new ) ; return 0 ; } - - System.err.println( "Dead computing client not found. Unable to replace it!" ) ; } + + System.err.println( "Dead computing client not found. Unable to replace it!" ) ; + return 1 ; } + System.err.println( "Dead or new computing client is null! Unable to replace one of them!" ) ; + return 1 ; } diff --git a/src/and/hpcvm/Server.java b/src/and/hpcvm/Server.java index 8f35386..a822cf7 100644 --- a/src/and/hpcvm/Server.java +++ b/src/and/hpcvm/Server.java @@ -683,12 +683,17 @@ public class Server extends UnicastRemoteObject implements ServicesServer if( computingClients.get( i ).getClient().getIP().equalsIgnoreCase( _ip ) ) { computingClients.get( i ).setLastSave( _saveName ) ; - System.out.println( "Save name successfully changed on " + _ip ) ; + System.out.println( "Save name successfully changed on " + computingClients.get( i ).getClient().getName() ) ; return 0 ; } } + + System.err.println( "Unable to found computing client with IP " + _ip + "!" ) ; + return 1 ; } + System.err.println( "Unable to change save name. IP or save name empty ! (IP: " + _ip + " ; save name: " + _saveName +")" ) ; + return 1 ; } @@ -964,7 +969,7 @@ public class Server extends UnicastRemoteObject implements ServicesServer if( applications.size() > 0 && _ip != null && _ip.length() > 0 ) { System.out.println( "Client " + _ip + " has finished to restart ("+applications.get( ind ).getComputingClients().size()+") ... " ) ; - if( (System.currentTimeMillis() - applications.get( ind ).getLastSaveDate()) > save_interleave ) +// if( (System.currentTimeMillis() - applications.get( ind ).getLastSaveDate()) > save_interleave ) { // Has it already finished? for( int i = 0 ; i < applications.get( ind ).getComputingClients().size() ; i++ ) @@ -977,7 +982,7 @@ public class Server extends UnicastRemoteObject implements ServicesServer } } - // Is every body ok? + // Is everybody ok? boolean ok = false ; for( int i = 0 ; i < applications.get( ind ).getComputingClients().size() ; i++ ) {