@Override public void onResponse(AmqpProtocolConverter converter, Response response) throws IOException { protonConnection.close(); protonConnection.free(); if (!closedSocket) { pumpProtonToSocket(); } } });
@Override public void onResponse(AmqpProtocolConverter converter, Response response) throws IOException { protonConnection.close(); protonConnection.free(); if (!closedSocket) { pumpProtonToSocket(); } } });
@Override public void onConnectionUnbound(Event event) { final Connection connection = event.getConnection(); if (TRACE_LOGGER.isInfoEnabled()) { TRACE_LOGGER.info(String.format(Locale.US, "onConnectionUnbound: hostname[%s], state[%s], remoteState[%s]", connection.getHostname(), connection.getLocalState(), connection.getRemoteState())); } // if failure happened while establishing transport - nothing to free up. if (connection.getRemoteState() != EndpointState.UNINITIALIZED) connection.free(); }
@Override public void onRemoteClose(Connection connection) { handler.requireHandler(); connection.close(); connection.free(); for (AMQPSessionContext protonSession : sessions.values()) { protonSession.close(); } sessions.clear(); // We must force write the channel before we actually destroy the connection handler.flushBytes(); destroy(); }
@Override public void onRemoteClose(Connection connection) { lock(); try { connection.close(); connection.free(); } finally { unlock(); } for (AMQPSessionContext protonSession : sessions.values()) { protonSession.close(); } sessions.clear(); // We must force write the channel before we actually destroy the connection handler.flushBytes(); destroy(); }
@Override public void onConnectionLocalClose(Event event) { Connection connection = event.getConnection(); TRACE_LOGGER.debug("onConnectionLocalClose: hostname:{}", connection.getHostname()); if(connection.getRemoteState() == EndpointState.CLOSED) { // Service closed it first. In some such cases transport is not unbound and causing a leak. if(connection.getTransport() != null) { connection.getTransport().unbind(); } connection.free(); } } }
@Override public void onConnectionRemoteClose(Event event) { final Connection connection = event.getConnection(); final ErrorCondition error = connection.getRemoteCondition(); TRACE_LOGGER.debug("onConnectionRemoteClose: hostname:{},errorCondition:{}", connection.getHostname(), error != null ? error.getCondition() + "," + error.getDescription() : null); boolean shouldFreeConnection = connection.getLocalState() == EndpointState.CLOSED; this.messagingFactory.onConnectionError(error); if(shouldFreeConnection) { connection.free(); } }
@Override public void onTransportError(Event event) { ErrorCondition condition = event.getTransport().getCondition(); if (condition != null) { TRACE_LOGGER.warn("Connection.onTransportError: hostname:{}, error:{}", event.getConnection().getHostname(), condition.getDescription()); } else { TRACE_LOGGER.warn("Connection.onTransportError: hostname:{}. error:{}", event.getConnection().getHostname(), "no description returned"); } this.messagingFactory.onConnectionError(condition); Connection connection = event.getConnection(); if(connection != null) { connection.free(); } this.notifyTransportErrors(event); }