Launcher: Applied new VM launching method.
authorminkee.lee <minkee.lee@samsung.com>
Wed, 27 May 2015 08:25:46 +0000 (17:25 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Fri, 29 May 2015 02:04:41 +0000 (11:04 +0900)
- It uses launch config file and script to launch VM.
- Legacy source code is not removed yet.

Change-Id: I20dbe087f46d0300ef437b903d1bcc797a4893c5
Signed-off-by: minkee.lee <minkee.lee@samsung.com>
src/org/tizen/emulator/manager/console/ConsoleProcessor.java
src/org/tizen/emulator/manager/vms/VMWorkerCommon.java

index 7d9ec1b..179e4f0 100644 (file)
@@ -214,65 +214,88 @@ public class ConsoleProcessor {
                        }
                }
 
-               if (EmulatorManager.getManagerMode() == ManagerModeType.INHOUSE_MODE) {
-                       if (!isTest) {
-                               try {
-                                       System.out.println("Arguments from vm_launch.conf...");
-                                       System.out.println();
-                                       for (String str : LaunchConfig.readLaunchConfig(prop.getName())) {
-                                               System.out.println(str);
-                                       }
-                                       System.out.println();
-
-                                       prop.getWorker().launchVM(true, path);
-                               } catch (VMWorkerException e) {
-                                       System.out.println("Error: Can not execute this VM."
-                                                       + StringResources.NEW_LINE
-                                                       + e.getMessage());
-                                       return false;
-                               }
-
-                               System.out.println("Success: To start emulator is completed.");
+               if (isTest || EMLogger.getLogger().getLevel() == Level.WARNING) {
+                       System.out.println("Print launch config file : "
+                                       + LaunchConfig.getLaunchConfigPath(prop.getName())
+                                       + StringResources.NEW_LINE);
+                       for (String str : LaunchConfig.readLaunchConfig(prop.getName())) {
+                               System.out.println(str);
                        }
+                       System.out.println();
+               }
 
-               } else {
-                       List<String> cmd;
+               if (!isTest) {
                        try {
-                               ILauncher launcher = prop.getWorker().getLauncher();
-                               if (launcher == null) {
-                                       throw new VMWorkerException("Fail to get launcher");
-                               }
-                               cmd = launcher.getLaunchCommand(prop, path);
-
+                               prop.getWorker().launchVM(true, path);
                        } catch (VMWorkerException e) {
-                               EMLogger.getLogger().log(Level.WARNING, "Failed to launch :" + e.getMessage());
-                               System.out.println("Error: " + "Failed to launch: " + e.getMessage());
+                               System.out.println("Error: Can not execute this VM."
+                                               + StringResources.NEW_LINE
+                                               + e.getMessage());
                                return false;
                        }
 
-                       if (isTest || EMLogger.getLogger().getLevel() == Level.WARNING) {
-                               System.out.println("Arguments of emulator : ");
-                               String temp = cmd.get(0) + " ";
-                               for (String s : cmd.subList(1, cmd.size())) {
-                                       temp += ("\"" + s + "\" ");
-                               }
-                               System.out.println(temp);
-                               System.out.println();
-                       }
-
-                       if (!isTest) {
-                               try {
-                                       prop.getWorker().launchVM(true, null);
-                               } catch (VMWorkerException e) {
-                                       System.out.println("Error: Can not execute this VM."
-                                                       + StringResources.NEW_LINE
-                                                       + e.getMessage());
-                                       return false;
-                               }
-
-                               System.out.println("Success: To start emulator is completed.");
-                       }
+                       System.out.println("Success: To start emulator is completed.");
                }
+
+//             if (EmulatorManager.getManagerMode() == ManagerModeType.INHOUSE_MODE) {
+//                     if (!isTest) {
+//                             try {
+//                                     System.out.println("Arguments from vm_launch.conf...");
+//                                     System.out.println();
+//                                     for (String str : LaunchConfig.readLaunchConfig(prop.getName())) {
+//                                             System.out.println(str);
+//                                     }
+//                                     System.out.println();
+//
+//                                     prop.getWorker().launchVM(true, path);
+//                             } catch (VMWorkerException e) {
+//                                     System.out.println("Error: Can not execute this VM."
+//                                                     + StringResources.NEW_LINE
+//                                                     + e.getMessage());
+//                                     return false;
+//                             }
+//
+//                             System.out.println("Success: To start emulator is completed.");
+//                     }
+//
+//             } else {
+//                     List<String> cmd;
+//                     try {
+//                             ILauncher launcher = prop.getWorker().getLauncher();
+//                             if (launcher == null) {
+//                                     throw new VMWorkerException("Fail to get launcher");
+//                             }
+//                             cmd = launcher.getLaunchCommand(prop, path);
+//
+//                     } catch (VMWorkerException e) {
+//                             EMLogger.getLogger().log(Level.WARNING, "Failed to launch :" + e.getMessage());
+//                             System.out.println("Error: " + "Failed to launch: " + e.getMessage());
+//                             return false;
+//                     }
+//
+//                     if (isTest || EMLogger.getLogger().getLevel() == Level.WARNING) {
+//                             System.out.println("Arguments of emulator : ");
+//                             String temp = cmd.get(0) + " ";
+//                             for (String s : cmd.subList(1, cmd.size())) {
+//                                     temp += ("\"" + s + "\" ");
+//                             }
+//                             System.out.println(temp);
+//                             System.out.println();
+//                     }
+//
+//                     if (!isTest) {
+//                             try {
+//                                     prop.getWorker().launchVM(true, null);
+//                             } catch (VMWorkerException e) {
+//                                     System.out.println("Error: Can not execute this VM."
+//                                                     + StringResources.NEW_LINE
+//                                                     + e.getMessage());
+//                                     return false;
+//                             }
+//
+//                             System.out.println("Success: To start emulator is completed.");
+//                     }
+//             }
                return true;
        }
 
index 75f2c40..f1e6f8c 100644 (file)
@@ -132,11 +132,9 @@ public class VMWorkerCommon {
                        isRunningNow();
 
                        boolean isSuccess;
-                       if (EmulatorManager.getManagerMode() == ManagerModeType.INHOUSE_MODE) {
-                               isSuccess = VMLauncher.Launch(property, wait, path); 
-                       } else {
-                               isSuccess = launcher.launch(property, wait); 
-                       }
+                       isSuccess = VMLauncher.Launch(property, wait, path);
+//                     isSuccess = launcher.launch(property, wait);
+
                        if (!isSuccess) {
                                throw new VMWorkerException("");
                        } else {