Lines Matching refs:remoteWatcher
61 RemoteWatcher *remoteWatcher = new RemoteWatcher(remoteWatcherId, watcher);
62 WATCHER_CHECK(remoteWatcher != nullptr, return 0, "Failed to create watcher for %u", id);
63 remoteWatcher->SetAgentId(GetCallingPid());
64 AddRemoteWatcher(remoteWatcher);
75 RemoteWatcher *remoteWatcher = GetRemoteWatcher(remoteWatcherId);
76 WATCHER_CHECK(remoteWatcher != nullptr, return 0, "Can not find watcher %u", remoteWatcherId);
77 WATCHER_CHECK(remoteWatcher->CheckAgent(GetCallingPid()), return 0,
78 "Can not find watcher %u calling %u", remoteWatcher->GetAgentId(), static_cast<uint32_t>(GetCallingPid()));
80 watcher = remoteWatcher->GetWatcher();
81 DelRemoteWatcher(remoteWatcher);
95 auto remoteWatcher = GetRemoteWatcher(remoteWatcherId);
96 WATCHER_CHECK(remoteWatcher != nullptr, return -1, "Can not find remote watcher %d", remoteWatcherId);
97 WATCHER_CHECK(remoteWatcher->CheckAgent(GetCallingPid()), return 0,
98 "Can not find watcher %u calling %u", remoteWatcher->GetAgentId(), static_cast<uint32_t>(GetCallingPid()));
104 AddParamWatcher(group, remoteWatcher);
122 auto remoteWatcher = GetRemoteWatcher(remoteWatcherId);
123 WATCHER_CHECK(remoteWatcher != nullptr, return 0, "Can not find watcher %s %d", keyPrefix.c_str(), remoteWatcherId);
124 WATCHER_CHECK(remoteWatcher->CheckAgent(GetCallingPid()), return -1,
125 "Can not find watcher %u calling %u", remoteWatcher->GetAgentId(), static_cast<uint32_t>(GetCallingPid()));
129 DelParamWatcher(group, remoteWatcher);
143 auto remoteWatcher = GetRemoteWatcher(remoteWatcherId);
144 WATCHER_CHECK(remoteWatcher != nullptr, return 0, "Can not find watcher %s %d", keyPrefix.c_str(), remoteWatcherId);
145 WATCHER_CHECK(remoteWatcher->CheckAgent(GetCallingPid()), return 0,
146 "Can not find watcher %u calling %d", remoteWatcher->GetAgentId(), static_cast<uint32_t>(GetCallingPid()));
186 auto remoteWatcher = mananger->GetRemoteWatcher(node->GetNodeId());
187 if (remoteWatcher == nullptr) {
190 WATCHER_LOGI("ProcessParameterChange key '%s' pid: %d", GetKeyPrefix().c_str(), remoteWatcher->GetAgentId());
191 remoteWatcher->ProcessParameterChange(GetKeyPrefix(), name, value);
251 auto remoteWatcher = context->watcherManagerPtr->GetRemoteWatcher(context->remoteWatcherId);
252 if (remoteWatcher == nullptr) {
255 remoteWatcher->ProcessParameterChange(
381 RemoteWatcherPtr remoteWatcher = ConvertTo<RemoteWatcher>(node);
382 OnRemoteDied(remoteWatcher);
393 auto remoteWatcher = GetRemoteWatcher(remote);
394 WATCHER_CHECK(remoteWatcher != nullptr, return, "Failed to get remote watcher info ");
396 OnRemoteDied(remoteWatcher);
400 void WatcherManager::OnRemoteDied(RemoteWatcherPtr remoteWatcher)
402 WATCHER_CHECK(remoteWatcher != nullptr, return, "Invalid remote obj");
403 WATCHER_LOGI("Agent died %u %u", remoteWatcher->GetRemoteWatcherId(), remoteWatcher->GetAgentId());
404 remoteWatcher->TraversalNodeSafe(
405 [this, remoteWatcher](ParamWatcherListPtr list, WatcherNodePtr node, uint32_t index) {
411 DelParamWatcher(group, remoteWatcher);
417 DelRemoteWatcher(remoteWatcher);
424 RemoteWatcherPtr remoteWatcher = ConvertTo<RemoteWatcher>(node);
425 if (remoteWatcher == nullptr) {
428 if (remote == remoteWatcher->GetWatcher()->AsObject()) {
429 return remoteWatcher;
501 auto remoteWatcher = GetRemoteWatcher(node->GetNodeId());
502 if (remoteWatcher != nullptr) {
504 node->GetNodeId(), remoteWatcher->GetAgentId());
538 auto remoteWatcher = ConvertTo<RemoteWatcher>(node);
539 WATCHER_LOGV("Delete remote watcher %u", remoteWatcher->GetRemoteWatcherId());
540 delete remoteWatcher;
548 int WatcherManager::AddRemoteWatcher(RemoteWatcherPtr remoteWatcher)
554 return remoteWatchers_->AddNode(ConvertTo<WatcherNode>(remoteWatcher));
567 void WatcherManager::DelRemoteWatcher(RemoteWatcherPtr remoteWatcher)
570 remoteWatchers_->RemoveNode(ConvertTo<WatcherNode>(remoteWatcher));
571 delete remoteWatcher;
574 int WatcherManager::AddParamWatcher(WatcherGroupPtr group, RemoteWatcherPtr remoteWatcher)
578 WatcherNodePtr nodeRemote = new ParamWatcher(remoteWatcher->GetRemoteWatcherId());
582 remoteWatcher->AddNode(nodeGroup);
586 int WatcherManager::DelParamWatcher(WatcherGroupPtr group, RemoteWatcherPtr remoteWatcher)
589 remoteWatcher->GetRemoteWatcherId(), group->GetGroupId());
590 WatcherNodePtr node = group->GetNode(remoteWatcher->GetRemoteWatcherId());
595 node = remoteWatcher->GetNode(group->GetGroupId());
597 remoteWatcher->RemoveNode(node);