const String COMMUNICATION_MUTEX_ID = L"osp.app.ipcserver.communicationdispatcher";
}
+
_CommunicationDispatcher* _CommunicationDispatcher::__pCommunicationDispatcher = null;
_CommunicationDispatcher::_CommunicationDispatcher()
__pIpcServer = new (std::nothrow) _IpcServer();
r = __pIpcServer->Construct(COMMUNICATION_DISPATCHER_IPC_ID, *this);
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to IPC server initialize. [%s] Propaged.", r);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to IPC server initialize. [%s] Propaged.", GetErrorMessage(r));
r = __pIpcServer->Start();
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to start IPC server. [%s] Propaged.", r);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to start IPC server. [%s] Propaged.", GetErrorMessage(r));
r = __Mutex.Create(COMMUNICATION_MUTEX_ID);
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to create mutex. [%s] Propaged.", r);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to create mutex. [%s] Propaged.", GetErrorMessage(r));
__pAppManagerImpl = _AppManagerImpl::GetInstance();
SysTryCatch(NID_APP, __pAppManagerImpl != null, r = E_SYSTEM, r, "It is failed to get _AppManagerImpl instance");
r = __pAppManagerImpl->AddAppEventListener(*this);
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to add event listener. [%s] Propaged.", r);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to add event listener. [%s] Propaged.", GetErrorMessage(r));
+
+ r = __serviceProviderMap.Construct(0, 0, __strHashCodeProvider, __comparer);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to initialize provider's map. [%s] Propaged.", GetErrorMessage(r));
+
+ r = __responseContainer.Construct();
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to create response container. [%s] Propaged.", GetErrorMessage(r));
- __serviceProviderMap.Construct(0, 0, __strHashCodeProvider, __comparer);
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to initialize provider's map. [%s] Propaged.", r);
CATCH:
SetLastResult(r);
{
result r = E_SUCCESS;
r = __pIpcServer->Stop();
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to stop IPC server. [%s] Propaged.", r);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to stop IPC server. [%s] Propaged.", GetErrorMessage(r));
r = __Mutex.Release();
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to release mutex. [%s] Propaged.", r);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to release mutex. [%s] Propaged.", GetErrorMessage(r));
r = __pAppManagerImpl->RemoveAppEventListener(*this);
- SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to remove event listener. [%s] Propaged.", r);
+ SysTryCatch(NID_APP, r == E_SUCCESS, , r, "It is failed to remove event listener. [%s] Propaged.", GetErrorMessage(r));
+
+ __responseContainer.RemoveAll(true);
CATCH:
delete __pIpcServer;
result r = E_SUCCESS;
SysLog(NID_APP, "Application is requested by IPC, currentPkgId is %ls", __currentPkgId.GetPointer());
+ __responseContainer.RemoveAll(true);
+
String* componentId = (String*)request.GetAt(0);
if(componentId == null)
ArrayList* temp = const_cast<ArrayList*>(&request);
temp->RemoveAll(true);
+ __responseContainer.AddItems(*response);
+
return true;
}