From 21ced9062609ebd01b8937b54a8d5efbb9d4f7ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Miqu=C3=A9e?= Date: Tue, 19 Jul 2011 17:02:39 +0200 Subject: [PATCH] Adding error messages and minor bug correction. --- src/and/hpcvm/RunningApplication.java | 7 +++++-- src/and/hpcvm/Server.java | 11 ++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) 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++ ) { -- 2.20.1