/** * Closes channel. */ void close() { for (RandomAccessFile raf : rafs) U.closeQuiet(raf); } }
/** {@inheritDoc} */ @Override public void close() { U.closeQuiet(writer); U.closeQuiet(dir); }
/** {@inheritDoc} */ @Override public void close() { U.closeQuiet(clientSock); } }
/** * Closes index and releases resources. */ public void close() { if (tree instanceof Closeable) U.closeQuiet((Closeable)tree); }
/** {@inheritDoc} */ @Override protected void onClose() throws GridException { U.closeQuiet(searcher); U.closeQuiet(reader); } }
/** {@inheritDoc} */ @Override public void close(Session ses) { assert snapshot.get() == null; if (tree instanceof Closeable) U.closeQuiet((Closeable)tree); }
/** * @return {@code True} if object has not yet been canceled. */ boolean onTimeout() { if (done.compareAndSet(false, true)) { // Close socket - timeout occurred. U.closeQuiet(sock); return true; } return false; }
/** {@inheritDoc} */ @Override public boolean close() { boolean res = super.close(); if (res) { U.closeQuiet(out); U.closeQuiet(sock); } return res; }
/** * Releases snapshot for current thread. */ @Override public void releaseSnapshot() { ConcurrentNavigableMap<GridSearchRowPointer, GridH2Row> s = snapshot.get(); snapshot.remove(); if (s instanceof Closeable) U.closeQuiet((Closeable)s); }
/** {@inheritDoc} */ @Override public void interrupt() { super.interrupt(); U.closeQuiet(sock); }
/** * Closes connection. * * @param conn Connection to close. */ private void closeConnection(Connection conn) { U.closeQuiet(conn); if (testMode) closed.increment(); }
/** {@inheritDoc} */ @Override protected void cleanup() { super.cleanup(); U.closeQuiet(nextNodeSock); }
@Override public GridGgfsSecondaryOutputStreamDescriptor onFailure(@Nullable Exception err) throws GridException { U.closeQuiet(out); U.error(log, "File append in DUAL mode failed [path=" + path + ", bufferSize=" + bufSize + ']', err); if (err instanceof GridGgfsException) throw (GridGgfsException)err; else throw new GridException("Failed to append to the file due to secondary file system " + "exception: " + path, err); } };
@Override public GridGgfsSecondaryOutputStreamDescriptor onFailure(@Nullable Exception err) throws GridException { U.closeQuiet(out); U.error(log, "File append in DUAL mode failed [path=" + path + ", bufferSize=" + bufSize + ']', err); if (err instanceof GridGgfsException) throw (GridGgfsException)err; else throw new GridException("Failed to append to the file due to secondary file system " + "exception: " + path, err); } };
/** * Deletes file. * * @return Whether file was actually deleted. */ public boolean delete() { U.closeQuiet(raf); readCh.close(); return U.delete(file); }
/** * Before stop callback. */ public void beforeStop() { if (readWorker != null) readWorker.cancel(); U.closeQuiet(sock); if (readWorker != null) U.join(readWorker, log); }
/** * @param e Optional exception occurred while stopping this */ private void shutdown0(@Nullable Throwable e) { if (!isCancelled()) { if (e != null) U.error(log, "Stopping client reader due to exception: " + endpoint, e); } U.closeQuiet(out); endpoint.close(); }
/** * @param e Optional exception occurred while stopping this */ private void shutdown0(@Nullable Throwable e) { if (!isCancelled()) { if (e != null) U.error(log, "Stopping client reader due to exception: " + endpoint, e); } U.closeQuiet(out); endpoint.close(); }
/** * Final resource cleanup. */ private void onFinished() { // Second close is no-op, if closed manually. U.closeQuiet(out); endpoint.close(); // Finally, remove from queue. if (clientWorkers.unlinkx(node)) hnd.onClosed(ses); } }
/** * Final resource cleanup. */ private void onFinished() { // Second close is no-op, if closed manually. U.closeQuiet(out); endpoint.close(); // Finally, remove from queue. if (clientWorkers.unlinkx(node)) hnd.onClosed(ses); } }