ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/conient/uk/org/iscream/cms/conient/ConnectionHandler.java
(Generate patch)

Comparing projects/cms/source/conient/uk/org/iscream/cms/conient/ConnectionHandler.java (file contents):
Revision 1.28 by tdb, Mon Mar 19 18:06:21 2001 UTC vs.
Revision 1.29 by ajm, Thu Mar 22 01:19:04 2001 UTC

# Line 110 | Line 110 | public class ConnectionHandler extends Thread {
110       * firewall setup command to execute
111       */
112      public static final int DEFAULT_FIREWALL_COMMANDWAIT = 5;
113 +    
114 +    /**
115 +     * The default maximum queue size in use for the data queue
116 +     */
117 +    public static final int DEFAULT_QUEUE_LIMIT = 500;
118 +    
119 +    /**
120 +     * The algorithm we use to remove items from the queue
121 +     * if it reaches its maximum size.
122 +     *
123 +     * We use a FIFO algorithm, see the uk.org.iscream.util.Queue
124 +     * class for other options.
125 +     */
126 +    public static final int QUEUE_ALGORITHM = Queue.FIRST;
127  
128   //---STATIC METHODS---
129  
# Line 302 | Line 316 | public class ConnectionHandler extends Thread {
316                                  // so we start the appropriate components on their way
317                                  // we create a queue to give to both the reader and the
318                                  // displayer
319 <                                Queue theQueue = new Queue();
319 >                                
320 >                                String configQueueSize = _configuration.getProperty("dataQueueSize");
321 >                                int queueLimit = DEFAULT_QUEUE_LIMIT;
322 >                                if (configQueueSize != null) {
323 >                                    try {
324 >                                        queueLimit = Integer.parseInt(configQueueSize);
325 >                                    } catch (NumberFormatException e) {
326 >                                        // if it fails it will be default
327 >                                        Conient.addMessage("WARNING{data link}: invalid queue size in configuration, using default of - " + queueLimit);
328 >                                    }
329 >                                }
330 >                              
331 >                                Queue theQueue = new Queue(queueLimit, QUEUE_ALGORITHM);
332                                  _dataReader = new DataReader(_dataInBound, theQueue);
333                                  _data.setQueue(theQueue);
334                                  _data.cleanUpTabs();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines