/** * This will construct a Spring context for this Microserver instance. * The calling class will be used to determine the base package to auto-scan from for Spring Beans * It will attempt to pick up an @Microservice annotation first, if not present the package of the calling class * will be used. * * @param modules Multiple Microservice end points that can be deployed within a single Spring context */ public MicroserverApp(Module... modules) { this.modules = ListX.of(modules); GlobalState.state.setModules(this.modules); initSpringProperties(modules[0]); Class c = extractClass(); springContext = new SpringContextFactory( new MicroserverConfigurer().buildConfig(c), extractClass(), modules[0].getSpringConfigurationClasses()).createSpringContext(); classes=null; }
/** * This will construct a Spring context for this Microserver instance. * The calling class will be used to determine the base package to auto-scan from for Spring Beans * It will attempt to pick up an @Microservice annotation first, if not present the package of the calling class * will be used. * * @param modules Multiple Microservice end points that can be deployed within a single Spring context */ public MicroserverApp(Module... modules) { this.modules = ListX.of(modules); GlobalState.state.setModules(this.modules); initSpringProperties(modules[0]); Class c = extractClass(); springContext = new SpringContextFactory( new MicroserverConfigurer().buildConfig(c), extractClass(), modules[0].getSpringConfigurationClasses()).createSpringContext(); classes=null; }