Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Modification of mapping algorithm identifier mechanisms.
[jaceP2P.git] / src / jaceP2P / JaceServer.java
index d7aaeea..b92c31e 100644 (file)
@@ -28,16 +28,30 @@ public class JaceServer extends UnicastRemoteObject implements JaceInterface {
                Register.Instance().setSpawnerStub(spawnerStub);
        }
 
+//     public JaceSpawnerInterface transformIntoSpawner(String[] params,
+//                     String appliName, Register reg, int nbTasks,
+//                     JaceSuperNodeInterface snodeStub, int rank, int heartTime, int tag,
+//                     int nbdc, int nbsdc, int nbDaemonPerSpawner, int nbDaemonPerThread)
+//                     throws RemoteException {
+//             System.out.println("Beginning the transformation ...");
+//             new JaceSpawner(params, appliName, reg, nbTasks,
+//                             snodeStub, rank, heartTime, tag, nbdc, nbsdc,
+//                             nbDaemonPerSpawner, nbDaemonPerThread);
+//             HeartBeatThread.Instance().kill();
+//             return Register.Instance().getSpawnerStub();
+//     }
+       
+       
        public JaceSpawnerInterface transformIntoSpawner(String[] params,
                        String appliName, Register reg, int nbTasks,
                        JaceSuperNodeInterface snodeStub, int rank, int heartTime, int tag,
-                       int nbdc, int nbsdc, int nbDaemonPerSpawner, int nbDaemonPerThread)
+                       int nbdc, int nbsdc, int nbDaemonPerSpawner, int nbDaemonPerThread,
+                       String idAlgo)
                        throws RemoteException {
-               System.out.println("beginning the transformation .........");
-//             @SuppressWarnings("unused")
-//             JaceSpawner spawner = new JaceSpawner(params, appliName, reg, nbTasks,
-//                             snodeStub, rank, heartTime, tag, nbdc, nbsdc,
-//                             nbDaemonPerSpawner, nbDaemonPerThread);
+               System.out.println("Beginning the transformation ...");
+               new JaceSpawner(params, appliName, reg, nbTasks,
+                               snodeStub, rank, heartTime, tag, nbdc, nbsdc,
+                               nbDaemonPerSpawner, nbDaemonPerThread, idAlgo);
                HeartBeatThread.Instance().kill();
                return Register.Instance().getSpawnerStub();
        }
@@ -59,7 +73,7 @@ public class JaceServer extends UnicastRemoteObject implements JaceInterface {
                // 1 - replace the old Register by the new one
                System.out.println(" \n\n             NEW REGISTER            \n\n");
                // if(Register.Instance().getVersion()<=newReg.getVersion()){
-               System.out.println("replacing Register !!!!!!$$$$$$$$******");
+               System.out.println("Replacing Register ...");
                Register.Instance().replaceBy(newReg);
                Register.Instance().viewAll();
                // }
@@ -107,7 +121,7 @@ public class JaceServer extends UnicastRemoteObject implements JaceInterface {
                        myTaskId.setHostStub(node.getStub());
 
                } catch (Exception e) {
-                       System.out.println("error in updateregister :" + e);
+                       System.err.println("Error in updateregister :" + e);
                        // e.printStackTrace();
                }
        }
@@ -128,7 +142,7 @@ public class JaceServer extends UnicastRemoteObject implements JaceInterface {
        }
 
        public void suicide(String debugMsg) throws RemoteException {
-               System.out.println("suiciiiiiiiiiiiide : "/* + debugMsg */);
+//             System.out.println("suiciiiiiiiiiiiide : "/* + debugMsg */);
                new ReinitDaemon().start();
        }
 
@@ -260,7 +274,7 @@ public class JaceServer extends UnicastRemoteObject implements JaceInterface {
                                ScanThread.Instance().notify();
                        }
                } catch (Exception e) {
-                       System.out.println("error in setScanning: " + e);
+                       System.err.println("Error in setScanning: " + e);
                }
                // System.out.println("before notify!!!!!!!!!");
                // try{ScanThread.Instance().notify();}