public void stopFramework() {
		if (felixFramework == null) {
			return;
		}

		try {
			felixFramework.stop();

			// any bundles that linger after a few seconds might be the source of subtle problems, 
			// so wait for them to stop and report any problems.
			FrameworkEvent event = felixFramework.waitForStop(5000);
			if (event.getType() == FrameworkEvent.WAIT_TIMEDOUT) {
				Msg.error(this, "Stopping OSGi framework timed-out after 5 seconds.");
			}
			felixFramework = null;
		}
		catch (BundleException | InterruptedException e) {
			Msg.error(this, "Failed to stop OSGi framework.", e);
		}
	}
Stop the OSGi framework.

<p>This may wait for up to 5 seconds for the framework to fully stop.  If that timeout 
passes an error will be logged.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/osgi/BundleHost.java