Package org.springframework.context.annotation

Examples of org.springframework.context.annotation.ClassPathBeanDefinitionScanner.scan()


    if (!ObjectUtils.isEmpty(this.basePackages)) {
      if (logger.isInfoEnabled()) {
        logger.info("Scanning base packages: [" +
            StringUtils.arrayToCommaDelimitedString(this.basePackages) + "]");
      }
      scanner.scan(this.basePackages);
    }

    String[] configLocations = getConfigLocations();
    if (configLocations != null) {
      for (String configLocation : configLocations) {
View Full Code Here


        catch (ClassNotFoundException ex) {
          if (logger.isDebugEnabled()) {
            logger.debug("Could not load class for config location [" + configLocation +
                "] - trying package scan. " + ex);
          }
          int count = scanner.scan(configLocation);
          if (logger.isInfoEnabled()) {
            if (count == 0) {
              logger.info("No annotated classes found for specified class/package [" + configLocation + "]");
            }
            else {
View Full Code Here

    if (!ObjectUtils.isEmpty(this.basePackages)) {
      if (logger.isInfoEnabled()) {
        logger.info("Scanning base packages: [" +
            StringUtils.arrayToCommaDelimitedString(this.basePackages) + "]");
      }
      scanner.scan(this.basePackages);
    }

    String[] configLocations = getConfigLocations();
    if (configLocations != null) {
      for (String configLocation : configLocations) {
View Full Code Here

        catch (ClassNotFoundException ex) {
          if (logger.isDebugEnabled()) {
            logger.debug("Could not load class for config location [" + configLocation +
                "] - trying package scan. " + ex);
          }
          int count = scanner.scan(configLocation);
          if (logger.isInfoEnabled()) {
            if (count == 0) {
              logger.info("No annotated classes found for specified class/package [" + configLocation + "]");
            }
            else {
View Full Code Here

        {
            scanner.addIncludeFilter(new AnnotationTypeFilter(GlobalFilter.class));
        }
        if (scanProxies | scanConverters | scanFilters)
        {
            scanner.scan(basePackage == null ? "" : basePackage);
        }
        else
        {
            log.warn("Scan is not required if all @RemoteProxy, @DataTransferObject and @GlobalFilter are disabled. Skipping detection");
        }
View Full Code Here

        }
        ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner((DefaultListableBeanFactory) beanFactory);
        scanner.addIncludeFilter(new AnnotationTypeFilter(Service.class));
        String[] pkgs = Constants.COMMA_SPLIT_PATTERN.split(annotationPackage);
        for (String pkg : pkgs) {
            scanner.scan(pkg);
        }
    }

    public void destroy() throws Exception {
        for (ServiceConfig<?> serviceConfig : serviceConfigs) {
View Full Code Here

  @Test
  public void withScanner() {
    DefaultListableBeanFactory bf = new DefaultListableBeanFactory();
    ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(bf);
    scanner.scan("com.example");
    for (String name : bf.getBeanDefinitionNames()) {
      //System.out.println(name);
    }
  }
View Full Code Here

      }
    });
    scanner.setScopedProxyMode(scopedProxyMode);

    // Scan twice in order to find errors in the bean definition compatibility check.
    scanner.scan(getClass().getPackage().getName());
    scanner.scan(getClass().getPackage().getName());

    context.refresh();
    return context;
  }
View Full Code Here

    });
    scanner.setScopedProxyMode(scopedProxyMode);

    // Scan twice in order to find errors in the bean definition compatibility check.
    scanner.scan(getClass().getPackage().getName());
    scanner.scan(getClass().getPackage().getName());

    context.refresh();
    return context;
  }
View Full Code Here

        return metadata;
      }
    });

    // Scan twice in order to find errors in the bean definition compatibility check.
    scanner.scan(getClass().getPackage().getName());
    scanner.scan(getClass().getPackage().getName());

    context.registerAlias("classPathBeanDefinitionScannerJsr330ScopeIntegrationTests.SessionScopedTestBean", "session");
    context.refresh();
    return context;
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.