Package org.springframework.context.annotation

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


public class Spr8955Tests {

  @Test
  public void repro() {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
    ctx.scan("org.springframework.context.annotation.configuration.spr8955");
    ctx.refresh();
  }

}
View Full Code Here


      this.basePackages = basePackages;
    }
    @Override
    public void onApplicationEvent(ApplicationPreparedEvent event) {
      AnnotationConfigApplicationContext context = (AnnotationConfigApplicationContext)event.getApplicationContext();
      context.scan(basePackages);
    }
  }
}
View Full Code Here

        if (classes.length > 0) {
            AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(classes);

            if (packages.length > 0) {
                applicationContext.scan(packages);
                applicationContext.refresh();
            }

            return applicationContext;
View Full Code Here

    @Override
    public AnnotationConfigApplicationContext createApplicationContext() {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();
        context.getBeanFactory().registerSingleton("applicationContextFactory", this);
        context.scan("be.bagofwords");
        return context;
    }

    @Override
    public String getApplicationName() {
View Full Code Here

    }
    else {
      Assert.notEmpty(basePackages, "'basePackages' or 'configLocations' must be specified"
        + " to construct and configure an instance of the ConfigurableApplicationContext.");
      AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
      applicationContext.scan(basePackages);
      return applicationContext;
    }
  }

  /**
 
View Full Code Here

      for (final Class<?> c : configurationClasses) {
        ctx.register(c);
      }
    if (ArrayUtils.isNotEmpty(configurationPackages)) {
      for (final Package p : configurationPackages) {
        ctx.scan(p.getName());
      }
    }

    ctx.refresh();
    ctx.registerShutdownHook();
View Full Code Here

public class MainWindow extends JFrame
{
   public MainWindow()
   {
      AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
      ctx.scan("demo");
      ctx.refresh();

      add(ctx.getBean(MainContainer.class));
      setSize(800, 600);
   }
View Full Code Here

      }
      LogUtil.info(getClass(), logMsg);
    }

    AnnotationConfigApplicationContext springContext = new AnnotationConfigApplicationContext();
    springContext.scan("org.openbp.server");
    for (int i = 0; i < configClasses.length; ++i)
    {
      springContext.register(configClasses[i]);
    }
    springContext.refresh();
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.