| 88 |
|
} |
| 89 |
|
return o; |
| 90 |
|
} |
| 91 |
< |
|
| 91 |
> |
|
| 92 |
|
/** |
| 93 |
+ |
* This method releases a get() method that's currently |
| 94 |
+ |
* waiting on an empty queue. This was designed for |
| 95 |
+ |
* shutdown() type methods that may have problems closing |
| 96 |
+ |
* if the thread of control is waiting on a queue. |
| 97 |
+ |
* |
| 98 |
+ |
* @param queue the queue to release |
| 99 |
+ |
*/ |
| 100 |
+ |
public void releaseQueue(int queue) { |
| 101 |
+ |
synchronized(((LinkedList) _lists.get(queue))) { |
| 102 |
+ |
((LinkedList) _lists.get(queue)).notifyAll(); |
| 103 |
+ |
} |
| 104 |
+ |
} |
| 105 |
+ |
|
| 106 |
+ |
/** |
| 107 |
|
* This method returns a textual status of the queues. It |
| 108 |
|
* is merely for observation, and would most likely be used |
| 109 |
|
* by a larger "monitoring" component. Information returned |
| 138 |
|
* @return the current size of the queue. |
| 139 |
|
*/ |
| 140 |
|
public int queueSize(int queue) throws InvalidQueueException { |
| 141 |
< |
if (queue >= _lists.size() || _lists.get(queue) == null) { |
| 141 |
> |
if (queue >= _lists.size() || _lists.get(queue) == null) { |
| 142 |
|
throw new InvalidQueueException("Requested queue "+queue+" does not exist"); |
| 143 |
|
} |
| 144 |
< |
return ((LinkedList) _lists.get(queue)).size(); |
| 144 |
> |
return ((LinkedList) _lists.get(queue)).size(); |
| 145 |
|
} |
| 146 |
|
|
| 147 |
|
/** |
| 151 |
|
* @return the element-ometer |
| 152 |
|
*/ |
| 153 |
|
public int elementCount() { |
| 154 |
< |
return _count; |
| 154 |
> |
return _count; |
| 155 |
|
} |
| 156 |
|
|
| 157 |
|
/** |