Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cleanups in Java examples advised by Sonar
[simgrid.git] / examples / java / dht / kademlia / Main.java
1 /* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 package dht.kademlia;
7 import org.simgrid.msg.Msg;
8
9 class Main {
10   private Main() {
11     throw new IllegalAccessError("Utility class");
12   }
13
14   public static void main(String[] args) {
15     Msg.init(args);
16     if(args.length < 2) {
17       Msg.info("Usage   : Kademlia platform_file deployment_file");
18       Msg.info("example : Kademlia ../platforms/platform.xml kademlia.xml");
19       System.exit(1);
20     }
21
22     /* construct the platform and deploy the application */
23     Msg.createEnvironment(args[0]);
24     Msg.deployApplication(args[1]);
25
26     /*  execute the simulation. */
27     Msg.run();
28   }
29 }