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.
16 #include "wrt-client.h"
19 #include <sys/resource.h>
20 #include <appcore-efl.h>
21 #include <appcore-common.h>
25 #include <dpl/log/log.h>
26 #include <dpl/optional_typedefs.h>
27 #include <dpl/exception.h>
28 #include <common/application_data.h>
29 #include <core_module.h>
30 #include <localization_setting.h>
31 #include <widget_deserialize_model.h>
33 #include <dpl/localization/w3c_file_localization.h>
34 #include <dpl/localization/LanguageTagsProvider.h>
35 #include "webkit/bundles/plugin_module_support.h"
37 #include "process_pool.h"
38 #include "menu_db_util.h"
39 #include "launchpad_util.h"
41 //W3C PACKAGING enviroment variable name
42 #define W3C_DEBUG_ENV_VARIABLE "DEBUG_LOAD_FINISH"
44 // window signal callback
45 const char *EDJE_SHOW_BACKWARD_SIGNAL = "show,backward,signal";
46 const std::string VIEWMODE_TYPE_FULLSCREEN = "fullscreen";
47 const std::string VIEWMODE_TYPE_MAXIMIZED = "maximized";
48 char const* const ELM_SWALLOW_CONTENT = "elm.swallow.content";
49 const char* const BUNDLE_PATH = "/usr/lib/wrt-wk2-bundles/libwrt-wk2-bundle.so";
52 const char* const DUMMY_PROCESS_PATH = "/usr/bin/wrt_launchpad_daemon_candidate";
53 static Ewk_Context* s_preparedEwkContext = NULL;
54 static WindowData* s_preparedWindowData = NULL;
55 static int app_argc = 0;
56 static char** app_argv = NULL;
58 WrtClient::WrtClient(int argc, char **argv) :
59 Application(argc, argv, "wrt-client", false),
60 DPL::TaskDecl<WrtClient>(this),
62 m_initializing(false),
67 m_returnStatus(ReturnStatus::Succeeded),
68 m_widgetState(WidgetState::WidgetState_Stopped)
71 LogDebug("App Created");
74 WrtClient::~WrtClient()
76 LogDebug("App Finished");
79 WrtClient::ReturnStatus::Type WrtClient::getReturnStatus() const
81 return m_returnStatus;
84 void WrtClient::OnStop()
86 LogInfo("Stopping Dummy Client");
89 void WrtClient::OnCreate()
92 ADD_PROFILING_POINT("OnCreate callback", "point");
96 void WrtClient::OnResume()
98 if (m_widgetState != WidgetState_Suspended) {
99 LogWarning("Widget is not suspended, resuming was skipped");
103 m_widgetState = WidgetState_Running;
106 void WrtClient::OnPause()
108 if (m_widgetState != WidgetState_Running) {
109 LogWarning("Widget is not running to be suspended");
113 m_widgetState = WidgetState_Suspended;
116 void WrtClient::OnReset(bundle *b)
119 // bundle argument is freed after OnReset() is returned
120 // So bundle duplication is needed
121 ApplicationDataSingleton::Instance().setBundle(bundle_dup(b));
123 if (true == m_initializing) {
124 LogDebug("can not handle reset event");
127 if (true == m_launched) {
128 if (m_widgetState == WidgetState_Stopped) {
129 LogError("Widget is not running to be reset");
133 m_windowData->emitSignalForUserLayout(EDJE_SHOW_BACKWARD_SIGNAL, "");
134 m_widgetState = WidgetState_Running;
136 if (true == checkArgument()) {
143 // low memory callback set
144 appcore_set_event_callback(
145 APPCORE_EVENT_LOW_MEMORY,
146 WrtClient::appcoreLowMemoryCallback,
150 void WrtClient::OnTerminate()
152 LogDebug("Wrt Shutdown now");
156 void WrtClient::showHelpAndQuit()
158 printf("Usage: wrt-client [OPTION]... [WIDGET: ID]...\n"
160 "Mandatory arguments to long options are mandatory for short "
162 " -h, --help show this help\n"
164 "launch widget with given tizen ID\n"
166 "launch widget with given tizen ID\n"
172 bool WrtClient::checkArgument()
174 std::string tizenId = getTizenIdFromArgument(m_argc, m_argv);
176 if (tizenId.empty()) {
181 LogDebug("Tizen id: " << m_tizenId);
186 std::string WrtClient::getTizenIdFromArgument(int argc, char **argv)
188 LogInfo("checkArgument");
189 std::string arg = argv[0];
195 if (arg.find("wrt-client") != std::string::npos) {
202 if (arg == "-h" || arg == "--help") {
204 } else if (arg == "-l" || arg == "--launch" ||
205 arg == "-t" || arg == "--tizen")
215 // Launch widget based on application basename
216 size_t pos = arg.find_last_of('/');
218 if (pos != std::string::npos) {
219 arg = arg.erase(0, pos + 1);
226 void WrtClient::setStep()
230 AddStep(&WrtClient::initStep);
232 setSdkLauncherDebugData();
234 AddStep(&WrtClient::launchStep);
235 AddStep(&WrtClient::shutdownStep);
237 m_initializing = true;
239 DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(NextStepEvent());
242 void WrtClient::setSdkLauncherDebugData()
244 LogDebug("setSdkLauncherDebugData");
246 /* check bundle from sdk launcher */
247 bundle *bundleFromSdkLauncher;
248 bundleFromSdkLauncher = bundle_import_from_argv(m_argc, m_argv);
249 const char *bundle_debug = bundle_get_val(bundleFromSdkLauncher, "debug");
250 const char *bundle_pid = bundle_get_val(bundleFromSdkLauncher, "pid");
251 if (bundle_debug != NULL && bundle_pid != NULL) {
252 if (strcmp(bundle_debug, "true") == 0) {
254 m_sdkLauncherPid = atoi(bundle_pid);
259 bundle_free(bundleFromSdkLauncher);
262 bool WrtClient::checkDebugMode(SDKDebugData* debugData)
264 LogError("Checking for debug mode");
267 bool debugMode = debugData->debugMode;
269 LogInfo("[DEBUG_MODE] Widget is launched in " <<
270 (debugMode ? "DEBUG" : "RETAIL") <<
273 if (debugMode == true) {
274 // In WAC widget, only test widgets can use web inspector.
276 // every launched widgets as debug mode can use it.
277 if (m_dao->getWidgetType().appType == WrtDB::APP_TYPE_WAC20) {
279 WRT::CoreModuleSingleton::Instance().developerMode();
280 //This code will be activated
281 //after WAC test certificate is used by SDK
282 //bool isTestWidget = view->m_widgetModel->IsTestWidget.Get();
285 // LogInfo("This is not WAC Test Widget");
288 if (!developerMode) {
289 LogInfo("This is not WAC Developer Mode");
297 void WrtClient::OnEventReceived(const NextStepEvent& /*event*/)
299 LogDebug("Executing next step");
303 void WrtClient::initStep()
306 if (WRT::CoreModuleSingleton::Instance().Init()) {
307 m_initialized = true;
309 m_returnStatus = ReturnStatus::Failed;
310 SwitchToStep(&WrtClient::shutdownStep);
313 // ecore_event_jobs are processed sequentially without concession to
314 // other type events. To give a chance of execute to other events,
315 // ecore_timer_add was used.
316 DPL::Event::ControllerEventHandler<NextStepEvent>::PostTimedEvent(
317 NextStepEvent(), 0.001);
320 bool WrtClient::checkWACTestCertififedWidget()
322 // WAC Waikiki Beta Release Core Specification: Widget Runtime
325 // WR-4710 The WRT MUST enable debug functions only for WAC test widgets
326 // i.e. the functions must not be usable for normal WAC widgets, even when
327 // a WAC test widget is executing.
328 ADD_PROFILING_POINT("DeveloperModeCheck", "start");
331 // A widget signed with a WAC-issued test certificate as described in
334 bool developerWidget = m_dao->isTestWidget();
335 bool developerMode = WRT::CoreModuleSingleton::Instance().developerMode();
337 LogDebug("Is WAC test widget: " << developerWidget);
338 LogDebug("Is developer Mode: " << developerMode);
340 if (developerWidget) {
341 if (!developerMode) {
342 LogError("WAC test certified developer widget is needed for " <<
346 //TODO: WR-4660 (show popup about developer widget
348 LogInfo("POPUP: THIS IS TEST WIDGET!");
351 ADD_PROFILING_POINT("DeveloperModeCheck", "stop");
355 void WrtClient::loadFinishCallback(Evas_Object* webview)
357 ADD_PROFILING_POINT("loadFinishCallback", "start");
358 SDKDebugData* debug = new SDKDebugData;
359 debug->debugMode = m_debugMode;
360 debug->pid = new unsigned long(getpid());
362 LogInfo("Post result of launch");
364 // Start inspector server, if current mode is debugger mode.
365 // In the WK2 case, ewk_view_inspector_server_start should
366 // be called after WebProcess is created.
367 if (checkDebugMode(debug)) {
369 ewk_view_inspector_server_start(m_widget->GetCurrentWebview(), 0);
370 if (debug->portnum == 0) {
371 LogWarning("Failed to get portnum");
373 LogInfo("Assigned port number for inspector : "
377 LogDebug("Debug mode is disabled");
380 //w3c packaging test debug (message on 4>)
381 const char * makeScreen = getenv(W3C_DEBUG_ENV_VARIABLE);
382 if (makeScreen != NULL && strcmp(makeScreen, "1") == 0) {
383 FILE* doutput = fdopen(4, "w");
384 fprintf(doutput, "didFinishLoadForFrameCallback: ready\n");
389 LogDebug("Launch succesfull");
392 m_initializing = false;
394 ADD_PROFILING_POINT("loadFinishCallback", "stop");
395 printf("launched\n");
400 m_returnStatus = ReturnStatus::Failed;
402 DPL::Event::ControllerEventHandler<NextStepEvent>::
403 PostEvent(NextStepEvent());
406 if (debug->debugMode) {
407 LogDebug("Send RT signal to wrt-launcher(pid: " << m_sdkLauncherPid);
409 /* send real time signal with result to wrt-launcher */
411 LogDebug("userData->portnum : " << debug->portnum);
412 sv.sival_int = debug->portnum;
416 sigqueue(m_sdkLauncherPid, SIGRTMIN, sv);
419 ApplicationDataSingleton::Instance().freeBundle();
421 LogDebug("Cleaning wrtClient launch resources...");
426 void WrtClient::progressFinishCallback()
428 m_splashScreen->stopSplashScreen();
431 void WrtClient::webkitExitCallback()
433 LogDebug("window close called, terminating app");
434 SwitchToStep(&WrtClient::shutdownStep);
435 DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(
439 void WrtClient::webCrashCallback()
441 LogError("webProcess crashed");
442 SwitchToStep(&WrtClient::shutdownStep);
443 DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(
447 void WrtClient::launchStep()
449 ADD_PROFILING_POINT("launchStep", "start");
450 LogDebug("Launching widget ...");
452 ADD_PROFILING_POINT("getRunnableWidgetObject", "start");
453 m_widget = WRT::CoreModuleSingleton::Instance()
454 .getRunnableWidgetObject(m_tizenId);
455 ADD_PROFILING_POINT("getRunnableWidgetObject", "stop");
458 LogError("RunnableWidgetObject is NULL, stop launchStep");
459 DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(
464 if (m_widgetState == WidgetState_Running) {
465 LogWarning("Widget already running, stop launchStep");
466 DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(
471 if (m_widgetState == WidgetState_Authorizing) {
472 LogWarning("Widget already authorizing, stop launchStep");
473 DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(
478 m_dao.reset(new WrtDB::WidgetDAOReadOnly(DPL::FromASCIIString(m_tizenId)));
479 DPL::Optional<DPL::String> defloc = m_dao->getDefaultlocale();
480 if (!defloc.IsNull()) {
481 LanguageTagsProviderSingleton::Instance().addWidgetDefaultLocales(
485 // For localizationsetting not changed on widget running
486 //LocalizationSetting::SetLanguageChangedCallback(
487 // languageChangedCallback, this);
489 ADD_PROFILING_POINT("CreateWindow", "start");
490 if (s_preparedWindowData == NULL)
492 m_windowData.reset(new WindowData(static_cast<unsigned long>(getpid()), true));
496 m_windowData.reset(s_preparedWindowData);
497 s_preparedWindowData = NULL;
499 ADD_PROFILING_POINT("CreateWindow", "stop");
501 WRT::UserDelegatesPtr cbs(new WRT::UserDelegates);
502 ADD_PROFILING_POINT("Create splash screen", "start");
503 m_splashScreen.reset(
504 new SplashScreenSupport(m_windowData->m_win));
505 if (m_splashScreen->createSplashScreen(m_dao->getSplashImgSrc())) {
506 m_splashScreen->startSplashScreen();
507 cbs->progressFinish = DPL::MakeDelegate(
510 progressFinishCallback);
512 ADD_PROFILING_POINT("Create splash screen", "stop");
513 DPL::OptionalString startUrl = W3CFileLocalization::getStartFile(m_dao);
514 if (!m_widget->PrepareView(DPL::ToUTF8String(*startUrl),
515 m_windowData->m_win, s_preparedEwkContext))
517 DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(
521 //you can't show window with splash screen before PrepareView
522 //ewk_view_add_with_context() in viewLogic breaks window
524 m_windowData->init();
526 WrtDB::WidgetLocalizedInfo localizedInfo =
527 W3CFileLocalization::getLocalizedInfo(m_dao);
528 std::string name = "";
529 if (!(localizedInfo.name.IsNull())) {
530 name = DPL::ToUTF8String(*(localizedInfo.name));
532 elm_win_title_set(m_windowData->m_win, name.c_str());
533 evas_object_show(m_windowData->m_win);
534 initializeWindowModes();
535 connectElmCallback();
537 if (!checkWACTestCertififedWidget()) {
538 LogWarning("WAC Certificate failed, stop launchStep");
542 m_widgetState = WidgetState_Authorizing;
543 if (!m_widget->CheckBeforeLaunch()) {
544 LogError("CheckBeforeLaunch failed, stop launchStep");
545 DPL::Event::ControllerEventHandler<NextStepEvent>::PostEvent(
549 LogInfo("Widget launch accepted. Entering running state");
550 m_widgetState = WidgetState_Running;
552 cbs->loadFinish = DPL::MakeDelegate(this, &WrtClient::loadFinishCallback);
553 cbs->bufferSet = DPL::MakeDelegate(this, &WrtClient::setLayout);
554 cbs->bufferUnset = DPL::MakeDelegate(this, &WrtClient::unsetLayout);
555 cbs->webkitExit = DPL::MakeDelegate(this, &WrtClient::webkitExitCallback);
556 cbs->webCrash = DPL::MakeDelegate(this, &WrtClient::webCrashCallback);
557 cbs->toggleFullscreen = DPL::MakeDelegate(
558 m_windowData.get(), &WindowData::toggleFullscreen);
560 m_widget->SetUserDelegates(cbs);
563 m_windowData->emitSignalForUserLayout(EDJE_SHOW_BACKWARD_SIGNAL, "");
565 ADD_PROFILING_POINT("launchStep", "stop");
568 void WrtClient::initializeWindowModes()
570 Assert(m_windowData);
572 auto windowModes = m_dao->getWindowModes();
573 bool fullscreen = false;
574 bool backbutton = false;
575 if (m_dao->getWidgetType().appType == WrtDB::APP_TYPE_TIZENWEBAPP) {
576 WidgetSettings widgetSettings;
577 m_dao->getWidgetSettings(widgetSettings);
578 WidgetSettingList settings(widgetSettings);
580 (settings.getBackButtonPresence() == BackButton_Enable);
583 FOREACH(it, windowModes)
585 std::string viewMode = DPL::ToUTF8String(*it);
586 if (viewMode == VIEWMODE_TYPE_FULLSCREEN) {
589 } else if (viewMode == VIEWMODE_TYPE_MAXIMIZED) {
594 m_windowData->setViewMode(fullscreen,
598 void WrtClient::backButtonCallback(void* data,
599 Evas_Object * /*obj*/,
600 void * /*event_info*/)
602 LogInfo("BackButtonCallback");
605 WrtClient* This = static_cast<WrtClient*>(data);
607 This->m_widget->Backward();
610 int WrtClient::appcoreLowMemoryCallback(void* /*data*/)
612 LogInfo("appcoreLowMemoryCallback");
613 //WrtClient* This = static_cast<WrtClient*>(data);
615 // TODO call RunnableWidgetObject API regarding low memory
616 // The API should be implemented
621 void WrtClient::connectElmCallback()
623 Assert(m_windowData);
625 if (m_dao->getWidgetType().appType == WrtDB::APP_TYPE_TIZENWEBAPP) {
626 WidgetSettings widgetSettings;
627 m_dao->getWidgetSettings(widgetSettings);
628 WidgetSettingList settings(widgetSettings);
629 if (settings.getBackButtonPresence() == BackButton_Enable) {
630 m_windowData->addFloatBackButtonCallback(
632 &WrtClient::backButtonCallback,
636 WidgetSettingScreenLock rotationValue = settings.getRotationValue();
637 if (rotationValue == Screen_Portrait) {
638 elm_win_rotation_with_resize_set(m_windowData->m_win, 0);
639 ewk_view_orientation_send(m_widget->GetCurrentWebview(), 0);
640 } else if (rotationValue == Screen_Landscape) {
641 elm_win_rotation_with_resize_set(m_windowData->m_win, 270);
642 ewk_view_orientation_send(m_widget->GetCurrentWebview(), 90);
644 elm_win_rotation_with_resize_set(m_windowData->m_win, 0);
645 ewk_view_orientation_send(m_widget->GetCurrentWebview(), 0);
650 void WrtClient::setLayout(Evas_Object* newBuffer)
652 LogDebug("add new webkit buffer to window");
655 elm_object_part_content_set(m_windowData->m_user_layout,
659 evas_object_show(newBuffer);
662 void WrtClient::unsetLayout(Evas_Object* currentBuffer)
664 LogDebug("remove current webkit buffer from window");
665 Assert(currentBuffer);
666 evas_object_hide(currentBuffer);
668 elm_object_part_content_unset(m_windowData->m_user_layout,
669 ELM_SWALLOW_CONTENT);
672 void WrtClient::shutdownStep()
674 LogDebug("Closing Wrt connection ...");
676 if (m_widget && m_widgetState) {
677 m_widgetState = WidgetState_Stopped;
680 ewk_context_delete(s_preparedEwkContext);
681 WRT::CoreModuleSingleton::Instance().Terminate();
684 m_initialized = false;
686 m_windowData.reset();
690 int WrtClient::languageChangedCallback(void *data)
692 LogDebug("Language Changed");
696 WrtClient* wrtClient = static_cast<WrtClient*>(data);
697 if (!(wrtClient->m_dao)) {
701 // reset function fetches system locales and recreates language tags
702 LanguageTagsProviderSingleton::Instance().resetLanguageTags();
703 // widget default locales are added to language tags below
704 DPL::OptionalString defloc = wrtClient->m_dao->getDefaultlocale();
705 if (!defloc.IsNull()) {
706 LanguageTagsProviderSingleton::Instance().addWidgetDefaultLocales(
710 if (wrtClient->m_launched &&
711 wrtClient->m_widgetState != WidgetState_Stopped)
713 wrtClient->m_widget->ReloadStartPage();
718 void WrtClient::Quit()
721 DPL::Application::Quit();
724 static Eina_Bool proces_pool_fd_handler(void* /*data*/, Ecore_Fd_Handler *handler)
726 int fd = ecore_main_fd_handler_fd_get(handler);
728 if (ecore_main_fd_handler_active_get(handler, ECORE_FD_ERROR))
730 LogDebug("ECORE_FD_ERROR");
733 return ECORE_CALLBACK_CANCEL;
736 if (ecore_main_fd_handler_active_get(handler, ECORE_FD_READ))
738 LogDebug("ECORE_FD_READ");
740 app_pkt_t* pkt = (app_pkt_t*) malloc(sizeof(char) * AUL_SOCK_MAXBUFF);
741 memset(pkt, 0, AUL_SOCK_MAXBUFF);
743 int recv_ret = recv(fd, pkt, AUL_SOCK_MAXBUFF, 0);
749 LogDebug("recv error!");
752 LogDebug("recv_ret : " << recv_ret << ", pkt->len : " << pkt->len);
754 ecore_main_fd_handler_del(handler);
756 __wrt_launchpad_main_loop(pkt, app_argv[0], &app_argc, &app_argv);
761 ecore_main_loop_quit();
762 return ECORE_CALLBACK_CANCEL;
765 return ECORE_CALLBACK_CANCEL;
771 // set evas backend type
772 if (!getenv("ELM_ENGINE"))
774 if (!setenv("ELM_ENGINE", "gl", 1))
776 LogDebug("Enable backend");
781 LogDebug("ELM_ENGINE : " << getenv("ELM_ENGINE"));
785 setenv("COREGL_FASTPATH", "1", 1);
787 setenv("CAIRO_GL_COMPOSITOR", "msaa", 1);
788 setenv("CAIRO_GL_LAZY_FLUSHING", "yes", 1);
789 setenv("ELM_IMAGE_CACHE", "0", 1);
796 // process pool - store arg's value
800 UNHANDLED_EXCEPTION_HANDLER_BEGIN
802 ADD_PROFILING_POINT("main-entered", "point");
805 DPL::Log::LogSystemSingleton::Instance().SetTag("WRT");
807 // Set environment variables
810 if (argc > 1 && argv[1] != NULL && !strcmp(argv[1], "-d"))
812 LogInfo("Entered dummy process mode");
813 sprintf(argv[0], "%s ",
816 LogInfo("Prepare ewk_context");
817 appcore_set_i18n("wrt-client", NULL);
819 ewk_set_arguments(argc, argv);
820 setenv("WRT_LAUNCHING_PERFORMANCE", "1", 1);
821 s_preparedEwkContext = ewk_context_new_with_injected_bundle_path(BUNDLE_PATH);
823 int client_fd = __connect_process_pool_server();
827 LogInfo("Connecting process_pool_server was failed!");
831 LogInfo("Prepare window_data");
832 LogInfo("elm_init()");
833 elm_init(argc, argv);
834 LogInfo("WindowData()");
835 s_preparedWindowData = new WindowData(static_cast<unsigned long>(getpid()));
837 ecore_main_fd_handler_add(client_fd, ECORE_FD_READ, proces_pool_fd_handler, NULL, NULL, NULL);
838 ecore_main_fd_handler_add(client_fd, ECORE_FD_ERROR, proces_pool_fd_handler, NULL, NULL, NULL);
840 setpriority(PRIO_PROCESS, 0, 0);
842 LogDebug("ecore_main_loop_begin()");
843 ecore_main_loop_begin();
844 LogDebug("ecore_main_loop_begin()_end");
846 std::string tizenId = WrtClient::getTizenIdFromArgument(argc, argv);
847 PluginModuleSupport::init(s_preparedEwkContext, tizenId);
852 // This code is to fork a web process without exec.
853 std::string tizenId = WrtClient::getTizenIdFromArgument(argc, argv);
855 if (!tizenId.empty())
857 LogDebug("Launching by fork mode");
858 // Language env setup
859 appcore_set_i18n("wrt-client", NULL);
861 ewk_set_arguments(argc, argv);
862 setenv("WRT_LAUNCHING_PERFORMANCE", "1", 1);
863 s_preparedEwkContext = ewk_context_new_with_injected_bundle_path(
867 PluginModuleSupport::init(s_preparedEwkContext, tizenId);
871 // Output on stdout will be flushed after every newline character,
872 // even if it is redirected to a pipe. This is useful for running
873 // from a script and parsing output.
874 // (Standard behavior of stdlib is to use full buffering when
875 // redirected to a pipe, which means even after an end of line
876 // the output may not be flushed).
879 WrtClient app(app_argc, app_argv);
881 ADD_PROFILING_POINT("Before appExec", "point");
882 int ret = app.Exec();
883 LogDebug("App returned: " << ret);
884 ret = app.getReturnStatus();
885 LogDebug("WrtClient returned: " << ret);
888 UNHANDLED_EXCEPTION_HANDLER_END