} catch( RemoteException e1 ) {
System.err.println( "Unable to ping the server!" ) ;
e1.printStackTrace() ;
+ yield() ;
}
try {
sleep( 2000 ) ;
} catch( InterruptedException e ) {
e.printStackTrace() ;
+ yield() ;
}
}
}
serverSocket.close() ;
} catch( IOException e ) {
e.printStackTrace() ;
+ yield() ;
}
}
}
} catch( IOException e ) {
System.err.println( "Unable to launch the SocketServer on port " + dialog_port + "!" ) ;
e.printStackTrace() ;
-
- go = false ;
+ System.exit( 1 ) ;
}
while( go )
} catch( IOException e ) {
System.err.println( "Problem with the accept function!" ) ;
e.printStackTrace() ;
+ yield() ;
}
}
}
reader = new BufferedReader( new InputStreamReader( socket.getInputStream() ) ) ;
} catch( IOException e ) {
System.err.println( "Unable to open a dialog socket with the VM!" ) ;
- e.printStackTrace();
+ e.printStackTrace() ;
+ yield() ;
}
try {
} catch( IOException e ) {
e.printStackTrace() ;
+ yield() ;
}
}
}
clients.get( i ).getStub().emergencyStop() ;
clients.get( i ).getStub().stop() ;
} catch (RemoteException e) {
- e.printStackTrace();
+ System.err.println( "Unable to send stop signal to " + clients.get( i ).getName() ) ;
+ e.printStackTrace() ;
}
}
} catch( RemoteException e ) {
System.err.println( "Unable to indicate to client to retrieve last save!" ) ;
e.printStackTrace() ;
+ yield() ;
}
if( res == 0 )
} catch( RemoteException e ) {
System.err.println( "Unable to set the new VM IP on the replacing client!" ) ;
e.printStackTrace() ;
+ yield() ;
}
if( ok_new && ok_old )
// break ;
// }
// }
- synchronized( counter ){
- counter.inc() ;}
+ synchronized( counter )
+ {
+ counter.inc() ;
+ }
-
new Server.FaultManager( cl ).start() ;
nb_disconnections_computing++ ;
} else {
} catch( RemoteException e ) {
System.err.println( "Unable to invoke emergency stop signal on " + clients.get( i ).getName() ) ;
e.printStackTrace() ;
+ yield() ;
}
}
}
counter.wait() ;
} catch( InterruptedException e ) {
e.printStackTrace() ;
+ yield() ;
}
}
}
for( int i = 0 ; i < applications.get( ind ).getComputingClients().size() ; i++ )
{
- final ServicesClient sc = applications.get( ind ).getComputingClients().get( i ).getClient().getStub() ;
-
applications.get( ind ).getComputingClients().get( i ).setRestartOk( false ) ;
+ final ServicesClient sc = applications.get( ind ).getComputingClients().get( i ).getClient().getStub() ;
+
new Thread( new Runnable() {
@Override
sc.restartVMAfterCrash() ;
} catch( RemoteException e ) {
e.printStackTrace() ;
+ yield() ;
}
}
} ).start() ;
Thread.sleep( 2000 ) ;
} catch( InterruptedException e ) {
e.printStackTrace() ;
+ yield() ;
}
}
}
try {
computingClients.get( i ).getClient().getStub().saveOk() ;
} catch (RemoteException e) {
- e.printStackTrace();
+ System.err.println( "Unable to invoke the saveOk method on " + computingClients.get( i ).getClient().getName() ) ;
+ e.printStackTrace() ;
}
computingClients.get( i ).setSaveStatus( false ) ;
}
return 1 ;
}
+
@Override
public ArrayList<ServicesClient> startApplication( int _nb )
{
try {
startingClients.wait() ;
- } catch (InterruptedException e) {
- e.printStackTrace();
+ } catch( InterruptedException e ) {
+ e.printStackTrace() ;
}
}
}
final int indice = i ;
- new Thread( new Runnable(){
-
+ new Thread( new Runnable()
+ {
@Override
public void run()
{
try {
res = clients.get( indice ).getStub().startVM( 0 ) ;
} catch( RemoteException e ) {
- e.printStackTrace();
+ e.printStackTrace() ;
}
if( res == 0 )