SET(DEPS
vconf
capi-system-info
+ capi-system-device
+ capi-system-runtime-info
capi-appfw-app-manager
+ capi-appfw-package-manager
appsvc
notification
capi-system-system-settings
BuildRequires: sed
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(capi-system-info)
+BuildRequires: pkgconfig(capi-system-device)
+BuildRequires: pkgconfig(capi-system-runtime-info)
BuildRequires: pkgconfig(capi-appfw-app-manager)
+BuildRequires: pkgconfig(capi-appfw-package-manager)
BuildRequires: pkgconfig(appsvc)
BuildRequires: pkgconfig(notification)
BuildRequires: pkgconfig(capi-system-system-settings)
#include <DBusTypes.h>
#include <context_trigger_types_internal.h>
#include <Json.h>
+#include <ContextProvider.h>
#include "Server.h"
#include "access_control/Privilege.h"
#include "Request.h"
#include "ProviderHandler.h"
-#include "ContextManagerImpl.h"
+#include "ContextManager.h"
#include "trigger/TemplateManager.h"
/* Context Providers */
#include <internal/PlaceContextProvider.h>
#include <internal/CustomContextProvider.h>
+using namespace ctx;
+
struct TriggerItemFormat {
std::string subject;
int operation;
- ctx::Json attributes;
- ctx::Json options;
+ Json attributes;
+ Json options;
std::string owner;
bool unregister;
- TriggerItemFormat(std::string subj, int ops, ctx::Json attr, ctx::Json opt, std::string own) :
+ TriggerItemFormat(std::string subj, int ops, Json attr, Json opt, std::string own) :
subject(subj),
operation(ops),
attributes(attr),
};
static std::list<TriggerItemFormat> __triggerItemList;
-bool ctx::ContextManagerImpl::__initialized = false;
-ctx::ContextManagerImpl::ContextManagerImpl()
+ContextManager::ContextManager() :
+ __initialized(false)
{
+ ContextProvider::__setContextManager(this);
}
-ctx::ContextManagerImpl::~ContextManagerImpl()
+ContextManager::~ContextManager()
{
release();
}
-bool ctx::ContextManagerImpl::init()
+bool ContextManager::init()
{
bool ret;
ret = initPlaceContextProvider();
IF_FAIL_RETURN_TAG(ret, false, _E, "Initialization failed: PlaceContextProvider");
- ret = initCustomContextProvider();
- IF_FAIL_RETURN_TAG(ret, false, _E, "Initialization failed: CustomContextProvider");
+// ret = initCustomContextProvider();
+// IF_FAIL_RETURN_TAG(ret, false, _E, "Initialization failed: CustomContextProvider");
__initialized = true;
-
return true;
}
-void ctx::ContextManagerImpl::release()
+void ContextManager::release()
{
- for (auto it = __providerHandleMap.begin(); it != __providerHandleMap.end(); ++it) {
- delete it->second;
+ for (auto& it : __providerHandleMap) {
+ delete it.second;
}
__providerHandleMap.clear();
}
-bool ctx::ContextManagerImpl::registerProvider(const char *subject, ctx::ContextProviderInfo &providerInfo)
+bool ContextManager::registerProvider(const char *subject, const char *privilege, ContextProvider *provider)
{
if (__providerHandleMap.find(subject) != __providerHandleMap.end()) {
_E("The provider for the subject '%s' is already registered.", subject);
return false;
}
- _SI("Subj: %s, Priv: %s", subject, providerInfo.privilege);
- __providerHandleMap[subject] = NULL;
-
- auto it = __providerHandleMap.find(subject);
- ProviderHandler *handle = new(std::nothrow) ProviderHandler(it->first.c_str(), providerInfo);
+ _SI("Subj: %s, Priv: %s", subject, privilege);
- if (!handle) {
- _E("Memory allocation failed");
- __providerHandleMap.erase(it);
- return false;
- }
+ ProviderHandler *handle = new(std::nothrow) ProviderHandler(subject, privilege, provider);
+ IF_FAIL_RETURN_TAG(handle, false, _E, "Memory allocation failed");
- it->second = handle;
+ __providerHandleMap[subject] = handle;
return true;
}
-bool ctx::ContextManagerImpl::unregisterProvider(const char *subject)
+bool ContextManager::unregisterProvider(const char *subject)
{
auto it = __providerHandleMap.find(subject);
if (it == __providerHandleMap.end()) {
return true;
}
-bool ctx::ContextManagerImpl::registerTriggerItem(const char *subject, int operation, ctx::Json attributes, ctx::Json options, const char* owner)
+bool ContextManager::registerTriggerItem(const char *subject, int operation, Json attributes, Json options, const char* owner)
{
IF_FAIL_RETURN_TAG(subject, false, _E, "Invalid parameter");
if (!__initialized) {
__triggerItemList.push_back(TriggerItemFormat(subject, operation, attributes, options, (owner)? owner : ""));
} else {
- ctx::trigger::TemplateManager* tmplMgr = ctx::trigger::TemplateManager::getInstance();
+ trigger::TemplateManager* tmplMgr = trigger::TemplateManager::getInstance();
IF_FAIL_RETURN_TAG(tmplMgr, false, _E, "Memory allocation failed");
tmplMgr->registerTemplate(subject, operation, attributes, options, owner);
}
return true;
}
-bool ctx::ContextManagerImpl::unregisterTriggerItem(const char *subject)
+bool ContextManager::unregisterTriggerItem(const char *subject)
{
IF_FAIL_RETURN_TAG(subject, false, _E, "Invalid parameter");
if (!__initialized) {
__triggerItemList.push_back(TriggerItemFormat(subject));
} else {
- ctx::trigger::TemplateManager* tmplMgr = ctx::trigger::TemplateManager::getInstance();
+ trigger::TemplateManager* tmplMgr = trigger::TemplateManager::getInstance();
IF_FAIL_RETURN_TAG(tmplMgr, false, _E, "Memory allocation failed");
tmplMgr->unregisterTemplate(subject);
}
return true;
}
-bool ctx::ContextManagerImpl::popTriggerItem(std::string &subject, int &operation, ctx::Json &attributes, ctx::Json &options, std::string& owner, bool& unregister)
+bool ContextManager::popTriggerItem(std::string &subject, int &operation, Json &attributes, Json &options, std::string& owner, bool& unregister)
{
IF_FAIL_RETURN(!__triggerItemList.empty(), false);
return true;
}
-void ctx::ContextManagerImpl::assignRequest(ctx::RequestInfo* request)
+void ContextManager::assignRequest(RequestInfo* request)
{
if (__handleCustomRequest(request)) {
delete request;
}
}
-bool ctx::ContextManagerImpl::isSupported(const char *subject)
+bool ContextManager::isSupported(const char *subject)
{
auto it = __providerHandleMap.find(subject);
return (it != __providerHandleMap.end());
}
-bool ctx::ContextManagerImpl::isAllowed(const ctx::Credentials *creds, const char *subject)
+bool ContextManager::isAllowed(const Credentials *creds, const char *subject)
{
IF_FAIL_RETURN(creds, true); /* In case internal requests */
auto it = __providerHandleMap.find(subject);
return it->second->isAllowed(creds);
}
-void ctx::ContextManagerImpl::__publish(const char* subject, ctx::Json &option, int error, ctx::Json &dataUpdated)
+void ContextManager::__publish(const char* subject, Json &option, int error, Json &dataUpdated)
{
_I("Publishing '%s'", subject);
_J("Option", option);
it->second->publish(option, error, dataUpdated);
}
-void ctx::ContextManagerImpl::__replyToRead(const char* subject, ctx::Json &option, int error, ctx::Json &dataRead)
+void ContextManager::__replyToRead(const char* subject, Json &option, int error, Json &dataRead)
{
_I("Sending data of '%s'", subject);
_J("Option", option);
struct PublishedData {
int type;
- ctx::ContextManagerImpl *mgr;
+ ContextManager *mgr;
std::string subject;
int error;
- ctx::Json option;
- ctx::Json data;
- PublishedData(int t, ctx::ContextManagerImpl *m, const char* s, ctx::Json& o, int e, ctx::Json& d)
+ Json option;
+ Json data;
+ PublishedData(int t, ContextManager *m, const char* s, Json& o, int e, Json& d)
: type(t), mgr(m), subject(s), error(e)
{
option = o.str();
}
};
-gboolean ctx::ContextManagerImpl::__threadSwitcher(gpointer data)
+gboolean ContextManager::__threadSwitcher(gpointer data)
{
PublishedData *tuple = static_cast<PublishedData*>(data);
return FALSE;
}
-bool ctx::ContextManagerImpl::publish(const char* subject, ctx::Json& option, int error, ctx::Json& dataUpdated)
+bool ContextManager::publish(const char* subject, Json& option, int error, Json& dataUpdated)
{
IF_FAIL_RETURN_TAG(subject, false, _E, "Invalid parameter");
return true;
}
-bool ctx::ContextManagerImpl::replyToRead(const char* subject, ctx::Json& option, int error, ctx::Json& dataRead)
+bool ContextManager::replyToRead(const char* subject, Json& option, int error, Json& dataRead)
{
IF_FAIL_RETURN_TAG(subject, false, _E, "Invalid parameter");
return true;
}
-bool ctx::ContextManagerImpl::__handleCustomRequest(ctx::RequestInfo* request)
+bool ContextManager::__handleCustomRequest(RequestInfo* request)
{
std::string subject = request->getSubject();
IF_FAIL_RETURN( subject == CONTEXT_TRIGGER_SUBJECT_CUSTOM_ADD ||
subject == CONTEXT_TRIGGER_SUBJECT_CUSTOM_REMOVE ||
subject == CONTEXT_TRIGGER_SUBJECT_CUSTOM_PUBLISH, false);
+#if 0
const char* pkg_id = request->getPackageId();
if (pkg_id == NULL) {
request->reply(ERR_OPERATION_FAILED);
return true;
}
- ctx::Json desc = request->getDescription();
+ Json desc = request->getDescription();
std::string name;
desc.get(NULL, CT_CUSTOM_NAME, &name);
std::string subj = pkg_id + std::string("::") + name;
int error = ERR_NONE;
if (subject == CONTEXT_TRIGGER_SUBJECT_CUSTOM_ADD) {
- ctx::Json tmpl;
+ Json tmpl;
desc.get(NULL, CT_CUSTOM_ATTRIBUTES, &tmpl);
- error = ctx::custom_context_provider::addItem(subj, name, tmpl, pkg_id);
+ error = custom_context_provider::addItem(subj, name, tmpl, pkg_id);
} else if (subject == CONTEXT_TRIGGER_SUBJECT_CUSTOM_REMOVE) {
- error = ctx::custom_context_provider::removeItem(subj);
+ error = custom_context_provider::removeItem(subj);
if (error == ERR_NONE) {
- ctx::Json data;
+ Json data;
data.set(NULL, CT_CUSTOM_SUBJECT, subj);
request->reply(error, data);
}
} else if (subject == CONTEXT_TRIGGER_SUBJECT_CUSTOM_PUBLISH) {
- ctx::Json fact;
+ Json fact;
desc.get(NULL, CT_CUSTOM_FACT, &fact);
- error = ctx::custom_context_provider::publishData(subj, fact);
+ error = custom_context_provider::publishData(subj, fact);
}
request->reply(error);
+#endif
return true;
}
* limitations under the License.
*/
-#ifndef _CONTEXT_MANAGER_IMPL_H_
-#define _CONTEXT_MANAGER_IMPL_H_
+#ifndef _CONTEXT_CONTEXT_MANAGER_H_
+#define _CONTEXT_CONTEXT_MANAGER_H_
-#include <string>
#include <map>
-#include <glib.h>
-#include <ContextManager.h>
#include <IContextManager.h>
namespace ctx {
class RequestInfo;
class ProviderHandler;
- class ContextManagerImpl : public IContextManager {
+ class ContextManager : public IContextManager {
public:
- ContextManagerImpl();
- ~ContextManagerImpl();
+ ~ContextManager();
bool init();
void release();
bool popTriggerItem(std::string &subject, int &operation, ctx::Json &attributes, ctx::Json &options, std::string &owner, bool& unregister);
/* From the interface class */
- bool registerProvider(const char *subject, ContextProviderInfo &providerInfo);
+ bool registerProvider(const char *subject, const char *privilege, ContextProvider *provider);
bool unregisterProvider(const char *subject);
bool registerTriggerItem(const char *subject, int operation, ctx::Json attributes, ctx::Json options, const char *owner = NULL);
bool unregisterTriggerItem(const char *subject);
bool replyToRead(const char *subject, ctx::Json &option, int error, ctx::Json &dataRead);
private:
- std::map<std::string, ProviderHandler*> __providerHandleMap;
- static bool __initialized;
+ ContextManager();
static gboolean __threadSwitcher(gpointer data);
+
void __publish(const char *subject, ctx::Json &option, int error, ctx::Json &dataUpdated);
void __replyToRead(const char *subject, ctx::Json &option, int error, ctx::Json &dataRead);
/* For custom request */
bool __handleCustomRequest(ctx::RequestInfo* request);
- }; /* class ContextManagerImpl */
+
+ bool __initialized;
+ std::map<std::string, ProviderHandler*> __providerHandleMap;
+
+ friend class Server;
+
+ }; /* class ContextManager */
} /* namespace ctx */
-#endif /* End of __CONTEXT_MANAGER_IMPL_H__ */
+#endif /* _CONTEXT_CONTEXT_MANAGER_H_ */
#include <glib.h>
#include <Types.h>
-#include <Json.h>
#include "access_control/Privilege.h"
-#include "Server.h"
#include "Request.h"
#include "ProviderHandler.h"
-ctx::ProviderHandler::ProviderHandler(const char *subj, ctx::ContextProviderInfo &prvd) :
- __subject(subj),
- __providerInfo(prvd)
+using namespace ctx;
+
+ProviderHandler::ProviderHandler(const char *subject, const char *privilege, ContextProvider *provider) :
+ __subject(subject),
+ __privilege(privilege),
+ __provider(provider)
{
}
-ctx::ProviderHandler::~ProviderHandler()
+ProviderHandler::~ProviderHandler()
{
- for (auto it = __subscribeRequests.begin(); it != __subscribeRequests.end(); ++it) {
- delete *it;
+ for (RequestInfo*& info : __subscribeRequests) {
+ delete info;
}
__subscribeRequests.clear();
- for (auto it = __readRequests.begin(); it != __readRequests.end(); ++it) {
- delete *it;
+ for (RequestInfo*& info : __readRequests) {
+ delete info;
}
__readRequests.clear();
- __providerInfo.destroy(__providerInfo.data);
+ delete __provider;
}
-bool ctx::ProviderHandler::isAllowed(const ctx::Credentials *creds)
+bool ProviderHandler::isAllowed(const Credentials *creds)
{
IF_FAIL_RETURN(creds, true); /* In case of internal requests */
- return privilege_manager::isAllowed(creds, __providerInfo.privilege);
+ return privilege_manager::isAllowed(creds, __privilege);
}
-ctx::ContextProviderBase* ctx::ProviderHandler::__getProvider(ctx::RequestInfo *request)
+ContextProvider* ProviderHandler::__getProvider(RequestInfo *request)
{
- ContextProviderBase *provider = __providerInfo.create(__providerInfo.data);
- if (!provider) {
- _E("Memory allocation failed");
- delete request;
- return NULL;
- }
-
- return provider;
+ /* TODO: When implementing dynamic so loading... */
+ return __provider;
}
-void ctx::ProviderHandler::subscribe(ctx::RequestInfo *request)
+void ProviderHandler::subscribe(RequestInfo *request)
{
_I(CYAN("'%s' subscribes '%s' (RID-%d)"), request->getClient(), __subject, request->getId());
- ContextProviderBase *provider = __getProvider(request);
+ ContextProvider *provider = __getProvider(request);
IF_FAIL_VOID(provider);
- ctx::Json requestResult;
- int error = provider->subscribe(__subject, request->getDescription().str(), &requestResult);
+ Json requestResult;
+ int error = provider->subscribe(request->getDescription().str(), &requestResult);
if (!request->reply(error, requestResult) || error != ERR_NONE) {
delete request;
__subscribeRequests.push_back(request);
}
-void ctx::ProviderHandler::unsubscribe(ctx::RequestInfo *request)
+void ProviderHandler::unsubscribe(RequestInfo *request)
{
_I(CYAN("'%s' unsubscribes '%s' (RID-%d)"), request->getClient(), __subject, request->getId());
- // Search the subscribe request to be removed
+ /* Search the subscribe request to be removed */
auto target = __findRequest(__subscribeRequests, request->getClient(), request->getId());
if (target == __subscribeRequests.end()) {
_W("Unknown request");
return;
}
- // Keep the pointer to the request found
- RequestInfo *req_found = *target;
+ /* Keep the pointer to the request found */
+ RequestInfo *reqFound = *target;
- // Remove the request from the list
+ /* Remove the request from the list */
__subscribeRequests.erase(target);
- // Check if there exist the same requests
- if (__findRequest(__subscribeRequests, req_found->getDescription()) != __subscribeRequests.end()) {
- // Do not stop detecting the subject
- _D("A same request from '%s' exists", req_found->getClient());
+ /* Check if there exist the same requests */
+ if (__findRequest(__subscribeRequests, reqFound->getDescription()) != __subscribeRequests.end()) {
+ /* Do not stop detecting the subject */
+ _D("A same request from '%s' exists", reqFound->getClient());
request->reply(ERR_NONE);
delete request;
- delete req_found;
+ delete reqFound;
return;
}
- // Get the provider
- ContextProviderBase *provider = __getProvider(request);
+ /* Get the provider */
+ ContextProvider *provider = __getProvider(request);
IF_FAIL_VOID(provider);
- // Stop detecting the subject
- int error = provider->unsubscribe(__subject, req_found->getDescription());
+ /* Stop detecting the subject */
+ int error = provider->unsubscribe(reqFound->getDescription());
request->reply(error);
delete request;
- delete req_found;
+ delete reqFound;
}
-void ctx::ProviderHandler::read(ctx::RequestInfo *request)
+void ProviderHandler::read(RequestInfo *request)
{
_I(CYAN("'%s' reads '%s' (RID-%d)"), request->getClient(), __subject, request->getId());
- ContextProviderBase *provider = __getProvider(request);
+ ContextProvider *provider = __getProvider(request);
IF_FAIL_VOID(provider);
- ctx::Json requestResult;
- int error = provider->read(__subject, request->getDescription().str(), &requestResult);
+ Json requestResult;
+ int error = provider->read(request->getDescription().str(), &requestResult);
if (!request->reply(error, requestResult) || error != ERR_NONE) {
delete request;
__readRequests.push_back(request);
}
-void ctx::ProviderHandler::write(ctx::RequestInfo *request)
+void ProviderHandler::write(RequestInfo *request)
{
_I(CYAN("'%s' writes '%s' (RID-%d)"), request->getClient(), __subject, request->getId());
- ContextProviderBase *provider = __getProvider(request);
+ ContextProvider *provider = __getProvider(request);
IF_FAIL_VOID(provider);
- ctx::Json requestResult;
- int error = provider->write(__subject, request->getDescription(), &requestResult);
+ Json requestResult;
+ int error = provider->write(request->getDescription(), &requestResult);
request->reply(error, requestResult);
delete request;
}
-bool ctx::ProviderHandler::publish(ctx::Json &option, int error, ctx::Json &dataUpdated)
+bool ProviderHandler::publish(Json &option, int error, Json &dataUpdated)
{
auto end = __subscribeRequests.end();
auto target = __findRequest(__subscribeRequests.begin(), end, option);
return true;
}
-bool ctx::ProviderHandler::replyToRead(ctx::Json &option, int error, ctx::Json &dataRead)
+bool ProviderHandler::replyToRead(Json &option, int error, Json &dataRead)
{
auto end = __readRequests.end();
auto target = __findRequest(__readRequests.begin(), end, option);
auto prev = target;
- ctx::Json dummy;
+ Json dummy;
while (target != end) {
(*target)->reply(error, dummy, dataRead);
return true;
}
-ctx::ProviderHandler::RequestList::iterator
-ctx::ProviderHandler::__findRequest(RequestList &reqList, Json &option)
+ProviderHandler::RequestList::iterator
+ProviderHandler::__findRequest(RequestList &reqList, Json &option)
{
return __findRequest(reqList.begin(), reqList.end(), option);
}
-ctx::ProviderHandler::RequestList::iterator
-ctx::ProviderHandler::__findRequest(RequestList &reqList, std::string client, int reqId)
+ProviderHandler::RequestList::iterator
+ProviderHandler::__findRequest(RequestList &reqList, std::string client, int reqId)
{
for (auto it = reqList.begin(); it != reqList.end(); ++it) {
if (client == (*it)->getClient() && reqId == (*it)->getId()) {
return reqList.end();
}
-ctx::ProviderHandler::RequestList::iterator
-ctx::ProviderHandler::__findRequest(RequestList::iterator begin, RequestList::iterator end, Json &option)
+ProviderHandler::RequestList::iterator
+ProviderHandler::__findRequest(RequestList::iterator begin, RequestList::iterator end, Json &option)
{
for (auto it = begin; it != end; ++it) {
if (option == (*it)->getDescription()) {
#include <string>
#include <list>
-#include <ContextProviderBase.h>
+#include <ContextProvider.h>
namespace ctx {
- class Json;
class Credentials;
class RequestInfo;
public:
typedef std::list<RequestInfo*> RequestList;
- ProviderHandler(const char *subj, ContextProviderInfo &prvd);
+ ProviderHandler(const char *subject, const char *privilege, ContextProvider *provider);
~ProviderHandler();
bool isAllowed(const Credentials *creds);
private:
const char *__subject;
- ContextProviderInfo __providerInfo;
+ const char *__privilege;
+ ContextProvider *__provider;
RequestList __subscribeRequests;
RequestList __readRequests;
- ContextProviderBase* __getProvider(RequestInfo *request);
+ ContextProvider* __getProvider(RequestInfo *request);
RequestList::iterator __findRequest(RequestList &reqList, Json &option);
RequestList::iterator __findRequest(RequestList &reqList, std::string client, int reqId);
RequestList::iterator __findRequest(RequestList::iterator begin, RequestList::iterator end, Json &option);
#include <Types.h>
#include "DBusServer.h"
-#include "ContextManagerImpl.h"
+#include "ContextManager.h"
#include "trigger/Trigger.h"
#include "Server.h"
static GMainLoop *mainloop = NULL;
static bool started = false;
-static ctx::ContextManagerImpl *__contextMgr = NULL;
+static ctx::ContextManager *__contextMgr = NULL;
static ctx::DBusServer *__dbusHandle = NULL;
static ctx::trigger::Trigger *__contextTrigger = NULL;
bool result = false;
_I("Init Context Manager");
- __contextMgr = new(std::nothrow) ctx::ContextManagerImpl();
+ __contextMgr = new(std::nothrow) ctx::ContextManager();
IF_FAIL_CATCH_TAG(__contextMgr, _E, "Memory allocation failed");
- context_manager::setInstance(__contextMgr);
result = __contextMgr->init();
IF_FAIL_CATCH_TAG(result, _E, "Initialization Failed");
#include <Types.h>
#include "../access_control/Privilege.h"
-#include "../ContextManagerImpl.h"
+#include "../ContextManager.h"
#include "ContextMonitor.h"
#include "IContextListener.h"
#include "FactRequest.h"
static int __lastErr;
ContextMonitor *ContextMonitor::__instance = NULL;
-ContextManagerImpl *ContextMonitor::__contextMgr = NULL;
+ContextManager *ContextMonitor::__contextMgr = NULL;
static int __generateReqId()
{
{
}
-void ContextMonitor::setContextManager(ContextManagerImpl* ctx_mgr)
+void ContextMonitor::setContextManager(ContextManager* ctx_mgr)
{
__contextMgr = ctx_mgr;
}
namespace ctx {
- class ContextManagerImpl;
+ class ContextManager;
namespace trigger {
class ContextMonitor {
public:
static ContextMonitor* getInstance();
- static void setContextManager(ContextManagerImpl* ctx_mgr);
+ static void setContextManager(ContextManager* ctx_mgr);
static void destroy();
int subscribe(int ruleId, std::string subject, Json option, IContextListener* listener);
~ContextMonitor();
static ContextMonitor *__instance;
- static ContextManagerImpl *__contextMgr;
+ static ContextManager *__contextMgr;
int __subscribe(const char* subject, Json* option, IContextListener* listener);
void __unsubscribe(const char *subject, int subscriptionId);
#include <sstream>
#include <Types.h>
#include <context_trigger_types_internal.h>
-#include "../ContextManagerImpl.h"
+#include "../ContextManager.h"
#include "RuleManager.h"
#include "TemplateManager.h"
using namespace ctx::trigger;
TemplateManager *TemplateManager::__instance = NULL;
-ContextManagerImpl *TemplateManager::__contextMgr = NULL;
+ContextManager *TemplateManager::__contextMgr = NULL;
RuleManager *TemplateManager::__ruleMgr = NULL;
static std::string __intToString(int i)
{
}
-void TemplateManager::setManager(ContextManagerImpl* ctxMgr, RuleManager* ruleMgr)
+void TemplateManager::setManager(ContextManager* ctxMgr, RuleManager* ruleMgr)
{
__contextMgr = ctxMgr;
__ruleMgr = ruleMgr;
namespace ctx {
- class ContextManagerImpl;
+ class ContextManager;
namespace trigger {
class TemplateManager {
public:
static TemplateManager* getInstance();
- static void setManager(ContextManagerImpl* ctxMgr, RuleManager* ruleMgr);
+ static void setManager(ContextManager* ctxMgr, RuleManager* ruleMgr);
static void destroy();
bool init();
~TemplateManager();
static TemplateManager *__instance;
- static ContextManagerImpl *__contextMgr;
+ static ContextManager *__contextMgr;
static RuleManager *__ruleMgr;
DatabaseManager __dbManager;
{
}
-bool Trigger::init(ContextManagerImpl* ctxMgr)
+bool Trigger::init(ContextManager* ctxMgr)
{
// Do the necessary initialization process.
// This function is called from the main thread during the service launching process.
}
}
-void Trigger::__processInitialize(ContextManagerImpl* mgr)
+void Trigger::__processInitialize(ContextManager* mgr)
{
// Context Monitor
ContextMonitor::setContextManager(mgr);
namespace ctx {
class client_request;
- class ContextManagerImpl;
+ class ContextManager;
namespace trigger {
Trigger();
~Trigger();
- bool init(ContextManagerImpl* ctxMgr);
+ bool init(ContextManager* ctxMgr);
void release();
bool assignRequest(RequestInfo* request);
private:
void __processRequest(RequestInfo* request);
- void __processInitialize(ContextManagerImpl* mgr);
+ void __processInitialize(ContextManager* mgr);
void __addRule(RequestInfo* request);
void __removeRule(RequestInfo* request);