2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 * @file installer_main_thread.cpp
18 * @author Krzysztof Jackiewicz (k.jackiewicz@samsung.com)
22 #include "installer_main_thread.h"
23 #include <dpl/assert.h>
24 #include <dpl/wrt-dao-ro/WrtDatabase.h>
25 #include <vcore/VCore.h>
26 #include <dpl/singleton_impl.h>
27 #include <dpl/assert.h>
28 #include <installer_controller.h>
29 #include <ace_api_install.h>
31 IMPLEMENT_SINGLETON(InstallerMainThread)
33 using namespace WrtDB;
35 InstallerMainThread::InstallerMainThread() : m_attached(false) {
38 InstallerMainThread::~InstallerMainThread() {
42 void InstallerMainThread::AttachDatabases()
46 ValidationCore::AttachToThreadRW();
47 ace_return_t ret = ace_install_initialize();
48 Assert(ACE_OK == ret); // to be changed to exception in the future
49 WrtDB::WrtDatabase::attachToThreadRW();
53 void InstallerMainThread::DetachDatabases()
58 ValidationCore::DetachFromThread();
59 ace_return_t ret = ace_install_shutdown();
60 Assert(ACE_OK == ret); // to be changed to exception in the future
61 WrtDB::WrtDatabase::detachFromThread();
64 void InstallerMainThread::TouchArchitecture()
67 Logic::InstallerControllerSingleton::Instance().Touch();
70 void InstallerMainThread::TouchArchitectureOnlyInstaller()
73 Logic::InstallerControllerSingleton::Instance().Touch();