MCPcopy Create free account
hub / github.com/CppMicroServices/CppMicroServices / Shutdown0

Method Shutdown0

framework/src/util/FrameworkPrivate.cpp:308–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306 }
307
308 void
309 FrameworkPrivate::Shutdown0(bool restart, bool wasActive)
310 {
311 try
312 {
313 {
314 auto l = Lock();
315 US_UNUSED(l);
316 operation = OP_DEACTIVATING;
317 state = Bundle::STATE_STOPPING;
318 }
319 coreCtx->listeners.BundleChanged(
320 BundleEvent(BundleEvent::BUNDLE_STOPPING, MakeBundle(this->shared_from_this())));
321
322 coreCtx->SetFrameworkStoppedState(true);
323
324 if (wasActive)
325 {
326 StopAllBundles();
327 }
328 coreCtx->Uninit0();
329
330 {
331 auto l = Lock();
332 US_UNUSED(l);
333 coreCtx->Uninit1();
334 ShutdownDone_unlocked(restart);
335 }
336 if (restart)
337 {
338 if (wasActive)
339 {
340 Start(0);
341 }
342 else
343 {
344 Init();
345 }
346 }
347 }
348 catch (...)
349 {
350 auto l = Lock();
351 US_UNUSED(l);
352 SystemShuttingdownDone_unlocked(FrameworkEventInternal { true,
353 FrameworkEvent::Type::FRAMEWORK_ERROR,
354 std::string(),
355 std::current_exception() });
356 }
357 }
358
359 void
360 FrameworkPrivate::ShutdownDone_unlocked(bool restart)

Callers

nothing calls this directly

Calls 9

LockFunction · 0.85
MakeBundleFunction · 0.85
shared_from_thisMethod · 0.80
Uninit0Method · 0.80
Uninit1Method · 0.80
BundleEventClass · 0.50
StartFunction · 0.50
BundleChangedMethod · 0.45

Tested by

no test coverage detected