protected void shutDownAckReaderConnection(Connection connection) { Connection conn = connection; // attempt to unblock the ackReader thread by shutting down the inputStream, if it was stuck // on a read try { if (conn != null && conn.getInputStream() != null) { conn.getInputStream().close(); } } catch (IOException e) { logger.warn("Unable to shutdown AckReaderThread Connection"); } catch (ConnectionDestroyedException e) { logger.info("AckReader shutting down and connection already destroyed"); } } }
@Override public InputStream getInputStream() { return getConnection().getInputStream(); }
@Override public InputStream getInputStream() { return getConnection().getInputStream(); }
/** * Attempts to send this operation's message out on the given connection * * @param cnx the connection to use when sending * @throws Exception if the send fails */ protected void attemptSend(Connection cnx) throws Exception { setMsgTransactionId(); if (logger.isTraceEnabled(LogMarker.DISTRIBUTION_BRIDGE_SERVER_VERBOSE)) { logger.trace(LogMarker.DISTRIBUTION_BRIDGE_SERVER_VERBOSE, "Sending op={} using {}", getShortClassName(), cnx); } getMessage().setComms(cnx.getSocket(), cnx.getInputStream(), cnx.getOutputStream(), cnx.getCommBuffer(), cnx.getStats()); try { sendMessage(cnx); } finally { getMessage().unsetComms(); } }
@Override protected Object attemptReadResponse(Connection cnx) throws Exception { Message msg = createResponseMessage(); if (msg != null) { msg.setComms(cnx.getSocket(), cnx.getInputStream(), cnx.getOutputStream(), cnx.getCommBuffer(), cnx.getStats()); if (msg instanceof ChunkedMessage) { try { return processResponse(cnx, msg); } finally { msg.unsetComms(); processSecureBytes(cnx, msg); } } else { try { msg.receive(); } finally { msg.unsetComms(); processSecureBytes(cnx, msg); } return processResponse(cnx, msg); } } else { return null; } }
Message msg = createResponseMessage(); if (msg != null) { msg.setComms(cnx.getSocket(), cnx.getInputStream(), cnx.getOutputStream(), ((ConnectionImpl) cnx).getCommBufferForAsyncRead(), cnx.getStats()); if (msg instanceof ChunkedMessage) {
Message msg = createResponseMessage(); if (msg != null) { msg.setComms(cnx.getSocket(), cnx.getInputStream(), cnx.getOutputStream(), cnx.getCommBuffer(), cnx.getStats()); if (msg instanceof ChunkedMessage) {
Message msg = createResponseMessage(); if (msg != null) { msg.setComms(cnx.getSocket(), cnx.getInputStream(), cnx.getOutputStream(), cnx.getCommBuffer(), cnx.getStats()); if (msg instanceof ChunkedMessage) {