Instantly share code, notes, and snippets.

Embed
What would you like to do?
@PostConstruct
public void initHandlerMap() {
BeanManager beanManager = BeanManagerProvider.retrieve();
Set<Bean<?>> allHandlers = beanManager.getBeans(CommandHandler.class);
for (Bean<?> bean : allHandlers) {
Class<?> handlerClass = bean.getBeanClass();
handlers.put(getHandledCommandType(handlerClass), bean.getName());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment