1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| @Import(AppConfig.class) @SpringBootConfiguration @EnableAutoConfiguration public class SpringBootBundleActivator implements BundleActivator {
ConfigurableApplicationContext appContext;
@Override public void start(BundleContext bundleContext) { Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader()); appContext = SpringApplication.run(SpringBootBundleActivator.class); }
@Override public void stop(BundleContext bundleContext) { SpringApplication.exit(appContext, () -> 0); } }
|