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 0 : 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 0 : const std::string &socketGroup)
32 0 : : m_sessionServerAppManager{common::createSessionServerAppManager(m_ipcController, stateObserver,
33 : environmentVariables, sessionServerPath,
34 : sessionServerStartupTimeout, healthcheckInterval,
35 : numOfFailedPingsBeforeRecovery, socketPermissions,
36 : socketOwner, socketGroup)},
37 0 : m_ipcController{ipc::create(m_sessionServerAppManager)}
38 : {
39 0 : }
40 :
41 0 : common::ISessionServerAppManager &ServiceContext::getSessionServerAppManager()
42 : {
43 0 : return *m_sessionServerAppManager;
44 : }
45 : } // namespace rialto::servermanager::service
|