diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-12-30 06:50:29 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-12-30 06:50:29 +0000 |
commit | a4a7690c336d4c8a16b3041c86d501ba38226e96 (patch) | |
tree | 9e9f93a98edd2591453f092d178ad29a1c5fb519 /java/tests/Reactor/TimerQueueTest.java | |
parent | a5c4d8047ab58df5c45092e18ae503ad40518f0e (diff) | |
download | ATCD-unlabeled-4.1.2.tar.gz |
This commit was manufactured by cvs2svn to create branchunlabeled-4.1.2
'unlabeled-4.1.2'.
Diffstat (limited to 'java/tests/Reactor/TimerQueueTest.java')
-rw-r--r-- | java/tests/Reactor/TimerQueueTest.java | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/java/tests/Reactor/TimerQueueTest.java b/java/tests/Reactor/TimerQueueTest.java deleted file mode 100644 index 114125c25f9..00000000000 --- a/java/tests/Reactor/TimerQueueTest.java +++ /dev/null @@ -1,80 +0,0 @@ -// ============================================================================ -// -// = PACKAGE -// tests.Reactor -// -// = FILENAME -// TimerQueueTest.java -// -// = AUTHOR -// Prashant Jain -// -// ============================================================================ -package tests.Reactor; - -import ACE.OS.*; -import ACE.ASX.*; -import ACE.Reactor.*; - -public class TimerQueueTest implements EventHandler -{ - public int handleTimeout (TimeValue tv, Object obj) - { - ACE.DEBUG ("handleTimeout: " + tv.toString () + " " + (String) obj); - return 0; - } - - public static void main (String args []) - { - TimerQueue tq = new TimerQueue (true); - TimerQueueTest th1 = new TimerQueueTest (); - int n = 5; - - try - { - if (args.length == 1) - { - n = Integer.parseInt (args[0]); - } - } - catch (NumberFormatException e) - { - ACE.ERROR ("Illegal argument."); - } - - // Set a periodic timer - int id= tq.scheduleTimer (th1, - "periodic", - new TimeValue (2), - new TimeValue (3)); - - int i; - // Set a bunch of single timers - for (i=1; i <= n; i++) - { - tq.scheduleTimer (th1, - "A-timer-" + new Integer (i), - new TimeValue (i*2)); - } - - TimerQueueTest th2 = new TimerQueueTest (); - for (i=1; i <= n; i++) - { - tq.scheduleTimer (th2, - "B-timer-" + new Integer (i), - new TimeValue (i*3)); - } - // Cancel all timers associated with this handler - tq.cancelTimer (th2); - - try - { - Thread.sleep (30000); - } - catch (InterruptedException e) - { - } - tq.cancelTimer (id); - System.exit (0); - } -} |