public List<MessageReference> remove(ConnectionContext context, Destination destination, List<MessageReference> dispatched) throws Exception { LinkedList<MessageReference> redispatch = new LinkedList<MessageReference>(); synchronized(pendingLock) { super.remove(context, destination); // Here is a potential problem concerning Inflight stat: // Messages not already committed or rolled back may not be removed from dispatched list at the moment // Except if each commit or rollback callback action comes before remove of subscriber. redispatch.addAll(pending.remove(context, destination)); if (dispatched == null) { return redispatch; } // Synchronized to DispatchLock if necessary if (dispatched == this.dispatched) { synchronized(dispatchLock) { addReferencesAndUpdateRedispatch(redispatch, destination, dispatched); } } else { addReferencesAndUpdateRedispatch(redispatch, destination, dispatched); } } return redispatch; }
public List<MessageReference> remove(ConnectionContext context, Destination destination, List<MessageReference> dispatched) throws Exception { LinkedList<MessageReference> redispatch = new LinkedList<MessageReference>(); synchronized(pendingLock) { super.remove(context, destination); // Here is a potential problem concerning Inflight stat: // Messages not already committed or rolled back may not be removed from dispatched list at the moment // Except if each commit or rollback callback action comes before remove of subscriber. redispatch.addAll(pending.remove(context, destination)); if (dispatched == null) { return redispatch; } // Synchronized to DispatchLock if necessary if (dispatched == this.dispatched) { synchronized(dispatchLock) { addReferencesAndUpdateRedispatch(redispatch, destination, dispatched); } } else { addReferencesAndUpdateRedispatch(redispatch, destination, dispatched); } } return redispatch; }
public List<MessageReference> remove(ConnectionContext context, Destination destination, List<MessageReference> dispatched) throws Exception { LinkedList<MessageReference> redispatch = new LinkedList<MessageReference>(); synchronized(pendingLock) { super.remove(context, destination); // Here is a potential problem concerning Inflight stat: // Messages not already committed or rolled back may not be removed from dispatched list at the moment // Except if each commit or rollback callback action comes before remove of subscriber. redispatch.addAll(pending.remove(context, destination)); if (dispatched == null) { return redispatch; } // Synchronized to DispatchLock if necessary if (dispatched == this.dispatched) { synchronized(dispatchLock) { addReferencesAndUpdateRedispatch(redispatch, destination, dispatched); } } else { addReferencesAndUpdateRedispatch(redispatch, destination, dispatched); } } return redispatch; }
public List<MessageReference> remove(ConnectionContext context, Destination destination, List<MessageReference> dispatched) throws Exception { LinkedList<MessageReference> redispatch = new LinkedList<MessageReference>(); synchronized(pendingLock) { super.remove(context, destination); // Here is a potential problem concerning Inflight stat: // Messages not already committed or rolled back may not be removed from dispatched list at the moment // Except if each commit or rollback callback action comes before remove of subscriber. redispatch.addAll(pending.remove(context, destination)); if (dispatched == null) { return redispatch; } // Synchronized to DispatchLock if necessary if (dispatched == this.dispatched) { synchronized(dispatchLock) { addReferencesAndUpdateRedispatch(redispatch, destination, dispatched); } } else { addReferencesAndUpdateRedispatch(redispatch, destination, dispatched); } } return redispatch; }