bootstrapSupplier.get().getBootstrap().deployBeans(); bootstrapSupplier.get().getBootstrap().validateBeans(); } finally {
bootstrap.deployBeans(); bootstrap.validateBeans(); bootstrap.endInitialization();
bootstrap.deployBeans(); bootstrap.validateBeans(); bootstrap.endInitialization();
bootstrap.deployBeans(); bootstrap.validateBeans(); bootstrap.endInitialization();
private void createBeanManager() { bootstrap = new WeldBootstrap(); BundleDeployment deployment = new BundleDeployment(getBundle(), bootstrap, getContextClassLoader()); BeanDeploymentArchive beanDeploymentArchive = deployment.getBeanDeploymentArchive(); pause(); String contextId = getBundle().getSymbolicName() + ":" + getBundle().getBundleId(); ExternalConfigurationBuilder configurationBuilder = new ExternalConfigurationBuilder() // Use relaxed construction by default .add(ConfigurationKey.RELAXED_CONSTRUCTION.get(), true) .add(ConfigurationKey.CONCURRENT_DEPLOYMENT.get(), false); deployment.getServices() .add(ExternalConfiguration.class, configurationBuilder.build()); bootstrap.startContainer(contextId, OsgiEnvironment.getInstance(), deployment); // Add the ProxyServices service: we rely on the BeanManager to use its annotated // types cache to discover type closures which is required for proxied beans // whose type closures span multiple bundles deployment.getServices() .add(ProxyServices.class, new OsgiProxyService( bootstrap.getManager(beanDeploymentArchive), getContextClassLoader())); bootstrap.startInitialization(); bootstrap.deployBeans(); bootstrap.validateBeans(); manager = bootstrap.getManager(beanDeploymentArchive); resume(); }
@Override public void start(final StartContext context) throws StartException { ClassLoader oldTccl = SecurityActions.getContextClassLoader(); try { for (SetupAction action : setupActions) { action.setup(null); } SecurityActions.setContextClassLoader(classLoader); bootstrap.getValue().getBootstrap().startInitialization(); bootstrap.getValue().getBootstrap().deployBeans(); bootstrap.getValue().getBootstrap().validateBeans(); bootstrap.getValue().getBootstrap().endInitialization(); } finally { for (SetupAction action : setupActions) { try { action.teardown(null); } catch (Exception e) { WeldLogger.DEPLOYMENT_LOGGER.exceptionClearingThreadState(e); } } SecurityActions.setContextClassLoader(oldTccl); } }