| 364 | } |
| 365 | |
| 366 | void |
| 367 | FrameworkPrivate::StopAllBundles() |
| 368 | { |
| 369 | // Stop all active bundles, in reverse bundle ID order |
| 370 | auto activeBundles = coreCtx->bundleRegistry.GetActiveBundles(); |
| 371 | for (auto iter = activeBundles.rbegin(); iter != activeBundles.rend(); ++iter) |
| 372 | { |
| 373 | auto b = *iter; |
| 374 | try |
| 375 | { |
| 376 | if (((Bundle::STATE_ACTIVE | Bundle::STATE_STARTING) & b->state) != 0) |
| 377 | { |
| 378 | // Stop bundle without changing its autostart setting. |
| 379 | b->Stop(Bundle::StopOptions::STOP_TRANSIENT); |
| 380 | } |
| 381 | } |
| 382 | catch (...) |
| 383 | { |
| 384 | coreCtx->listeners.SendFrameworkEvent( |
| 385 | FrameworkEvent(FrameworkEvent(FrameworkEvent::Type::FRAMEWORK_ERROR, |
| 386 | MakeBundle(b), |
| 387 | std::string(), |
| 388 | std::current_exception()))); |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | auto allBundles = coreCtx->bundleRegistry.GetBundles(); |
| 393 | |
| 394 | // Set state to BUNDLE_INSTALLED |
| 395 | for (auto b : allBundles) |
| 396 | { |
| 397 | if (b->id != 0) |
| 398 | { |
| 399 | auto l = coreCtx->resolver.Lock(); |
| 400 | US_UNUSED(l); |
| 401 | b->SetStateInstalled(false); |
| 402 | } |
| 403 | } |
| 404 | } |
| 405 | |
| 406 | void |
| 407 | FrameworkPrivate::SystemShuttingdownDone_unlocked(FrameworkEventInternal const& fe) |
nothing calls this directly
no test coverage detected