public void removeCallback(String key) { // TODO remove an existing callback (if any) for bindings on key. // Be sure to close the event stream from the broadcaster. EventSource es = callbacks.remove(key); if (es != null) { es.close(); } // Done }
private static void close(final EventSource[] sources) { int i = 0; for (EventSource source : sources) { if (source.isOpen()) { assertTrue("Waiting to close a source has timed out.", source.close(1, TimeUnit.SECONDS)); // source.close(100, TimeUnit.MILLISECONDS); LOGGER.info("[<--] SOURCE " + i++ + " closed."); } } }