public void waitAndResponse(MessageHandler handler) {
		while (true) {
			if (messageResponse.size() > 0) {
				synchronized (this) {
					for (String id : messageResponse.keySet()) {
						MessageAdaptor response = handler
								.handle(messageResponse.remove(id));
						messageSource.add(response);
					}
				}
				synchronized (publisher) {
					if (publisher.getState() == State.WAITING) {
						logger.info(String.format("Notify publisher %d.",
								publisher.getId()));
						publisher.notify();
					}
				}
			}
		}
	}