Logo AND Algorithmique Numérique Distribuée

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