Source:
public void terminate(@Nonnull IOException e) { logger.log(Level.WARNING, "Attempting to terminate channel"); if (e == null) { throw new IllegalArgumentException("Cause is null. Channel cannot be closed properly in such case"); } closeRequested = true; if (closeRequestCause == null) { closeRequestCause = e; } try { synchronized (this) { outClosed = inClosed = e; RemoteInvocationHandler.notifyChannelTermination(this); try { transport.closeRead(); } catch (IOException x) { logger.log(Level.WARNING, "Failed to close down the reader side of the transport", x); } try { logger.log(Level.WARNING, "Clearing pending calls"); synchronized (pendingCalls) { for (Request<?, ?> req : pendingCalls.values()) req.abort(e); pendingCalls.clear(); } logger.log(Level.WARNING, "Clearing executing calls"); synchronized (executingCalls) { for (Request<?, ?> r : executingCalls.values()) { java.util.concurrent.Future<?> f = r.future; if (f != null) f.cancel(true); } executingCalls.clear(); } logger.log(Level.WARNING, "Aborting exported objects"); exportedObjects.abort(e); logger.log(Level.WARNING, "Clearing reference"); reference.clear(e); logger.log(Level.WARNING, "Successfully terminated channel, still need to notify listeners"); } catch (Throwable t) { logger.log(Level.WARNING, "Caught error while terminating channel", t); throw t; } finally { notifyAll(); } } } finally { if (e instanceof OrderlyShutdown) e = null; for (Listener l : listeners) { try { l.onClosed(this, e); } catch (Throwable t) { LogRecord lr = new LogRecord(Level.SEVERE, "Listener {0} propagated an exception for channel {1}'s close: {2}"); lr.setThrown(t); lr.setParameters(new Object[]{l, this, t.getMessage()}); logger.log(lr); } } } }

Target:
public void terminate(@Nonnull IOException e) { logger.log(Level.WARNING, "Attempting to terminate channel " + getName()); if (e == null) { throw new IllegalArgumentException("Cause is null. Channel cannot be closed properly in such case"); } closeRequested = true; if (closeRequestCause == null) { closeRequestCause = e; } try { synchronized (this) { outClosed = inClosed = e; RemoteInvocationHandler.notifyChannelTermination(this); try { transport.closeRead(); } catch (IOException x) { logger.log(Level.WARNING, "Failed to close down the reader side of the transport", x); } try { logger.log(Level.WARNING, "Clearing pending calls in " + getName()); synchronized (pendingCalls) { for (Request<?, ?> req : pendingCalls.values()) req.abort(e); pendingCalls.clear(); } logger.log(Level.WARNING, "Clearing executing calls in " + getName()); synchronized (executingCalls) { for (Request<?, ?> r : executingCalls.values()) { java.util.concurrent.Future<?> f = r.future; if (f != null) f.cancel(true); } executingCalls.clear(); } logger.log(Level.WARNING, "Aborting exported objects in " + getName()); exportedObjects.abort(e); logger.log(Level.WARNING, "Clearing reference in " + getName()); reference.clear(e); logger.log(Level.WARNING, "Successfully terminated channel " + getName() + ", still need to notify listeners"); } catch (Throwable t) { logger.log(Level.SEVERE, "Caught error while terminating channel " + getName(), t); throw t; } finally { notifyAll(); } } } finally { if (e instanceof OrderlyShutdown) e = null; for (Listener l : listeners) { try { l.onClosed(this, e); } catch (Throwable t) { LogRecord lr = new LogRecord(Level.SEVERE, "Listener {0} propagated an exception for channel {1}'s close: {2}"); lr.setThrown(t); lr.setParameters(new Object[]{l, this, t.getMessage()}); logger.log(lr); } } } }