@Override public <T, U> Connection handler(Class<T> type, MessageHandler<T, U> handler) { Assert.notNull(type, "type"); if (handler != null) { handlers.put(type, new HandlerHolder(handler, ThreadContext.currentContextOrThrow())); } else { handlers.remove(type); } return this; }