ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/experimental/server/Queue/Producer.java
Revision: 1.1
Committed: Thu Dec 28 01:01:15 2000 UTC (24 years ago) by tdb
Branch: MAIN
Log Message:
A 'producer' for testing purposes. Generates a string and adds it to a Queue.

Also prints out the output from the Queue.status() method.

File Contents

# User Rev Content
1 tdb 1.1 class Producer extends Thread {
2    
3     public Producer(Queue queue) {
4     _queue = queue;
5     }
6    
7     public void run() {
8     int count = 0;
9     while(true) {
10     try { Thread.sleep(1000); } catch(Exception e) {}
11     _queue.add("Object number "+count);
12     count ++;
13     if(count % 10 == 0) {
14     System.out.println(_queue.status());
15     }
16     }
17     }
18    
19     private Queue _queue;
20    
21     }