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(); } }
protected void processLinkDetach(Link link) throws Exception { Object context = link.getContext(); if (context instanceof AmqpLink) { ((AmqpLink) context).detach(); } else { link.detach(); link.free(); } }
@Override public void free() { link.free(); getSession().getConnectionImpl().flush(); }
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 close() { if (!closed) { if (getEndpoint() != null) { getEndpoint().setContext(null); getEndpoint().close(); getEndpoint().free(); } for (Runnable action : closeActions) { action.run(); } closeActions.clear(); opened = false; closed = true; } }
@Override public void close() { if (!closed) { if (getEndpoint() != null) { getEndpoint().setContext(null); getEndpoint().close(); getEndpoint().free(); } for (Runnable action : closeActions) { action.run(); } closeActions.clear(); opened = false; closed = true; } }
@Override public void onRemoteClose(Link link) throws Exception { handler.requireHandler(); // We scheduled it for later, as that will work through anything that's pending on the current deliveries. runNow(() -> { link.close(); link.free(); ProtonDeliveryHandler linkContext = (ProtonDeliveryHandler) link.getContext(); if (linkContext != null) { try { linkContext.close(true); } catch (Exception e) { log.error(e.getMessage(), e); } } flush(); }); }
@Override public void onResponse(AmqpProtocolConverter converter, Response response) throws IOException { if (response.isException()) { link.setSource(null); Throwable exception = ((ExceptionResponse) response).getException(); if (exception instanceof SecurityException) { link.setCondition(new ErrorCondition(AmqpError.UNAUTHORIZED_ACCESS, exception.getMessage())); } else { link.setCondition(new ErrorCondition(AmqpError.INTERNAL_ERROR, exception.getMessage())); } 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); } }
@Override public void onResponse(AmqpProtocolConverter converter, Response response) throws IOException { if (response.isException()) { link.setSource(null); Throwable exception = ((ExceptionResponse) response).getException(); if (exception instanceof SecurityException) { link.setCondition(new ErrorCondition(AmqpError.UNAUTHORIZED_ACCESS, exception.getMessage())); } else { link.setCondition(new ErrorCondition(AmqpError.INTERNAL_ERROR, exception.getMessage())); } link.close(); link.free(); } } });
@Override public void detach() { if (!closed) { if (getEndpoint() != null) { getEndpoint().setContext(null); getEndpoint().detach(); getEndpoint().free(); } } }
@Override public void onRemoteDetach(Link link) throws Exception { handler.requireHandler(); boolean handleAsClose = link.getSource() != null && ((Source) link.getSource()).getExpiryPolicy() == TerminusExpiryPolicy.LINK_DETACH; if (handleAsClose) { onRemoteClose(link); } else { link.detach(); link.free(); } }
@Override public void detach() { if (!closed) { if (getEndpoint() != null) { getEndpoint().setContext(null); getEndpoint().detach(); getEndpoint().free(); } } }
@Override public void onRemoteDetach(Link link) throws Exception { boolean handleAsClose = link.getSource() != null && ((Source) link.getSource()).getExpiryPolicy() == TerminusExpiryPolicy.LINK_DETACH; if (handleAsClose) { onRemoteClose(link); } else { lock(); try { link.detach(); link.free(); } finally { unlock(); } } }
event.getLink().free();