IceManager.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package ArmarXCore::core
19  * @author Nils Adermann (naderman at naderman dot de)
20  * @author Jan Issac (jan dot issac at gmx dot de)
21  * @date 2010
22  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
23  * GNU General Public License
24  */
25 
26 #include <Ice/Current.h> // for Current
27 #include <Ice/DispatchInterceptor.h> // for DispatchInterceptor, etc
28 #include <Ice/Initialize.h> // for stringToIdentity
29 #include <Ice/LocalException.h> // for AlreadyRegisteredException, etc
30 #include <Ice/Object.h> // for DispatchStatus, Object, etc
31 #include <Ice/ObjectAdapter.h> // for ObjectAdapterPtr, etc
32 #include <Ice/ProxyHandle.h> // for ProxyHandle
33 #include <IceGrid/Admin.h> // for AdminPrx, Admin
34 #include <IceUtil/Thread.h> // for ThreadControl
35 #include <IceUtil/Time.h> // for Time
36 #include <IceUtil/UUID.h> // for Time
37 #include <IceStorm/IceStorm.h> // for TopicPrx, TopicManagerPrx, etc
38 
39 #include <IceGrid/Registry.h> // for RegistryPrx
40 
41 #include <ArmarXCore/core/IceGridAdmin.h> // for IceGridAdmin
43 #include <ArmarXCore/interface/core/UserException.h> // for UserException
44 #include <ArmarXCore/core/logging/LogSender.h> // for LogSender, flush
45 #include <ArmarXCore/core/logging/Logging.h> // for ARMARX_INFO, etc
46 #include "IceGridAdmin.h" // for IceGridAdmin
47 #include "IceManager.h"
48 #include "IceManagerImpl.h"
49 
50 
51 namespace IceGrid
52 {
53  class DeploymentException;
54  class ObjectNotRegisteredException;
55 } // namespace IceGrid
56 
57 namespace armarx
58 {
59  IceManager::IceManager(const Ice::CommunicatorPtr& communicator, std::string name, const std::string topicSuffix)
60  : impl(new Impl)
61  {
62  impl->communicator = communicator;
63  impl->name = name;
64  impl->topicSuffix = topicSuffix;
65  impl->forceShutdown = false;
66  setTag("IceManager");
67  }
68 
70  {
71  destroy();
72  }
73 
74  class ExeceptionHandlingInterceptor : public Ice::DispatchInterceptor
75  {
76  public:
78  : _servant(servant) {}
79 
80  bool dispatch(Ice::Request& request) override
81  {
82  try
83  {
84  return _servant->ice_dispatch(request);
85  }
86  catch (...)
87  {
88 
89  ARMARX_WARNING << deactivateSpam(30, request.getCurrent().operation + request.getCurrent().id.name) << "Calling interface function '" << request.getCurrent().operation << "' of object '" << request.getCurrent().id.name << "' failed:\n" << GetHandledExceptionString();
90  throw;
91  }
92  }
93 
95 
96  };
97 
98 
100  const std::string& objectName,
101  const Ice::ObjectAdapterPtr& adapterToAddTo)
102  {
103  std::unique_lock lock(impl->objectRegistryMutex);
104 
105  if (isObjectReachable(objectName))
106  {
107  throw Ice::AlreadyRegisteredException(__FILE__, __LINE__, object->ice_id(), objectName);
108  }
109 
110  ObjectEntryPtr objectEntry = getOrCreateObjectEntry(objectName);
111 
112  objectEntry->id = Ice::stringToIdentity(objectName);
113 
114  if (adapterToAddTo)
115  {
116  objectEntry->adapter = adapterToAddTo;
117  objectEntry->ownAdapter = false;
118  }
119  else
120  {
121  objectEntry->adapter =
123  ->createObjectAdapterWithEndpoints(objectName, "tcp");
124  objectEntry->adapter->activate();
125  objectEntry->ownAdapter = true;
126  }
127 
128 
129  Ice::DispatchInterceptorPtr interceptor = new ExeceptionHandlingInterceptor(object);
130  objectEntry->adapter->add(interceptor, objectEntry->id);
131  objectEntry->proxy = objectEntry->adapter->createProxy(objectEntry->id);
132 
133 
134 
135 
137  << objectEntry->name
138  << " registered"
139  << flush;
140 
141  return ObjectHandles(objectEntry->proxy, objectEntry->adapter);
142  }
143 
144 
145  void IceManager::removeObject(const std::string& objectName)
146  {
147  IceGrid::AdminPrx admin = getIceGridSession()->getAdmin();
148 
149  std::unique_lock lock(impl->objectRegistryMutex);
150  {
151  auto objectIt = impl->objectRegistry.find(objectName);
152 
153  if (objectIt != impl->objectRegistry.end())
154  {
155  try
156  {
157  ObjectEntryPtr objectEntry = objectIt->second;
158  Ice::ObjectAdapterPtr adapter = objectIt->second->adapter;
159 
160  for (auto& topic : objectEntry->usedTopics)
161  {
162  unsubscribeTopic(objectEntry->proxy, topic);
163  }
164 
165  if (adapter)
166  {
167  if (objectEntry->ownAdapter)
168  {
169  adapter->destroy();
170  }
171  else if (!adapter->isDeactivated())
172  {
173  adapter->remove(objectEntry->id);
174  }
175  }
176 
177 
178  // objectIt->second->adapter->remove(objectIt->second->id); // deactivate object adapter
179  ARMARX_VERBOSE << "removing object from ice: " << objectName << " with id: " << objectIt->second->id.name;
180  admin->removeObject(objectIt->second->id);
181  }
182  catch (IceGrid::ObjectNotRegisteredException& notRegisteredException)
183  {
184  // removing an unregistered object
185  // //!!!
186  // ARMARX_ERROR << "*** ARMARX_ERROR: IceManager >> removing "
187  // << objectName
188  // << " object failed due to ObjectNotRegisteredException"
189  // << flush;
190 
191  }
192  catch (IceGrid::DeploymentException& deploymentException)
193  {
194  // cannot remove object due to deployment
195  ARMARX_ERROR << "*** removing "
196  << objectName
197  << " object failed due to DeploymentException"
198  << flush;
199  }
200  catch (Ice::ObjectAdapterDeactivatedException& e)
201  {
202  ARMARX_INFO << "ObjectAdapterDeactivatedException for " << objectIt->second->id.name;
203  }
204 
205  impl->objectRegistry.erase(objectIt);
206  }
207  }
208  }
209 
210  void IceManager::throwUserException(const std::string& message)
211  {
212  throw armarx::UserException(message);
213  }
214 
215  bool IceManager::removeProxyFromCache(const std::string& name, const std::string& typeName, const std::string& endpoints)
216  {
217  std::string proxyString = name;
218 
219  if (!endpoints.empty())
220  {
221  proxyString += std::string(":") + endpoints;
222  }
223 
224  std::string proxyTypedId =
225  proxyString
226  + std::string(":")
227  + typeName;
228  return (impl->checkedProxies.erase(proxyTypedId) > 0);
229  }
230 
231 
232 
233  bool IceManager::removeProxyFromCache(const Ice::ObjectPrx& proxy)
234  {
235  if (!proxy)
236  {
237  return false;
238  }
239  for (auto& proxyEntry : impl->checkedProxies)
240  {
241  if (proxyEntry.second == proxy)
242  {
243  impl->checkedProxies.erase(proxyEntry.first);
244  return true;
245  }
246  }
247  return false;
248  }
249 
250 
252  {
253  std::unique_lock lock(impl->topicManagerMutex);
254 
255  if (!impl->topicManagerProxy)
256  {
257  impl->topicManagerProxy = GetTopicManager(getCommunicator());
258  }
259 
260  return impl->topicManagerProxy;
261  }
262 
264  {
265  Ice::ObjectPrx obj = communicator->stringToProxy("IceStorm/TopicManager");
266 
267  return IceStorm::TopicManagerPrx::checkedCast(obj);
268  }
269 
270 
271  void IceManager::subscribeTopic(Ice::ObjectPrx subscriberProxy,
272  const std::string& topicName,
273  bool orderedPublishing)
274  {
275  IceStorm::TopicPrx topic = retrieveTopic(topicName);
276 
277  IceStorm::QoS qos;
278  // // ensure ordered. If CPU is heavily used, the messages might arrive out of sequence even with one publisher if not enabled
279  // // might be a performance issue. But as long as this is not proved leave ordered in order to prevent unexpected behavior (as publishers would assume blocking calls)
280  if (orderedPublishing)
281  {
282  qos["reliability"] = "ordered";
283  }
284 
285  try
286  {
287  topic->subscribeAndGetPublisher(qos, orderedPublishing ? subscriberProxy : subscriberProxy->ice_oneway());
288  }
289  catch (IceStorm::AlreadySubscribed& e)
290  {
291  try
292  {
293  unsubscribeTopic(subscriberProxy, topicName);
294  topic->subscribeAndGetPublisher(qos, orderedPublishing ? subscriberProxy : subscriberProxy->ice_oneway());
295  }
296  catch (IceStorm::AlreadySubscribed& e)
297  {
299  << topicName
300  << " already subscribed"
301  << flush;
302  }
303  }
304 
305  ARMARX_INFO << "Subscribed to topic " << topicName;
306  std::unique_lock lock(impl->topicSubscriptionMutex);
307  {
308  impl->subscriptions.push_back(std::make_pair(topicName, subscriberProxy));
309  }
310  }
311 
312  void IceManager::registerAndSubscribeTopic(Ice::ObjectPtr subscriber, const std::string& topicName, bool orderedPublishing)
313  {
314  auto prx = registerObject(subscriber, topicName + "Listener" + IceUtil::generateUUID());
315  subscribeTopic(prx.first, topicName, orderedPublishing);
316  }
317 
318  void IceManager::unsubscribeTopic(Ice::ObjectPrx subscriberProxy,
319  const std::string& topicName)
320  {
321  IceStorm::TopicPrx topic = retrieveTopic(topicName);
322 
323  topic->unsubscribe(subscriberProxy);
324  ARMARX_INFO << "Unsubscribed from topic " << topicName;
325  std::unique_lock lock(impl->topicSubscriptionMutex);
326  {
327  std::vector<std::pair<std::string, Ice::ObjectPrx> >::iterator toDelete = impl->subscriptions.end();
328  std::vector<std::pair<std::string, Ice::ObjectPrx> >::iterator it;
329 
330  for (it = impl->subscriptions.begin(); it != impl->subscriptions.end(); ++it)
331  {
332  if (it->first == topicName && it->second == subscriberProxy)
333  {
334  toDelete = it;
335  }
336  }
337 
338  // we have to check because an old component which is not in our list might still be subscribed
339  if (toDelete != impl->subscriptions.end())
340  {
341  impl->subscriptions.erase(toDelete);
342  }
343  }
344  }
345 
346  IceStorm::TopicPrx IceManager::retrieveTopic(const std::string& name)
347  {
348  auto topicName = name + getTopicSuffix();
349  std::unique_lock lock(impl->topicRetrievalMutex);
350 
351  IceStorm::TopicPrx& topic = impl->topics[topicName];
352 
353  while (!isShutdown() && !topic)
354  {
355  try
356  {
357  topic = getTopicManager()->retrieve(topicName);
358  }
359  catch (const IceStorm::NoSuchTopic&)
360  {
361  try
362  {
363  //this also adds to the map
364  topic = getTopicManager()->create(topicName);
365  ARMARX_INFO << "Topic " << topicName << " created " << flush;
366  }
367  catch (const IceStorm::TopicExists&)
368  {
369  // if the topic has been created in the meanwhile (retry via while)
370  }
371  }
372  }
373 
374  return topic;
375  }
376 
377  Ice::ObjectPrx IceManager::implGetCheckedProxy(std::string const& proxyTypedId)
378  {
379  std::unique_lock lock(impl->proxyCacheMutex);
380  return impl->checkedProxies.at(proxyTypedId);
381  }
382 
383  void IceManager::implSetCheckedProxy(std::string const& proxyTypedId, const Ice::ObjectPrx& proxy)
384  {
385  std::unique_lock lock(impl->proxyCacheMutex);
386  impl->checkedProxies[proxyTypedId] = proxy;
387  }
388 
390  {
391  cleanUp();
392 
393  getCommunicator()->shutdown();
394  }
395 
396 
398  {
399  getCommunicator()->waitForShutdown();
400  }
401 
402 
404  {
405  return getCommunicator()->isShutdown();
406  }
407 
408 
410  {
411  if (impl->iceGridAdmin)
412  {
413  impl->iceGridAdmin->stop();
414  }
415 
416  getCommunicator()->destroy();
417  }
418 
419  std::string IceManager::getTopicSuffix() const
420  {
421  return impl->topicSuffix;
422  }
423 
424  Ice::ObjectPrx IceManager::communicator_stringToProxy(const std::string& proxyString)
425  {
426  return getCommunicator()->stringToProxy(proxyString);
427  }
428 
429  Ice::ObjectPrx IceManager::__getTopic(const std::string& topicName, bool useUDP)
430  {
431  IceStorm::TopicPrx topic = retrieveTopic(topicName);
432 
433  auto prx = topic->getPublisher();
434  if (useUDP)
435  {
436  prx = prx->ice_datagram();
437  }
438  else
439  {
440  prx = prx->ice_oneway();
441  }
442  return prx;
443  }
444 
445 
446  void IceManager::cleanUp()
447  {
448  ARMARX_DEBUG << " *** CLEAN UP ***" << flush;
449 
450  // unsubscribe all and remove all objects
451  if (getCommunicator())
452  {
453  IceGrid::AdminPrx admin = getIceGridSession()->getAdmin();
454  std::vector<std::pair<std::string, Ice::ObjectPrx> >::iterator it;
455 
456  {
457  /* topicSubscription lock scope */
458  std::unique_lock lock(impl->topicSubscriptionMutex);
459  {
460  for (it = impl->subscriptions.begin(); it != impl->subscriptions.end(); ++it)
461  {
462  retrieveTopic(it->first)->unsubscribe(it->second);
463  }
464 
465  impl->subscriptions.clear();
466  }
467  }
468 
469  std::unique_lock lock(impl->objectRegistryMutex);
470  {
471  auto objListIt = impl->objectRegistry.begin();
472 
473  for (; objListIt != impl->objectRegistry.end(); ++objListIt)
474  {
475  try
476  {
477  objListIt->second->adapter->deactivate();
478  // objListIt->second->adapter->remove(objListIt->second->id); // deactivate object adapter
479  admin->removeObject(objListIt->second->id);
480  }
481  catch (...)
482  {
483  }
484  }
485  }
486 
487  if (impl->iceGridAdmin)
488  {
489  impl->iceGridAdmin->removeObservers();
490  }
491  }
492  }
493 
494 
496  const std::string& registrantName,
497  const std::string& dependencyObjectName)
498  {
499  std::unique_lock lock(impl->objectRegistryMutex);
500  {
501  ObjectEntryPtr objectEntry = getOrCreateObjectEntry(registrantName);
502 
503  objectEntry->dependencies.push_back
504  (
505  new DependencyObjectEntry
506  (
507  dependencyObjectName,
508  getCommunicator()->stringToProxy(dependencyObjectName)
509  )
510  );
511  }
512  }
513 
514 
515  void IceManager::resolveObjectDependencies()
516  {
517  auto objectIt = impl->objectRegistry.begin();
518 
519  for (; objectIt != impl->objectRegistry.end(); ++objectIt)
520  {
521  std::string missingObjects;
522  ObjectEntryPtr objectEntry = objectIt->second;
523 
524  if (!objectEntry->active && objectEntry->proxy)
525  {
526  objectEntry->dependenciesResolved = true;
527  DependencyList::iterator depIt = objectEntry->dependencies.begin();
528 
529  for (; depIt != objectEntry->dependencies.end(); ++depIt)
530  {
531  DependencyObjectEntryPtr dependencyEntry = *depIt;
532 
533  if (!dependencyEntry->resolved)
534  {
535  try
536  {
537  dependencyEntry->proxy->ice_timeout(2000)->ice_ping();
538 
540  << objectEntry->name
541  << " found "
542  << dependencyEntry->name
543  << flush;
544 
545  dependencyEntry->resolved = true;
546 
547  objectEntry->updated = true;
548  }
549  catch (...)
550  {
551  objectEntry->dependenciesResolved = false;
552 
553  missingObjects += "\t" + dependencyEntry->name + "\n";
554  }
555 
556  IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(10));
557  }
558  }
559  }
560 
561  if (objectEntry->updated)
562  {
563  if (missingObjects.length() > 0)
564  {
566  << objectEntry->name
567  << " still waiting for:\n"
568  << missingObjects
569  << flush;
570  }
571 
572  objectEntry->updated = false;
573 
574  if (objectEntry->dependenciesResolved)
575  {
576  ARMARX_INFO << " all "
577  << objectEntry->name
578  << " dependencies resolved"
579  << flush;
580  }
581  }
582  }
583  }
584 
585 
587  const std::string& registrantName,
588  const std::string& topicName)
589  {
590  std::unique_lock lock(impl->objectRegistryMutex);
591 
592  ObjectEntryPtr objectEntry = getOrCreateObjectEntry(registrantName);
593 
594  objectEntry->usedTopics.push_back(topicName);
595  }
596 
597 
599  const std::string& registrantName,
600  const std::string& topicName)
601  {
602  std::unique_lock lock(impl->objectRegistryMutex);
603 
604  ObjectEntryPtr objectEntry = getOrCreateObjectEntry(registrantName);
605 
606  objectEntry->offeredTopics.push_back(topicName);
607  }
608 
609 
610  void IceManager::subscribeTopics(Ice::ObjectPrx subscriber, const TopicList& topics, bool orderedPublishing)
611  {
612  TopicList::const_iterator it = topics.begin();
613 
614  for (; it != topics.end(); ++it)
615  {
616  subscribeTopic(subscriber, *it, orderedPublishing);
617  }
618 
619  }
620 
621 
622  void IceManager::retrieveTopics(const TopicList& topics)
623  {
624  TopicList::const_iterator it = topics.begin();
625 
626  for (; it != topics.end(); ++it)
627  {
628  retrieveTopic(*it);
629  }
630  }
631 
632 
633  void IceManager::setName(std::string name)
634  {
635  this->impl->name = name;
636  }
637 
638 
640  {
641  return impl->communicator;
642  }
643 
644 
646  {
647  std::unique_lock lock(impl->iceGridAdminMutex);
648 
649  if (!impl->iceGridAdmin)
650  {
651  impl->iceGridAdmin = IceGridAdmin::Create(getCommunicator(), impl->name);
652  }
653 
654  return impl->iceGridAdmin;
655  }
656 
657 
659  {
660  return getIceGridSession()->registry();
661  }
662 
663 
665  IceManager::getOrCreateObjectEntry(const std::string& objectName)
666  {
667  auto objIt = impl->objectRegistry.find(objectName);
668 
669  if (objIt == impl->objectRegistry.end() || objIt->second->name.empty())
670  {
671  ObjectEntryPtr objectEntry = new ObjectEntry();
672  objectEntry->name = objectName;
673 
674  impl->objectRegistry[objectName] = objectEntry;
675 
676  return objectEntry;
677  }
678 
679  return objIt->second;
680  }
681 
682 
683 
684  bool IceManager::isObjectReachable(std::string objectName)
685  {
686  try
687  {
688  Ice::ObjectPrx prx = getProxy<Ice::ObjectPrx>(objectName);
689  prx->ice_timeout(500)->ice_ping();
690  return true; // if ping'able, object is already registered
691  // throw Ice::AlreadyRegisteredException(__FILE__,__LINE__, object->ice_id(), object->getName());
692  }
693  catch (...)
694  {
695 
696  return false;
697  }
698  }
699 }
armarx::ExeceptionHandlingInterceptor::ExeceptionHandlingInterceptor
ExeceptionHandlingInterceptor(const Ice::ObjectPtr &servant)
Definition: IceManager.cpp:77
ARMARX_VERBOSE
#define ARMARX_VERBOSE
Definition: Logging.h:180
armarx::IceManager::registerObject
ObjectHandles registerObject(const Ice::ObjectPtr &object, const std::string &objectName, const Ice::ObjectAdapterPtr &adapterToAddTo=nullptr)
Register an object with Ice for being accessed through IceGrid.
Definition: IceManager.cpp:99
armarx::ExeceptionHandlingInterceptor
Definition: IceManager.cpp:74
armarx::IceManager::isObjectReachable
bool isObjectReachable(std::string objectName)
creates a proxy to the object specified with parameter objectName and tries to ping it.
Definition: IceManager.cpp:684
message
message(STATUS "Boost-Library-Dir: " "${Boost_LIBRARY_DIRS}") message(STATUS "Boost-LIBRARIES
Definition: CMakeLists.txt:8
armarx::IceManager::removeObject
void removeObject(const std::string &objectName)
Removes an object from the IceGrid.
Definition: IceManager.cpp:145
armarx::IceManager::removeProxyFromCache
bool removeProxyFromCache(const std::string &name, const std::string &endpoints=std::string())
This functions removes the given proxy from the proxy cache.
Definition: IceManager.h:222
armarx::IceManager::Impl
Definition: IceManagerImpl.h:13
IceInternal::Handle< ::Ice::Communicator >
armarx::ExeceptionHandlingInterceptor::dispatch
bool dispatch(Ice::Request &request) override
Definition: IceManager.cpp:80
deactivateSpam
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
Definition: Logging.cpp:72
armarx::GetHandledExceptionString
std::string GetHandledExceptionString()
Definition: Exception.cpp:147
armarx::IceManager::isShutdown
bool isShutdown()
Determines whether the communicator is shutdown.
Definition: IceManager.cpp:403
armarx::IceManager::IceManager
IceManager(const Ice::CommunicatorPtr &communicator, std::string name="", const std::string topicSuffix="")
Set up an instance of this class with a preexisting communicator.
Definition: IceManager.cpp:59
armarx::IceManager::registerObjectDependency
void registerObjectDependency(const std::string &registrantName, const std::string &dependencyObjectName)
Registers a specified object that is required before activating the endpoints.
Definition: IceManager.cpp:495
armarx::flush
const LogSender::manipulator flush
Definition: LogSender.h:251
IceManagerImpl.h
ARMARX_DEBUG
#define ARMARX_DEBUG
Definition: Logging.h:177
armarx::IceManager::setName
void setName(std::string name)
Sets the session name.
Definition: IceManager.cpp:633
armarx::ProxyType::topic
@ topic
IceManager.h
IceGridAdmin.h
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
armarx::IceManager::throwUserException
void throwUserException(std::string const &message)
Definition: IceManager.cpp:210
armarx::IceManager::getTopicSuffix
std::string getTopicSuffix() const
Get the suffix that is appended to all topics.
Definition: IceManager.cpp:419
armarx::IceManager::destroy
void destroy()
Destroys the communicator.
Definition: IceManager.cpp:409
armarx::IceManager::unsubscribeTopic
void unsubscribeTopic(Ice::ObjectPrx subscriberProxy, const std::string &topicName)
Unsubscribe a given subscriber from a given topic.
Definition: IceManager.cpp:318
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::IceManager::getTopicManager
IceStorm::TopicManagerPrx getTopicManager()
Provides access to the Ice Storm Topic Manager.
Definition: IceManager.cpp:251
IceUtil::Handle
Definition: forward_declarations.h:29
armarx::IceManager::getCommunicator
const Ice::CommunicatorPtr & getCommunicator()
Short helper method to return the Ice Communicator.
Definition: IceManager.cpp:639
LogSender.h
IceInternal::ProxyHandle< ::IceProxy::IceStorm::TopicManager >
armarx::IceManager::getIceGridRegistry
IceGrid::RegistryPrx getIceGridRegistry()
Provides access to the IceGrid Registry.
Definition: IceManager.cpp:658
armarx::IceManager::~IceManager
~IceManager() override
Definition: IceManager.cpp:69
armarx::IceManager::shutdown
void shutdown()
Removes all component objects and topics and shuts down the communicator.
Definition: IceManager.cpp:389
armarx::IceManager::GetTopicManager
static IceStorm::TopicManagerPrx GetTopicManager(Ice::CommunicatorPtr communicator)
Definition: IceManager.cpp:263
armarx::ExeceptionHandlingInterceptor::_servant
Ice::ObjectPtr _servant
Definition: IceManager.cpp:94
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
armarx::Logging::setTag
void setTag(const LogTag &tag)
Definition: Logging.cpp:55
IceGrid
Definition: IceManager.cpp:51
Logging.h
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::IceManager::waitForShutdown
void waitForShutdown()
Waits until all invoked operation has been processed.
Definition: IceManager.cpp:397
armarx::IceManager::registerDelayedTopicRetrieval
void registerDelayedTopicRetrieval(const std::string &registrantName, const std::string &topicName)
Registers a delayed topic retrieval.
Definition: IceManager.cpp:598
armarx::ObjectHandles
std::pair< Ice::ObjectPrx, Ice::ObjectAdapterPtr > ObjectHandles
Object handles pair which contains the object proxy and its adapter.
Definition: IceManager.h:97
armarx::IceManager::subscribeTopic
void subscribeTopic(Ice::ObjectPrx subscriber, const std::string &topicName, bool orderedPublishing=false)
Subscribe an object to a particular Ice Storm topic.
Definition: IceManager.cpp:271
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
Exception.h
armarx::IceManager::registerAndSubscribeTopic
void registerAndSubscribeTopic(Ice::ObjectPtr subscriber, const std::string &topicName, bool orderedPublishing=false)
Definition: IceManager.cpp:312
armarx::IceManager::getIceGridSession
const armarx::IceGridAdminPtr & getIceGridSession()
Provides access to the IceGrid AdminSession via IceGridAdmin.
Definition: IceManager.cpp:645
armarx::IceManager::registerDelayedTopicSubscription
void registerDelayedTopicSubscription(const std::string &registrantName, const std::string &topicName)
Registers a delayed topic subscription.
Definition: IceManager.cpp:586