// If we would iterate over the map directly we can risk a java.util.ConcurrentModificationException
// when one of the callback fails and the entry is removed by the callback worker thread
SubscriptionInfo[] subInfoArr = (SubscriptionInfo[])subInfoList.toArray(new SubscriptionInfo[subInfoList.size()]);
for (int ii=0; ii<subInfoArr.length; ii++) {
SubscriptionInfo sub = subInfoArr[ii];
if (TopicHandler.isDirtyRead(sub, msgUnitWrapper)) {
log.severe("ConsumableQueuePlugin used together with 'dirtyRead' is not supported");
TopicHandler topicHandler = this.serverScope.getTopicAccessor().access(this.topicId);
if (topicHandler == null) return true;
try {
I_Queue srcQueue = topicHandler.getHistoryQueue();
if (srcQueue != null) srcQueue.removeRandom(entry);
}
finally {
this.serverScope.getTopicAccessor().release(topicHandler);
}
return true; // even if it has not been sent
}
}
for (int ii=0; ii<subInfoArr.length; ii++) {
SubscriptionInfo sub = subInfoArr[ii];
if (!TopicHandler.subscriberMayReceiveIt(sub, msgUnitWrapper)) continue;
//Has no effect:
//if (!this.topicHandler.checkIfAllowedToSend(null, sub)) continue;
// this is specific for this plugin
if (sub.getSessionInfo().getDispatchManager() == null) continue;
if (!sub.getSessionInfo().getDispatchManager().getDispatchConnectionsHandler().isAlive()) continue;
try {
try {
TopicHandler topicHandler = this.serverScope.getTopicAccessor().access(this.topicId);