code: public static Map<String, Object> getBeansWithAnnotation(ApplicationContext appContext,
              Class<? extends Annotation> annotationType) {
          try {
              return appContext.getBeansWithAnnotation(annotationType);
          } catch (BeansException e) {
              return new HashMap<String, Object>();
          }
      }
docs: Gets all beans whose Class has the supplied Annotation type.
  
  @param appContext
  @param annotationType
  @return a Map with the matching beans, containing the bean names as keys
  and the corresponding bean instances as values