From: Sungbae Yoo Date: Mon, 19 Dec 2016 04:46:58 +0000 (+0900) Subject: Replace method registeration with expose interface X-Git-Tag: accepted/tizen/3.0/common/20161221.180425^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F70%2F105570%2F1;p=platform%2Fcore%2Fsecurity%2Fkrate.git Replace method registeration with expose interface Change-Id: I5e356d7304f34482fa6a9b42cbf08323175c076c Signed-off-by: Sungbae Yoo --- diff --git a/server/app-proxy.cpp b/server/app-proxy.cpp index 75801c1..48b031c 100644 --- a/server/app-proxy.cpp +++ b/server/app-proxy.cpp @@ -49,17 +49,17 @@ int newIteratorId = 0; AppProxy::AppProxy(KrateControlContext& ctx) : context(ctx) { - context.registerParametricMethod(this, "", (AppProxy::AppInfo)(AppProxy::getAppInfo)(std::string, std::string)); + context.expose(this, "", (AppProxy::AppInfo)(AppProxy::getAppInfo)(std::string, std::string)); - context.registerParametricMethod(this, "", (int)(AppProxy::createIterator)(std::string)); - context.registerParametricMethod(this, "", (AppProxy::AppInfo)(AppProxy::getIteratorValue)(int)); - context.registerParametricMethod(this, "", (bool)(AppProxy::nextIterator)(int)); - context.registerParametricMethod(this, "", (int)(AppProxy::destroyIterator)(int)); + context.expose(this, "", (int)(AppProxy::createIterator)(std::string)); + context.expose(this, "", (AppProxy::AppInfo)(AppProxy::getIteratorValue)(int)); + context.expose(this, "", (bool)(AppProxy::nextIterator)(int)); + context.expose(this, "", (int)(AppProxy::destroyIterator)(int)); - context.registerParametricMethod(this, PRIVILEGE_APP_LAUNCH, (int)(AppProxy::launch)(std::string, AppProxy::Bundle)); - context.registerParametricMethod(this, PRIVILEGE_APP_LAUNCH, (int)(AppProxy::resume)(std::string, std::string)); - context.registerParametricMethod(this, PRIVILEGE_APP_KILL, (int)(AppProxy::terminate)(std::string, std::string)); - context.registerParametricMethod(this, "", (int)(AppProxy::isRunning)(std::string, std::string)); + context.expose(this, PRIVILEGE_APP_LAUNCH, (int)(AppProxy::launch)(std::string, AppProxy::Bundle)); + context.expose(this, PRIVILEGE_APP_LAUNCH, (int)(AppProxy::resume)(std::string, std::string)); + context.expose(this, PRIVILEGE_APP_KILL, (int)(AppProxy::terminate)(std::string, std::string)); + context.expose(this, "", (int)(AppProxy::isRunning)(std::string, std::string)); } AppProxy::~AppProxy() diff --git a/server/manager.cpp b/server/manager.cpp index 70de04d..93c953c 100644 --- a/server/manager.cpp +++ b/server/manager.cpp @@ -507,13 +507,13 @@ void notiProxyCallback(void *data, notification_type_e type, notification_op *op Manager::Manager(KrateControlContext& ctx) : context(ctx) { - context.registerParametricMethod(this, PRIVILEGE_INTERNAL_PLATFORM, (int)(Manager::createKrate)(std::string, std::string)); - context.registerParametricMethod(this, PRIVILEGE_INTERNAL_PLATFORM, (int)(Manager::removeKrate)(std::string)); - context.registerParametricMethod(this, PRIVILEGE_INTERNAL_PLATFORM, (int)(Manager::lockKrate)(std::string)); - context.registerParametricMethod(this, PRIVILEGE_INTERNAL_PLATFORM, (int)(Manager::unlockKrate)(std::string)); - context.registerParametricMethod(this, "", (int)(Manager::getKrateState)(std::string)); - context.registerParametricMethod(this, "", (std::vector)(Manager::getKrateList)(int)); - context.registerParametricMethod(this, PRIVILEGE_INTERNAL_PLATFORM, (int)(Manager::resetKratePassword)(std::string, std::string)); + context.expose(this, PRIVILEGE_INTERNAL_PLATFORM, (int)(Manager::createKrate)(std::string, std::string)); + context.expose(this, PRIVILEGE_INTERNAL_PLATFORM, (int)(Manager::removeKrate)(std::string)); + context.expose(this, PRIVILEGE_INTERNAL_PLATFORM, (int)(Manager::lockKrate)(std::string)); + context.expose(this, PRIVILEGE_INTERNAL_PLATFORM, (int)(Manager::unlockKrate)(std::string)); + context.expose(this, "", (int)(Manager::getKrateState)(std::string)); + context.expose(this, "", (std::vector)(Manager::getKrateList)(int)); + context.expose(this, PRIVILEGE_INTERNAL_PLATFORM, (int)(Manager::resetKratePassword)(std::string, std::string)); context.createNotification("Manager::created"); context.createNotification("Manager::removed"); diff --git a/server/package-proxy.cpp b/server/package-proxy.cpp index 3a5c7e8..15ad13a 100644 --- a/server/package-proxy.cpp +++ b/server/package-proxy.cpp @@ -31,11 +31,11 @@ namespace Krate { PackageProxy::PackageProxy(KrateControlContext& ctx) : context(ctx) { - context.registerParametricMethod(this, "", (PackageProxy::PackageInfo)(PackageProxy::getPackageInfo)(std::string, std::string)); - context.registerParametricMethod(this, "", (std::vector)(PackageProxy::getPackageList)(std::string)); + context.expose(this, "", (PackageProxy::PackageInfo)(PackageProxy::getPackageInfo)(std::string, std::string)); + context.expose(this, "", (std::vector)(PackageProxy::getPackageList)(std::string)); - context.registerParametricMethod(this, PRIVLEGE_PACKAGE_ADMIN, (int)(PackageProxy::install)(std::string, std::string)); - context.registerParametricMethod(this, PRIVLEGE_PACKAGE_ADMIN, (int)(PackageProxy::uninstall)(std::string, std::string)); + context.expose(this, PRIVLEGE_PACKAGE_ADMIN, (int)(PackageProxy::install)(std::string, std::string)); + context.expose(this, PRIVLEGE_PACKAGE_ADMIN, (int)(PackageProxy::uninstall)(std::string, std::string)); } PackageProxy::~PackageProxy() diff --git a/server/server.cpp b/server/server.cpp index 227429f..db3af1a 100644 --- a/server/server.cpp +++ b/server/server.cpp @@ -43,8 +43,8 @@ Server::Server() service->setPrivilegeChecker(std::bind(&Server::checkPeerPrivilege, this, _1, _2)); - service->registerParametricMethod(this, "", (runtime::FileDescriptor)(Server::registerNotificationSubscriber)(std::string)); - service->registerParametricMethod(this, "", (int)(Server::unregisterNotificationSubscriber)(std::string, int)); + service->expose(this, "", (runtime::FileDescriptor)(Server::registerNotificationSubscriber)(std::string)); + service->expose(this, "", (int)(Server::unregisterNotificationSubscriber)(std::string, int)); manager.reset(new Krate::Manager(*this)); appProxy.reset(new Krate::AppProxy(*this));