LCOV - code coverage report
Current view: top level - serverManager/service/source - ServiceContext.cpp (source / functions) Coverage Total Hit
Test: coverage.info Lines: 80.0 % 10 8
Test Date: 2026-09-11 17:36:12 Functions: 66.7 % 3 2

            Line data    Source code
       1              : /*
       2              :  * If not stated otherwise in this file or this component's LICENSE file the
       3              :  * following copyright and licenses apply:
       4              :  *
       5              :  * Copyright 2022 Sky UK
       6              :  *
       7              :  * Licensed under the Apache License, Version 2.0 (the "License");
       8              :  * you may not use this file except in compliance with the License.
       9              :  * You may obtain a copy of the License at
      10              :  *
      11              :  * http://www.apache.org/licenses/LICENSE-2.0
      12              :  *
      13              :  * Unless required by applicable law or agreed to in writing, software
      14              :  * distributed under the License is distributed on an "AS IS" BASIS,
      15              :  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      16              :  * See the License for the specific language governing permissions and
      17              :  * limitations under the License.
      18              :  */
      19              : 
      20              : #include "ServiceContext.h"
      21              : #include "ControllerFactory.h"
      22              : #include "SessionServerAppManagerFactory.h"
      23              : 
      24              : namespace rialto::servermanager::service
      25              : {
      26            1 : ServiceContext::ServiceContext(const std::shared_ptr<IStateObserver> &stateObserver,
      27              :                                const std::list<std::string> &environmentVariables, const std::string &sessionServerPath,
      28              :                                std::chrono::milliseconds sessionServerStartupTimeout,
      29              :                                std::chrono::seconds healthcheckInterval, unsigned numOfFailedPingsBeforeRecovery,
      30              :                                unsigned int socketPermissions, const std::string &socketOwner,
      31            1 :                                const std::string &socketGroup)
      32            1 :     : m_sessionServerAppManager{common::createSessionServerAppManager(m_ipcController, stateObserver,
      33              :                                                                       environmentVariables, sessionServerPath,
      34              :                                                                       sessionServerStartupTimeout, healthcheckInterval,
      35              :                                                                       numOfFailedPingsBeforeRecovery, socketPermissions,
      36              :                                                                       socketOwner, socketGroup)},
      37            1 :       m_ipcController{ipc::create(m_sessionServerAppManager)}
      38              : {
      39              : }
      40              : 
      41            1 : ServiceContext::~ServiceContext()
      42              : {
      43            1 :     if (m_sessionServerAppManager)
      44              :     {
      45            1 :         m_sessionServerAppManager->setShuttingDown();
      46            1 :         m_sessionServerAppManager.reset();
      47              :     }
      48              : }
      49              : 
      50            0 : common::ISessionServerAppManager &ServiceContext::getSessionServerAppManager()
      51              : {
      52            0 :     return *m_sessionServerAppManager;
      53              : }
      54              : } // namespace rialto::servermanager::service
        

Generated by: LCOV version 2.0-1