diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-09-24 01:23:45 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-09-24 01:23:45 +0000 |
commit | 971b5fef4c0790745d71d7493090c54af9fc3b60 (patch) | |
tree | b9031b2eb4584c797d558a208156cb50296c257e /java/apps/NexusII/src/Consumer.java | |
parent | 39c67e8460275499ffcaf2ed95fe4df6cd157f28 (diff) | |
download | ATCD-pos_avsvc_split.tar.gz |
This commit was manufactured by cvs2svn to create tagpos_avsvc_split
'pos_avsvc_split'.
Diffstat (limited to 'java/apps/NexusII/src/Consumer.java')
-rw-r--r-- | java/apps/NexusII/src/Consumer.java | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/java/apps/NexusII/src/Consumer.java b/java/apps/NexusII/src/Consumer.java deleted file mode 100644 index 84df9b3a3ae..00000000000 --- a/java/apps/NexusII/src/Consumer.java +++ /dev/null @@ -1,74 +0,0 @@ - -// This class encapsulates a Consumer. The consumer dq's from the queue -// Supports both a timed and blocking consumer. -// Each instance of this class creates a different thread of control. -// On timeout, the producer returns. -// The producer tries to dq "iteration" number of times, unless it times out - -//package NexusII.util ; - -public class Consumer extends Thread -{ -public static final int DEFAULT_ITERATIONS = 1 ; -public Consumer(MT_Bounded_Queue queue) - { - this.queue_ = queue ; - this.iterations_ = new Integer(DEFAULT_ITERATIONS); - this.time_out_ = -1 ; - } - -public Consumer(MT_Bounded_Queue queue, String name) - { - super(name); - this.queue_ = queue ; - this.iterations_ = new Integer(DEFAULT_ITERATIONS); - this.time_out_ = -1 ; - } - - -public Consumer(MT_Bounded_Queue queue, String name, Integer iterations) - { - super(name); - this.queue_ = queue ; - this.iterations_ = iterations ; - this.time_out_ = -1 ; - } - - -public Consumer(MT_Bounded_Queue queue, String name, Integer iterations, long msec_timeout) - { - super(name); - this.queue_ = queue ; - this.iterations_ = iterations ; - this.time_out_ = msec_timeout ; - } - - - -public void run() - { - for(int i=0;i<iterations_.intValue();i++) - { - if(time_out_ < 0) - System.out.println(getName() + ": dequeued " + queue_.dq()); - else - { - Object err = queue_.dq(time_out_); - if(err == null) - { - System.out.println(getName() + ": Timedout\n"); - return ; - } - - else - System.out.println(getName() + ": dequeued " + err); - } - } - } - - -protected MT_Bounded_Queue queue_ ; -private Integer iterations_ ; -private long time_out_ ; -} - |