/** * Remove the handler from the internal handler Set. * * @return the result of {@link Set#remove(Object)} */ @Override public synchronized boolean removeHandler(MessageHandler handler) { Assert.notNull(handler, "handler must not be null"); boolean removed = this.handlers.remove(handler); if (this.handlers.size() == 1) { this.theOneHandler = this.handlers.iterator().next(); } else { this.theOneHandler = null; } return removed; }
/** * Remove the handler from the internal handler Set. * * @return the result of {@link Set#remove(Object)} */ @Override public synchronized boolean removeHandler(MessageHandler handler) { Assert.notNull(handler, "handler must not be null"); boolean removed = this.handlers.remove(handler); if (this.handlers.size() == 1) { this.theOneHandler = this.handlers.iterator().next(); } else { this.theOneHandler = null; } return removed; }