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());
}
}
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;
}
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;
}
Aggregations