@Override public void onRemoteClose(Link link) throws Exception { link.close(); ProtonDeliveryHandler linkContext = (ProtonDeliveryHandler) link.getContext(); if (linkContext != null) { linkContext.close(true); } }
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 processLinkClose(Link link) throws Exception { Object context = link.getContext(); if (context instanceof AmqpLink) { ((AmqpLink) context).close();; } else { link.close(); link.free(); } }
for(Link link : links) link.close();
@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 T close() { link.close(); getSession().getConnectionImpl().flush(); return self(); }
@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 onLinkRemoteDetach(Event event) { final Link link = event.getLink(); if(link != null) { TRACE_LOGGER.debug("link remote detach. linkName:{}", link.getName()); if (link.getLocalState() != EndpointState.CLOSED) { link.close(); } this.processOnClose(link, link.getRemoteCondition()); closeSession(link); } }
@Override public void onLinkRemoteClose(Event event) { final Link link = event.getLink(); if(link != null) { TRACE_LOGGER.debug("link remote close. linkName:{}", link.getName()); if (link.getLocalState() != EndpointState.CLOSED) { link.close(); } ErrorCondition condition = link.getRemoteCondition(); this.processOnClose(link, condition); closeSession(link); } }
@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 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); } }
private void handleRemoteLinkClosed(final Event event) { final Link link = event.getLink(); final ErrorCondition condition = link.getRemoteCondition(); if (link.getLocalState() != EndpointState.CLOSED) { link.setCondition(condition); link.close(); } this.processOnClose(link, condition); this.closeSession(link, condition); } }
link.close(); closedLinks.add(link);
if (link.getLocalState() != EndpointState.CLOSED) { link.setCondition(errorCondition); link.close();
event.getLink().close(); event.getLink().free();