1 | package com.renomad.minum.queue; | |
2 | ||
3 | import java.util.Queue; | |
4 | import java.util.concurrent.LinkedBlockingQueue; | |
5 | ||
6 | /** | |
7 | * This class tracks the overall state of the {@link ActionQueue}s that | |
8 | * are in use throughout the system. We need one central place to | |
9 | * track these, so that at system shutdown we can close them all cleanly. | |
10 | * <br> | |
11 | * As each ActionQueue gets created, it registers itself here. | |
12 | */ | |
13 | public class ActionQueueState { | |
14 | ||
15 | private final Queue<AbstractActionQueue> aqQueue; | |
16 | ||
17 | public ActionQueueState() { | |
18 | aqQueue = new LinkedBlockingQueue<>(); | |
19 | } | |
20 | ||
21 | public String aqQueueAsString() { | |
22 |
1
1. aqQueueAsString : replaced return value with "" for com/renomad/minum/queue/ActionQueueState::aqQueueAsString → TIMED_OUT |
return aqQueue.toString(); |
23 | } | |
24 | ||
25 | public void offerToQueue(AbstractActionQueue actionQueue) { | |
26 | aqQueue.offer(actionQueue); | |
27 | } | |
28 | ||
29 | public AbstractActionQueue pollFromQueue() { | |
30 |
1
1. pollFromQueue : replaced return value with null for com/renomad/minum/queue/ActionQueueState::pollFromQueue → KILLED |
return aqQueue.poll(); |
31 | } | |
32 | ||
33 | public boolean isAqQueueEmpty() { | |
34 |
2
1. isAqQueueEmpty : replaced boolean return with true for com/renomad/minum/queue/ActionQueueState::isAqQueueEmpty → KILLED 2. isAqQueueEmpty : replaced boolean return with false for com/renomad/minum/queue/ActionQueueState::isAqQueueEmpty → KILLED |
return aqQueue.isEmpty(); |
35 | } | |
36 | ||
37 | } | |
Mutations | ||
22 |
1.1 |
|
30 |
1.1 |
|
34 |
1.1 2.2 |