Called just before a transfer is finalized (by ActiveRouter#update()). Reduces the number of copies we have left for a message. In binary Spray and Wait, sending host is left with floor(n/2) copies, but in standard mode, nrof copies left is reduced by one.
(Connection con)
| 135 | * but in standard mode, nrof copies left is reduced by one. |
| 136 | */ |
| 137 | @Override |
| 138 | protected void transferDone(Connection con) { |
| 139 | Integer nrofCopies; |
| 140 | String msgId = con.getMessage().getId(); |
| 141 | /* get this router's copy of the message */ |
| 142 | Message msg = getMessage(msgId); |
| 143 | |
| 144 | if (msg == null) { // message has been dropped from the buffer after.. |
| 145 | return; // ..start of transfer -> no need to reduce amount of copies |
| 146 | } |
| 147 | |
| 148 | /* reduce the amount of copies left */ |
| 149 | nrofCopies = (Integer)msg.getProperty(MSG_COUNT_PROPERTY); |
| 150 | if (isBinary) { |
| 151 | nrofCopies /= 2; |
| 152 | } |
| 153 | else { |
| 154 | nrofCopies--; |
| 155 | } |
| 156 | msg.updateProperty(MSG_COUNT_PROPERTY, nrofCopies); |
| 157 | } |
| 158 | |
| 159 | @Override |
| 160 | public SprayAndWaitRouter replicate() { |
nothing calls this directly
no test coverage detected