* Messages are successfully sent, remove them now from queue (sort of a commit()):
* We remove filtered/destroyed messages as well (which doen't show up in entryListChecked)
* @param postSendNotify TODO
*/
public void removeFromQueue(MsgQueueEntry[] entries, boolean postSendNotify) throws XmlBlasterException {
I_MsgDispatchInterceptor msgInterceptor = getMsgDispatchInterceptor();
MsgUnit[] msgUnits = null;
if (msgInterceptor != null) { // we need to do this before removal since the msgUnits are weak references and would be deleted by gc
msgUnits = new MsgUnit[entries.length];
for (int i=0; i < msgUnits.length; i++) {
msgUnits[i] = entries[i].getMsgUnit();
}
}
this.msgQueue.removeRandom(entries);
/*(currently only done in sync invocation)
ArrayList defaultEntries = sendAsyncResponseEvent(entryList);
if (defaultEntries.size() > 0) {
MsgQueueEntry[] entries = (MsgQueueEntry[])defaultEntries.toArray(new MsgQueueEntry[defaultEntries.size()]);
this.msgQueue.removeRandom(entries);
}
*/
if (postSendNotify)
postSendNotification(entries);
if (msgInterceptor != null) {
msgInterceptor.postHandleNextMessages(this, msgUnits);
}
if (log.isLoggable(Level.FINE)) log.fine("Commit of successful sending of " +
entries.length + " messages done, current queue size is " +
this.msgQueue.getNumOfEntries() + " '" + entries[0].getLogId() + "'");