aboutsummaryrefslogtreecommitdiff
path: root/tests/StopStart.java
blob: 5962d27aac42e953e82d1ced3cfee78f6fffd6f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import fr.dgac.ivy.* ;

class StopStart {

  Ivy bus;

  public static void main(String[] args) throws IvyException {
    String domain=Ivy.getDomainArgs("StopStartTest",args);
    new StopStart(domain);
  }

  public StopStart(String domain) throws IvyException {
    int n=1;
    bus = new Ivy("StopStart","StopStart ready", null);
    System.out.println("--------------- starting bus");
    bus.start(domain);
    System.out.println("--------------- sleeping "+n+" seconds");
    try { Thread.sleep(n*1000); } catch (InterruptedException ie) { }
    System.out.println("--------------- stopping bus");
    bus.stop();
    System.out.println("--------------- restarting bus");
    bus.start(domain);
    System.out.println("sleeping "+n+" seconds");
    try { Thread.sleep(n*1000); } catch (InterruptedException ie) { }
    System.out.println("--------------- restopping bus");
    bus.stop();
    System.out.println("--------------- good bye, program should exit now");
  }

}