View Javadoc
1   package examples.experimental.example3.classes;
2   
3   import java.io.IOException;
4   
5   import java.util.Random;
6   
7   
8   public class PingService {
9     private Random random = new Random();
10  
11  
12    public void sendPing(Integer pingId) throws IOException {
13      try {
14        Thread.sleep(500 + random.nextInt(1000));
15      } catch (InterruptedException e) {
16      }
17  
18      System.out.println("ping made #" + pingId);
19    }
20  
21  }