@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
if (!(bean instanceof SagaInstance)) {
for (Method method : bean.getClass().getMethods()) {
EventListener listenerAnnotation = method.getAnnotation(EventListener.class);
if (listenerAnnotation == null) {
continue;
}
Class<?> eventType = method.getParameterTypes()[0];
if (listenerAnnotation.asynchronous()){
//TODO just a temporary fake impl
EventHandler handler = new AsynchronousEventHandler(eventType, beanName, method, beanFactory);
//TODO add to some queue
eventPublisher.registerEventHandler(handler);
}