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 |
|
|
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(); |