List of usage examples for org.springframework.statemachine.processor StateMachineHandler getAnnotation
public Annotation getAnnotation()
From source file:org.springframework.statemachine.processor.StateMachineHandlerCallHelper.java
@SuppressWarnings("unchecked") @Override//from ww w . j a v a 2 s . co m public void afterPropertiesSet() throws Exception { if (!(beanFactory instanceof ListableBeanFactory)) { log.info("Beanfactory is not instance of ListableBeanFactory, was " + beanFactory + " thus Disabling handlers."); return; } if (beanFactory.containsBean(StateMachineHandlerApplicationListener.BEAN_NAME)) { this.stateMachineHandlerApplicationListener = beanFactory.getBean( StateMachineHandlerApplicationListener.BEAN_NAME, StateMachineHandlerApplicationListener.class); } for (StateMachineHandler<? extends Annotation, S, E> handler : beanFactory .getBeansOfType(StateMachineHandler.class).values()) { Annotation annotation = handler.getAnnotation(); Annotation metaAnnotation = handler.getMetaAnnotation(); WithStateMachine withStateMachine = AnnotationUtils.findAnnotation(handler.getBeanClass(), WithStateMachine.class); String statemachineBeanName = withStateMachine.name(); String key = metaAnnotation.annotationType().getName() + statemachineBeanName; List<CacheEntry> list = cache.get(key); if (list == null) { list = new ArrayList<>(); cache.put(key, list); } list.add(new CacheEntry(handler, annotation, metaAnnotation)); } }