Search in sources :

Example 1 with MessageSender

use of org.apache.qpid.server.message.MessageSender in project qpid-broker-j by apache.

the class AbstractExchange method performDelete.

private void performDelete() {
    if (_closed.compareAndSet(false, true)) {
        performDeleteTasks();
        for (Binding b : _bindings) {
            final MessageDestination messageDestination = getAttainedMessageDestination(b.getDestination());
            if (messageDestination != null) {
                messageDestination.linkRemoved(this, b);
            }
        }
        for (MessageSender sender : _linkedSenders.keySet()) {
            sender.destinationRemoved(this);
        }
        if (_alternateBindingDestination != null) {
            _alternateBindingDestination.removeReference(AbstractExchange.this);
        }
        getEventLogger().message(_logSubject, ExchangeMessages.DELETED());
    }
}
Also used : Binding(org.apache.qpid.server.model.Binding) AlternateBinding(org.apache.qpid.server.model.AlternateBinding) MessageDestination(org.apache.qpid.server.message.MessageDestination) MessageSender(org.apache.qpid.server.message.MessageSender)

Example 2 with MessageSender

use of org.apache.qpid.server.message.MessageSender in project qpid-broker-j by apache.

the class AbstractQueue method getPublishingLinks.

@Override
public Collection<PublishingLink> getPublishingLinks() {
    List<PublishingLink> links = new ArrayList<>();
    for (MessageSender sender : _linkedSenders.keySet()) {
        final Collection<? extends PublishingLink> linksForDestination = sender.getPublishingLinks(this);
        links.addAll(linksForDestination);
    }
    return links;
}
Also used : MessageSender(org.apache.qpid.server.message.MessageSender) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) ArrayList(java.util.ArrayList)

Example 3 with MessageSender

use of org.apache.qpid.server.message.MessageSender in project qpid-broker-j by apache.

the class AbstractQueue method performDelete.

private ListenableFuture<Integer> performDelete() {
    if (_deleted.compareAndSet(false, true)) {
        if (getState() == State.UNINITIALIZED) {
            preSetAlternateBinding();
            _deleteQueueDepthFuture.set(0);
            return _deleteQueueDepthFuture;
        }
        final int queueDepthMessages = getQueueDepthMessages();
        for (MessageSender sender : _linkedSenders.keySet()) {
            sender.destinationRemoved(this);
        }
        try {
            Iterator<QueueConsumer<?, ?>> consumerIterator = _queueConsumerManager.getAllIterator();
            while (consumerIterator.hasNext()) {
                QueueConsumer<?, ?> consumer = consumerIterator.next();
                if (consumer != null) {
                    consumer.queueDeleted();
                }
            }
            final List<QueueEntry> entries = getMessagesOnTheQueue(new AcquireAllQueueEntryFilter());
            routeToAlternate(entries);
            preSetAlternateBinding();
            _alternateBinding = null;
            _stopped.set(true);
            _queueHouseKeepingTask.cancel();
            performQueueDeleteTasks();
            // Log Queue Deletion
            getEventLogger().message(_logSubject, QueueMessages.DELETED(getId().toString()));
            _deleteQueueDepthFuture.set(queueDepthMessages);
        } catch (Throwable e) {
            _deleteQueueDepthFuture.setException(e);
        }
    }
    return _deleteQueueDepthFuture;
}
Also used : MessageSender(org.apache.qpid.server.message.MessageSender)

Aggregations

MessageSender (org.apache.qpid.server.message.MessageSender)3 ArrayList (java.util.ArrayList)1 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)1 MessageDestination (org.apache.qpid.server.message.MessageDestination)1 AlternateBinding (org.apache.qpid.server.model.AlternateBinding)1 Binding (org.apache.qpid.server.model.Binding)1