closeAction(); } catch (IOException e) { log.tracef(e, "Close of %s failed", this); final IOException clone = clone(failure); if (failure != clone) { SpiUtils.glueStackTraces(failure, Thread.currentThread().getStackTrace(), 1, "asynchronous close");
public void close() { try { super.close(); } catch (IOException e) { throw new IllegalStateException(e); } }
/** * Finalize this closeable instance. If the instance hasn't been closed, it is closed and a warning is logged. */ protected void finalize() throws Throwable { try { super.finalize(); } finally { if (autoClose && isOpen()) { if (LEAK_DEBUGGING) { final Throwable t = new LeakThrowable(); t.setStackTrace(backtrace); log.warnf(t, "Leaked a %s instance: %s", getClass().getName(), this); } else { log.tracef("Leaked a %s instance: %s", getClass().getName(), this); } closeAsync(); } } }
closeAction(); } catch (IOException e) { log.tracef(e, "Close of %s failed", this); runCloseTask(new CloseHandlerTask(handler, e)); runCloseTask(new CloseHandlerTask(handler, new IOException(t)));
runCloseTask(new CloseHandlerTask(handler, cause));
/** * Called exactly once when the {@code close()} method is invoked; the actual close operation should take place here. * This method <b>must</b> call {@link #closeComplete()}, directly or indirectly, for the close operation to finish * (it may happen in another thread but it must happen). * * This method should not expect the {@link #closeComplete()} call to be made from another thread from the same thread pool * that may cause {@link #close()}. As close will block, this can result in situations where all threads in the pool are * blocked on {@link #close()} method calls, which means the {@link #closeComplete()} will never be run. * * @throws RemotingException if the close failed */ protected void closeAction() throws IOException { closeComplete(); }
protected Executor getExecutor() { return super.getExecutor(); }
closeAction(); } catch (IOException e) { log.tracef(e, "Close of %s failed", this); runCloseTask(new CloseHandlerTask(handler, e)); runCloseTask(new CloseHandlerTask(handler, new IOException(t)));
/** * {@inheritDoc} */ public Key addCloseHandler(final CloseHandler<? super T> handler) { Assert.checkNotNullParam("handler", handler); synchronized (closeLock) { if (state == State.OPEN || state == State.CLOSING) { final Key key = new KeyImpl<T>(this); final Map<Key, CloseHandler<? super T>> closeHandlers = this.closeHandlers; if (closeHandlers == null) { final IdentityHashMap<Key, CloseHandler<? super T>> newMap = new IdentityHashMap<Key, CloseHandler<? super T>>(); this.closeHandlers = newMap; newMap.put(key, handler); } else { closeHandlers.put(key, handler); } return key; } } runCloseTask(new CloseHandlerTask(handler, null)); return new NullKey(); }
protected void closeComplete() { try { super.closeComplete(); } finally { if (server != null && objectName != null) { try { server.unregisterMBean(objectName); } catch (Throwable ignored) { } } } }
protected Executor getExecutor() { return super.getExecutor(); }
/** * Finalize this closeable instance. If the instance hasn't been closed, it is closed and a warning is logged. */ protected void finalize() throws Throwable { try { super.finalize(); } finally { if (autoClose && isOpen()) { if (LEAK_DEBUGGING) { final Throwable t = new LeakThrowable(); t.setStackTrace(backtrace); log.warnf(t, "Leaked a %s instance: %s", getClass().getName(), this); } else { log.tracef("Leaked a %s instance: %s", getClass().getName(), this); } closeAsync(); } } }
closeAction(); } catch (IOException e) { log.tracef(e, "Close of %s failed", this); runCloseTask(new CloseHandlerTask(handler, e));
closeAction(); } catch (IOException e) { log.tracef(e, "Close of %s failed", this); final IOException clone = clone(failure); if (failure != clone) { SpiUtils.glueStackTraces(failure, Thread.currentThread().getStackTrace(), 1, "asynchronous close");
runCloseTask(new CloseHandlerTask(handler, null));
/** * Make this method visible. */ protected void closeComplete() { super.closeComplete(); remoteConnection.getRemoteConnectionProvider().removeConnectionHandler(this); }
public void close() { try { super.close(); } catch (IOException e) { throw new IllegalStateException(e); } }
protected Executor getExecutor() { return super.getExecutor(); }
/** * Finalize this closeable instance. If the instance hasn't been closed, it is closed and a warning is logged. */ protected void finalize() throws Throwable { try { super.finalize(); } finally { if (autoClose && isOpen()) { if (LEAK_DEBUGGING) { final Throwable t = new LeakThrowable(); t.setStackTrace(backtrace); log.warnf(t, "Leaked a %s instance: %s", getClass().getName(), this); } else { log.tracef("Leaked a %s instance: %s", getClass().getName(), this); } closeAsync(); } } }
closeAction(); } catch (IOException e) { log.tracef(e, "Close of %s failed", this); final IOException clone = clone(failure); if (failure != clone) { SpiUtils.glueStackTraces(failure, Thread.currentThread().getStackTrace(), 1, "asynchronous close");