/** {@inheritDoc} */ @Override protected void onClose() throws IgniteCheckedException { U.closeQuiet(reader); } }
/** Closes wrapped connection */ @Override public void close() { U.closeQuiet(conn); } }
/** * Closes connection. * * @param conn Connection to close. */ private void closeConnection(Connection conn) { U.closeQuiet(conn); if (testMode) closed.increment(); }
/** * Interrupts a thread and closes process streams. */ @Override public void interrupt() { super.interrupt(); // Close all Process streams to free allocated resources, see http://kylecartmell.com/?p=9. U.closeQuiet(proc.getErrorStream()); U.closeQuiet(proc.getInputStream()); U.closeQuiet(proc.getOutputStream()); } }
/** {@inheritDoc} */ @Override public void close() { U.closeQuiet(in); U.closeQuiet(out); stopChecker(); }
/** {@inheritDoc} */ @Override public void onTimeout() { if (done.compareAndSet(false, true)) { // Close socket - timeout occurred. if (obj instanceof GridCommunicationClient) ((GridCommunicationClient)obj).forceClose(); else U.closeQuiet((AbstractInterruptibleChannel)obj); } }
/** {@inheritDoc} */ @Override public void stop() { if (ldr instanceof LifecycleAware) ((LifecycleAware)ldr).stop(); else if (ldr instanceof Closeable) U.closeQuiet((Closeable)ldr); if (writer instanceof LifecycleAware) ((LifecycleAware)writer).stop(); else if (writer instanceof Closeable) U.closeQuiet((Closeable)writer); }
/** * Closes the test client. */ @Override public void close() { U.closeQuiet(sock); } }
/** {@inheritDoc} */ @Override public void brakeConnection() { SocketStream sockStream = msgWorker.currSock; if (sockStream != null) U.closeQuiet(sockStream.socket()); }
/** * Handle drop. */ void onDrop() { tbl.destroy(); U.closeQuiet(luceneIdx); } }
/** * Closes allocated resources depending on transaction status. * * @param conn Allocated connection. * @param st Created statement, */ protected void end(@Nullable Connection conn, @Nullable Statement st) { U.closeQuiet(st); closeConnection(conn); }
/** Closes file channel */ @Override public void close() { release(); U.closeQuiet(lockFile); }
/** {@inheritDoc} */ @Override protected void cleanup() { super.cleanup(); U.closeQuiet(sock); synchronized (mux) { readers.remove(this); } spi.stats.onSocketReaderRemoved(); }
@Override public IgfsCreateResult onFailure(@Nullable Exception err) throws IgniteCheckedException { U.closeQuiet(outT1.get()); U.error(log, "File append in DUAL mode failed [path=" + path + ", bufferSize=" + bufSize + ']', err); throw new IgniteCheckedException("Failed to append to the file due to secondary file " + "system exception: " + path, err); } };
@Override public Object call() throws Exception { FileSystem fs = q.poll(); try { // Check that client is again operational. assertTrue(fs.mkdirs(new Path("igfs:///" + Thread.currentThread().getName()))); return true; } finally { U.closeQuiet(fs); } } }, nClients, "test-client");
/** * Stops watchdog threads. */ public void stop() { U.closeQuiet(txtWriter); ScheduledExecutorService pool = this.svc; stopPool(pool); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { try { HadoopIgfsUtils.clear(fs); } catch (Exception ignore) { // No-op. } U.closeQuiet(fs); }
/** * 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); } }
/** {@inheritDoc} */ @Override public void close() throws Exception { U.closeQuiet(inputSock); U.interrupt(mainThread); U.join(mainThread, log); }
/** {@inheritDoc} */ @Override protected void afterTest() throws Exception { U.closeQuiet(conn); ignite(0).cache(DEFAULT_CACHE_NAME).clear(); super.afterTest(); }