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

Method Stop

framework/src/bundle/BundlePrivate.cpp:66–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64 }
65
66 void
67 BundlePrivate::Stop(uint32_t options)
68 {
69 std::exception_ptr savedException;
70
71 {
72 auto l = this->Lock();
73 US_UNUSED(l);
74
75 if (state == Bundle::STATE_UNINSTALLED)
76 {
77 throw std::logic_error("Bundle " + symbolicName + " (location=" + location + ") is uninstalled");
78 }
79
80 if ((options & Bundle::STOP_TRANSIENT) == 0)
81 {
82 SetAutostartSetting(-1);
83 }
84 switch (static_cast<Bundle::State>(state.load()))
85 {
86 case Bundle::STATE_INSTALLED:
87 case Bundle::STATE_RESOLVED:
88 case Bundle::STATE_STOPPING:
89 case Bundle::STATE_UNINSTALLED:
90 return;
91
92 case Bundle::STATE_ACTIVE:
93 case Bundle::STATE_STARTING: // Lazy start...
94 savedException = Stop0();
95 break;
96 }
97 }
98
99 if (savedException)
100 {
101 std::rethrow_exception(savedException);
102 }
103 }
104
105 std::exception_ptr
106 BundlePrivate::Stop0()

Callers 1

Stop1Method · 0.45

Calls 1

LockMethod · 0.80

Tested by

no test coverage detected