public ErrorCondition getRemoteError() { return getEndpoint().getRemoteCondition(); }
protected boolean hasRemoteError() { return getEndpoint().getRemoteCondition().getCondition() != null; }
public boolean hasRemoteError() { return getEndpoint().getRemoteCondition().getCondition() != null; }
protected boolean hasRemoteError() { return getEndpoint().getRemoteCondition().getCondition() != null; }
@Override public void remotelyClosed(AmqpConnection connection) { Exception error = AmqpSupport.convertToException(getEndpoint().getRemoteCondition()); if (endpoint != null) { // TODO: if this is a producer/consumer link then we may only be detached, // rather than fully closed, and should respond appropriately. endpoint.close(); } LOG.info("Resource {} was remotely closed", this); connection.fireClientException(error); }
@Override public boolean execute() { if (getEndpoint().getRemoteState() == EndpointState.CLOSED) { cb.onSuccess(getEndpoint().getRemoteCondition()); return true; } return false; } });
@Override public void processRemoteClose(AmqpConnection connection) throws IOException { doClosedInspection(); if (isAwaitingClose()) { LOG.debug("{} is now closed: ", this); closed(); } else if (isAwaitingOpen()) { // Error on Open, create exception and signal failure. LOG.warn("Open of {} failed: ", this); Exception openError; if (hasRemoteError()) { openError = AmqpSupport.convertToException(getEndpoint().getRemoteCondition()); } else { openError = getOpenAbortException(); } failed(openError); } else { remotelyClosed(connection); } }
@Override public void processRemoteClose(AmqpProvider provider) throws IOException { getResourceInfo().setState(ResourceState.REMOTELY_CLOSED); if (isAwaitingClose()) { closeResource(provider, null, true); // Close was expected so ignore any endpoint errors. } else { closeResource(provider, AmqpSupport.convertToException(provider, getEndpoint(), getEndpoint().getRemoteCondition()), true); } }
@Override public void processRemoteClose(AmqpProvider provider) throws IOException { getResourceInfo().setState(ResourceState.REMOTELY_CLOSED); if (isAwaitingClose()) { closeResource(provider, null, true); // Close was expected so ignore any endpoint errors. } else { closeResource(provider, AmqpSupport.convertToException(provider, getEndpoint(), getEndpoint().getRemoteCondition()), true); } }
protected final void handleClosed(AmqpProvider provider, Throwable cause) { // If the resource being built is closed during the creation process // then this is always an error. resourceInfo.setState(ResourceState.REMOTELY_CLOSED); // Perform any post processing relating to closure during creation attempt afterClosed(getResource(), getResourceInfo()); Throwable openError; if (hasRemoteError()) { openError = AmqpSupport.convertToException(parent.getProvider(), getEndpoint(), getEndpoint().getRemoteCondition()); } else if (cause != null) { openError = cause; } else { openError = getOpenAbortException(); } if (requestTimeoutTask != null) { requestTimeoutTask.cancel(false); } LOG.warn("Open of resource:({}) failed: {}", resourceInfo, openError.getMessage()); // This resource is now terminated. getEndpoint().close(); getEndpoint().free(); getEndpoint().setContext(null); getRequest().onFailure(openError); }
protected final void handleClosed(AmqpProvider provider, Throwable cause) { // If the resource being built is closed during the creation process // then this is always an error. resourceInfo.setState(ResourceState.REMOTELY_CLOSED); // Perform any post processing relating to closure during creation attempt afterClosed(getResource(), getResourceInfo()); Throwable openError; if (hasRemoteError()) { openError = AmqpSupport.convertToException(parent.getProvider(), getEndpoint(), getEndpoint().getRemoteCondition()); } else if (cause != null) { openError = cause; } else { openError = getOpenAbortException(); } if (requestTimeoutTask != null) { requestTimeoutTask.cancel(false); } LOG.warn("Open of resource:({}) failed: {}", resourceInfo, openError.getMessage()); // This resource is now terminated. getEndpoint().close(); getEndpoint().free(); getEndpoint().setContext(null); getRequest().onFailure(openError); }