protected void processLinkFlow(Link link) throws Exception { Object context = link.getContext(); if (context instanceof AmqpLink) { ((AmqpLink) context).flow(); } }
@Override protected void remoteLinkOpened(Link link) throws Exception { Object context = link.getContext(); if (context != null && context instanceof ProtonInitializable) { ((ProtonInitializable) context).initialise(); } } }
public ProtonLinkImpl getLinkImpl() { return (ProtonLinkImpl) delivery.getLink().getContext(); }
protected void processLinkFlow(Link link) throws Exception { Object context = link.getContext(); if (context instanceof AmqpLink) { ((AmqpLink) context).flow(); } }
public ProtonLinkImpl getLink() { return (ProtonLinkImpl) this.delivery.getLink().getContext(); }
@Override public void onLocalDetach(Link link) throws Exception { Object context = link.getContext(); if (context instanceof ProtonServerSenderContext) { ProtonServerSenderContext senderContext = (ProtonServerSenderContext) context; senderContext.close(false); } }
@Override public void onFlow(Link link) throws Exception { if (link.getContext() != null) { ((ProtonDeliveryHandler) link.getContext()).onFlow(link.getCredit(), link.getDrain()); } }
@Override public void onFlow(Link link) throws Exception { if (link.getContext() != null) { ((ProtonDeliveryHandler) link.getContext()).onFlow(link.getCredit(), link.getDrain()); } }
@Override public void onDelivery(Delivery delivery) throws Exception { ProtonDeliveryHandler handler = (ProtonDeliveryHandler) delivery.getLink().getContext(); if (handler != null) { handler.onMessage(delivery); } else { // TODO: logs System.err.println("Handler is null, can't delivery " + delivery); } }
@Override public void onLocalDetach(Link link) throws Exception { handler.requireHandler(); Object context = link.getContext(); if (context instanceof ProtonServerSenderContext) { ProtonServerSenderContext senderContext = (ProtonServerSenderContext) context; senderContext.close(false); } }
@Override public void onRemoteClose(Link link) throws Exception { link.close(); ProtonDeliveryHandler linkContext = (ProtonDeliveryHandler) link.getContext(); if (linkContext != null) { linkContext.close(true); } }
@Override public void onDelivery(Delivery delivery) throws Exception { handler.requireHandler(); ProtonDeliveryHandler handler = (ProtonDeliveryHandler) delivery.getLink().getContext(); if (handler != null) { handler.onMessage(delivery); } else { log.warn("Handler is null, can't delivery " + delivery, new Exception("tracing location")); } } }
protected void processDelivery(Delivery delivery) throws Exception { if (!delivery.isPartial()) { Object context = delivery.getLink().getContext(); if (context instanceof AmqpLink) { AmqpLink amqpLink = (AmqpLink) context; amqpLink.delivery(delivery); } } }
protected void processLinkDetach(Link link) throws Exception { Object context = link.getContext(); if (context instanceof AmqpLink) { ((AmqpLink) context).detach(); } else { link.detach(); link.free(); } }
protected void processDelivery(Delivery delivery) throws Exception { if (!delivery.isPartial()) { Object context = delivery.getLink().getContext(); if (context instanceof AmqpLink) { AmqpLink amqpLink = (AmqpLink) context; amqpLink.delivery(delivery); } } }
@Override public void onFlow(Link link) throws Exception { ((ProtonDeliveryHandler) link.getContext()).onFlow(link.getCredit(), link.getDrain()); }
protected void processLinkClose(Link link) throws Exception { Object context = link.getContext(); if (context instanceof AmqpLink) { ((AmqpLink) context).close();; } else { link.close(); link.free(); } }
protected void processLinkDetach(Link link) throws Exception { Object context = link.getContext(); if (context instanceof AmqpLink) { ((AmqpLink) context).detach(); } else { link.detach(); link.free(); } }
protected void processLinkClose(Link link) throws Exception { Object context = link.getContext(); if (context instanceof AmqpLink) { ((AmqpLink) context).close();; } else { link.close(); link.free(); } }
@Override public void onRemoteClose(Link link) throws Exception { lock(); try { link.close(); link.free(); } finally { unlock(); } ProtonDeliveryHandler linkContext = (ProtonDeliveryHandler) link.getContext(); if (linkContext != null) { linkContext.close(true); } }