if (getDestination() instanceof ExchangeSendingDestination && addressSpace instanceof QueueManagingVirtualHost && TerminusExpiryPolicy.NEVER.equals(expiryPolicy)) ((ExchangeSendingDestination) getDestination()).getQueue().getName());
public boolean updateSourceForSubscription(final SendingLinkEndpoint linkEndpoint, final Source newSource, final SendingDestination newDestination) { SendingDestination oldDestination = linkEndpoint.getDestination(); if (oldDestination instanceof ExchangeSendingDestination) { ExchangeSendingDestination oldExchangeDestination = (ExchangeSendingDestination) oldDestination; String newAddress = newSource.getAddress(); if (newDestination instanceof ExchangeSendingDestination) { ExchangeSendingDestination newExchangeDestination = (ExchangeSendingDestination) newDestination; if (oldExchangeDestination.getQueue() != newExchangeDestination.getQueue()) { Source oldSource = linkEndpoint.getSource(); oldSource.setAddress(newAddress); oldSource.setFilter(newSource.getFilter()); return true; } } } return false; }
@Override protected void resumeLink(final Attach attach) throws AmqpErrorException { if (getSource() == null) { throw new IllegalStateException("Terminus should be set when resuming a Link."); } if (attach.getSource() == null) { throw new IllegalStateException("Attach.getSource should not be null when resuming a Link. That would be recovering the Link."); } Source newSource = (Source) attach.getSource(); Source oldSource = getSource(); final SendingDestination destination = getSession().getSendingDestination(getLink(), oldSource); prepareConsumerOptionsAndFilters(destination); if (getDestination() instanceof ExchangeSendingDestination && !Boolean.TRUE.equals(newSource.getDynamic())) { final SendingDestination newDestination = getSession().getSendingDestination(getLink(), newSource); if (getSession().updateSourceForSubscription(this, newSource, newDestination)) { setDestination(newDestination); } } attachReceived(attach); }
@Override protected void reattachLink(final Attach attach) throws AmqpErrorException { if (getSource() == null) { throw new IllegalStateException("Terminus should be set when resuming a Link."); } if (attach.getSource() == null) { throw new IllegalStateException("Attach.getSource should not be null when resuming a Link. That would be recovering the Link."); } Source newSource = (Source) attach.getSource(); Source oldSource = getSource(); final SendingDestination destination = getSession().getSendingDestination(getLink(), oldSource); prepareConsumerOptionsAndFilters(destination); if (getDestination() instanceof ExchangeSendingDestination && !Boolean.TRUE.equals(newSource.getDynamic())) { final SendingDestination newDestination = getSession().getSendingDestination(getLink(), newSource); if (getSession().updateSourceForSubscription(this, newSource, newDestination)) { setDestination(newDestination); } } attachReceived(attach); }