Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reorganize java sources
[simgrid.git] / examples / suspend / DreamMaster.java
1 /*
2  * $Id$
3  *
4  * Copyright 2006,2007,2010. The SimGrid Team. All rights reserved. 
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. 
8  */
9
10 import simgrid.msg.*;
11
12 public class DreamMaster extends simgrid.msg.Process {
13     
14    public void main(String[] args) throws MsgException {
15       Msg.info("Hello !");
16       Msg.info("Let's create a lazy guy.");
17        
18       try {
19          Host currentHost = Host.currentHost();
20          Msg.info("Current hostname: " + currentHost.getName());
21          
22          LazyGuy lazy = new LazyGuy(currentHost,"LazyGuy");
23          Msg.info("Let's wait a little bit...");
24
25          simgrid.msg.Process.waitFor(10.0);
26
27          Msg.info("Let's wake the lazy guy up! >:) ");
28          lazy.restart();
29          
30         } catch(HostNotFoundException e) {
31            System.err.println(e);
32            System.exit(1);
33         }
34        
35       //lazy.migrate(currentHost);
36          
37       Msg.info("OK, goodbye now.");
38    }
39 }