@Override public void fireFrameworkStarted() { if (frameworkStarted) { throw new IllegalStateException("fireFrameworkStarted must not be called more than once"); } frameworkStarted = true; boolean txStarted = !TransactionHelper.isTransactionActiveOrMarkedRollback() && TransactionHelper.startTransaction(); boolean txFinished = false; try { osgi.fireFrameworkEvent(new FrameworkEvent(FrameworkEvent.STARTED, runtimeBundle, null)); txFinished = true; } finally { if (!txFinished) { TransactionHelper.setTransactionRollbackOnly(); } if (txStarted) { TransactionHelper.commitOrRollbackTransaction(); } } }
public void fireFrameworkStarted() throws BundleException { if (osgi.getSystemBundle() == null) { SystemBundleFile file; try { file = new SystemBundleFile(osgi.getWorkingDir()); } catch (IOException e) { throw new BundleException("Cannot create system bundle file", e); } osgi.setSystemBundle(new SystemBundle(osgi, file, loader)); } osgi.fireFrameworkEvent(new FrameworkEvent(FrameworkEvent.STARTED, osgi.getSystemBundle(), null)); }
private static void doStart() throws BundleException { printStartMessage(); // install system bundle first BundleFile bf; try { bf = new SystemBundleFile(home); } catch (IOException e) { throw new BundleException("Cannot create system bundle for " + home, e); } SystemBundle systemBundle = new SystemBundle(osgi, bf, loader); osgi.setSystemBundle(systemBundle); printDeploymentOrderInfo(bundleFiles); for (File f : bundleFiles) { if (!isBundle(f)) { continue; } try { install(f); } catch (IOException | BundleException | RuntimeException e) { log.error("Failed to install bundle: " + f, e); } } osgi.fireFrameworkEvent(new FrameworkEvent(FrameworkEvent.STARTED, systemBundle, null)); // osgi.fireFrameworkEvent(new // FrameworkEvent(FrameworkEvent.AFTER_START, systemBundle, null)); }