1 package org.sapia.ubik.rmi.examples.time; 2 3 import org.sapia.ubik.rmi.server.Hub; 4 import org.sapia.ubik.rmi.server.Log; 5 6 7 10 public class EndlessTimeClient { 11 public static void main(String [] args) { 12 Log.setInfo(); 13 14 try { 15 int i = 0; 16 TimeClient aClient = new TimeClient(); 17 18 while (true) { 19 System.out.print((++i) + " - "); 20 aClient.execute(); 21 Thread.sleep(15000); 22 } 23 } catch (InterruptedException ie) { 24 System.err.println("The endless time client is interrupted, exiting..."); 25 ie.printStackTrace(); 26 } catch (RuntimeException re) { 27 System.err.println("System error running the time client, exiting..."); 28 re.printStackTrace(); 29 } finally { 30 try { 31 Hub.shutdown(30000); 32 } catch (InterruptedException e) { 33 e.printStackTrace(); 34 } 35 } 36 } 37 } 38 | Popular Tags |