Skip to content

Instantly share code, notes, and snippets.

@cajar1988 cajar1988/gist:7eb696a5d7b48244b003 Secret
Last active Dec 23, 2015

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