Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add live migration plugin in java.
[simgrid.git] / examples / java / cloud / migration / Main.java
1 /* Copyright (c) 2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 package cloud.migration;
8
9 import org.simgrid.msg.Msg;
10 import org.simgrid.msg.MsgException;
11
12 public class Main {
13   private static boolean endOfTest = false;
14
15   private Main() {
16     throw new IllegalAccessError("Utility class");
17   }
18
19   public static void setEndOfTest(){
20     endOfTest=true;
21   }
22
23   public static boolean isEndOfTest(){
24     return endOfTest;
25   }
26
27   public static void main(String[] args) throws MsgException {
28     Msg.init(args);
29     Msg.liveMigrationInit();
30     if (args.length < 1) {
31       Msg.info("Usage  : Main platform_file.xml");
32       System.exit(1);
33     }
34
35     /* construct the platform and deploy the application */
36     Msg.createEnvironment(args[0]);
37     new cloud.migration.Test("PM0","Test").start();
38     Msg.run();
39   }
40 }