public void stop() { if (!started.getAndSet(false)) { return; } try { long maxWait = this.getLongProperty(STOP_WAIT_TIME, DEFAULT_STOP_WAIT_TIME); boolean successful = close(true).await(maxWait); if (!successful) { throw new SocketTimeoutException("Failed to receive closure confirmation within " + maxWait + " millis"); } } catch (IOException e) { if (log.isDebugEnabled()) { log.debug(e.getClass().getSimpleName() + " while stopping client: " + e.getMessage()); } if (log.isTraceEnabled()) { log.trace("Stop exception details", e); } } }
public void stop() { if (!started.getAndSet(false)) { return; } try { long maxWait = this.getLongProperty(STOP_WAIT_TIME, DEFAULT_STOP_WAIT_TIME); boolean successful = close(true).await(maxWait); if (!successful) { throw new SocketTimeoutException("Failed to receive closure confirmation within " + maxWait + " millis"); } } catch (IOException e) { if (log.isDebugEnabled()) { log.debug(e.getClass().getSimpleName() + " while stopping client: " + e.getMessage()); } if (log.isTraceEnabled()) { log.trace("Stop exception details", e); } } finally { // clear the attributes since we close stop the client clearAttributes(); } }
@Override public void close() throws IOException { Exception err = null; try { client.close(); } catch (Exception e) { err = GenericUtils.accumulateException(err, e); } try { client.stop(); } catch (Exception e) { err = GenericUtils.accumulateException(err, e); } if (err != null) { if (err instanceof IOException) { throw (IOException) err; } else { throw new IOException(err); } } } };
@Override public void close() throws IOException { Exception err = null; try { client.close(); } catch (Exception e) { err = GenericUtils.accumulateException(err, e); } try { client.stop(); } catch (Exception e) { err = GenericUtils.accumulateException(err, e); } if (err != null) { if (err instanceof IOException) { throw (IOException) err; } else { throw new IOException(err); } } } };