* @brief Preparation for deleting the kernel. * Agents are destroyed at this point (if we own the kernel) * After calling shutdown the kernel cannot be restarted * it must be deleted. * This is separated from delete to ensure that messages * relating to system shutdown can be sent in a more stable * state (while the kernel object still exists). ***********
| 177 | * state (while the kernel object still exists). |
| 178 | *************************************************************/ |
| 179 | void Kernel::Shutdown() |
| 180 | { |
| 181 | m_bShutdown = true ; |
| 182 | |
| 183 | // Currently we have no work to do on the kernel side before |
| 184 | // disconnecting a remote connection. |
| 185 | if (!GetConnection() || GetConnection()->IsRemoteConnection()) |
| 186 | { |
| 187 | if (GetConnection()) |
| 188 | { |
| 189 | GetConnection()->CloseConnection() ; |
| 190 | } |
| 191 | |
| 192 | return ; |
| 193 | } |
| 194 | |
| 195 | AnalyzeXML response ; |
| 196 | GetConnection()->SendAgentCommand(&response, sml_Names::kCommand_Shutdown) ; |
| 197 | GetConnection()->CloseConnection() ; |
| 198 | } |
| 199 | |
| 200 | /************************************************************* |
| 201 | * @brief Delete the kernel (or our connection to the kernel) |
no test coverage detected