Examples of findCandidateComponents()


Examples of org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents()

    provider.addIncludeFilter(new RegexPatternTypeFilter(pattern));

    Set<BeanDefinition> definitions = new HashSet<BeanDefinition>();

    for (String basePackage : basePackages) {
      definitions.addAll(provider.findCandidateComponents(basePackage));
    }

    if (definitions.isEmpty()) {
      return null;
    }
View Full Code Here

Examples of org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents()

  private boolean multipleStoresDetected() {

    ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false,
        environment);
    scanner.addIncludeFilter(new LenientAssignableTypeFilter(RepositoryFactorySupport.class));
    int numberOfModulesFound = scanner.findCandidateComponents(MODULE_DETECTION_PACKAGE).size();

    if (numberOfModulesFound > 1) {
      LOGGER.debug(MULTIPLE_MODULES);
      return true;
    }
View Full Code Here

Examples of org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents()

    Set<Class<?>> types = new HashSet<Class<?>>();

    for (String basePackage : basePackages) {

      for (BeanDefinition definition : provider.findCandidateComponents(basePackage)) {
        try {
          types.add(ClassUtils.forName(definition.getBeanClassName(), getClass().getClassLoader()));
        } catch (ClassNotFoundException o_O) {
          throw new IllegalStateException(o_O);
        }
View Full Code Here

Examples of org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents()

    if (StringUtils.hasText(basePackage)) {
      ClassPathScanningCandidateComponentProvider componentProvider = new ClassPathScanningCandidateComponentProvider(false);
      componentProvider.addIncludeFilter(new AnnotationTypeFilter(Document.class));
      componentProvider.addIncludeFilter(new AnnotationTypeFilter(Persistent.class));
      for (BeanDefinition candidate : componentProvider.findCandidateComponents(basePackage)) {
        initialEntitySet.add(ClassUtils.forName(candidate.getBeanClassName(), AbstractCouchbaseConfiguration.class.getClassLoader()));
      }
    }

    return initialEntitySet;
View Full Code Here

Examples of org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents()

                this.logger.info("Scanning package [" + basePackage + "]");
            }
            ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
            scanner.addIncludeFilter(new AnnotationTypeFilter(com.googlecode.objectify.annotation.Entity.class));
            scanner.addIncludeFilter(new AnnotationTypeFilter(javax.persistence.Entity.class));
            Set<BeanDefinition> candidates = scanner.findCandidateComponents(basePackage);
            for (BeanDefinition candidate : candidates) {
                Class<?> clazz = ClassUtils.resolveClassName(candidate.getBeanClassName(), ClassUtils.getDefaultClassLoader());
                classes.add(clazz);
            }           
        }
View Full Code Here

Examples of org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents()

      String pack = complString.replaceAll("[.]", "/");
      if (pack.endsWith("/")) {
        pack = pack.substring(0, pack.length() - 1);
      }
      Set<BeanDefinition> components = provider.findCandidateComponents(pack);
      for (BeanDefinition component : components) {
        String beanClassName = component.getBeanClassName();
        engines.add(beanClassName);
      }
      for (String string : engines) {
View Full Code Here

Examples of org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents()

  public Set<Class<?>> scan(String packageRoot, Class<? extends Annotation> anno) {
    ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);

    AnnotationTypeFilter filter = new AnnotationTypeFilter(anno);
    scanner.addIncludeFilter(filter);
    Set<BeanDefinition> beanSet = scanner.findCandidateComponents(packageRoot);

    Set<Class<?>> classSet = new HashSet<Class<?>>();
    for (BeanDefinition beanDef : beanSet) {
      logger.debug("found candidate bean = " + beanDef.getBeanClassName());
View Full Code Here

Examples of org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents()

        ClassPathScanningCandidateComponentProvider provider = new ClassPathScanningCandidateComponentProvider(true);
        provider.addIncludeFilter(new AssignableTypeFilter(Object.class));

        Set<BeanDefinition> beans = new HashSet<>();
        for (String packageName : packagesContainingBeans) {
            beans.addAll(provider.findCandidateComponents(packageName));
        }

        return beans;
    }
View Full Code Here

Examples of org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents()

    @Override
    public void cleanupStaleData() throws Exception {
        ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false);
        scanner.addIncludeFilter(new AnnotationTypeFilter(Entity.class));

        Set<BeanDefinition> components = scanner.findCandidateComponents("org.fluxtream");
        for (BeanDefinition component : components) {
            Class cls = Class.forName(component.getBeanClassName());
            final String entityName = JPAUtils.getEntityName(cls);
            System.out.println("cleaning up " + entityName + "...");
            if (entityName.startsWith("Facet_")) {
View Full Code Here

Examples of org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents()

      new ClassPathScanningCandidateComponentProvider(false);
    scanner.addIncludeFilter(new AnnotationTypeFilter(XmlRootElement.class));
   
    List<Class<?>> classes = new ArrayList<Class<?>>();
    for (String basePackage : basePackages) {
      Set<BeanDefinition> definitions = scanner.findCandidateComponents(basePackage);
      for (BeanDefinition definition : definitions) {
        String className = definition.getBeanClassName();
        log.info("Found class: {}", className);
        classes.add(Class.forName(className));
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.