本文整理汇总了C++中ice::ObjectPrxPtr::ice_getEndpoints方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPrxPtr::ice_getEndpoints方法的具体用法?C++ ObjectPrxPtr::ice_getEndpoints怎么用?C++ ObjectPrxPtr::ice_getEndpoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::ObjectPrxPtr
的用法示例。
在下文中一共展示了ObjectPrxPtr::ice_getEndpoints方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: out
void
ObjectAdapterI::updateLocatorRegistry(const IceInternal::LocatorInfoPtr& locatorInfo, const Ice::ObjectPrxPtr& proxy)
{
if(_id.empty() || !locatorInfo)
{
return; // Nothing to update.
}
LocatorRegistryPrxPtr locatorRegistry = locatorInfo->getLocatorRegistry();
if(!locatorRegistry)
{
return;
}
try
{
if(_replicaGroupId.empty())
{
locatorRegistry->setAdapterDirectProxy(_id, proxy);
}
else
{
locatorRegistry->setReplicatedAdapterDirectProxy(_id, _replicaGroupId, proxy);
}
}
catch(const AdapterNotFoundException&)
{
if(_instance->traceLevels()->location >= 1)
{
Trace out(_instance->initializationData().logger, _instance->traceLevels()->locationCat);
out << "couldn't update object adapter `" + _id + "' endpoints with the locator registry:\n";
out << "the object adapter is not known to the locator registry";
}
throw NotRegisteredException(__FILE__, __LINE__, "object adapter", _id);
}
catch(const InvalidReplicaGroupIdException&)
{
if(_instance->traceLevels()->location >= 1)
{
Trace out(_instance->initializationData().logger, _instance->traceLevels()->locationCat);
out << "couldn't update object adapter `" + _id + "' endpoints with the locator registry:\n";
out << "the replica group `" << _replicaGroupId << "' is not known to the locator registry";
}
throw NotRegisteredException(__FILE__, __LINE__, "replica group", _replicaGroupId);
}
catch(const AdapterAlreadyActiveException&)
{
if(_instance->traceLevels()->location >= 1)
{
Trace out(_instance->initializationData().logger, _instance->traceLevels()->locationCat);
out << "couldn't update object adapter `" + _id + "' endpoints with the locator registry:\n";
out << "the object adapter endpoints are already set";
}
throw ObjectAdapterIdInUseException(__FILE__, __LINE__, _id);
}
catch(const ObjectAdapterDeactivatedException&)
{
// Expected if collocated call and OA is deactivated, ignore.
}
catch(const CommunicatorDestroyedException&)
{
// Ignore.
}
catch(const LocalException& ex)
{
if(_instance->traceLevels()->location >= 1)
{
Trace out(_instance->initializationData().logger, _instance->traceLevels()->locationCat);
out << "couldn't update object adapter `" + _id + "' endpoints with the locator registry:\n" << ex;
}
throw; // TODO: Shall we raise a special exception instead of a non obvious local exception?
}
if(_instance->traceLevels()->location >= 1)
{
Trace out(_instance->initializationData().logger, _instance->traceLevels()->locationCat);
out << "updated object adapter `" + _id + "' endpoints with the locator registry\n";
out << "endpoints = ";
if(proxy)
{
EndpointSeq endpts = proxy ? proxy->ice_getEndpoints() : EndpointSeq();
ostringstream o;
transform(endpts.begin(), endpts.end(), ostream_iterator<string>(o, endpts.size() > 1 ? ":" : ""),
Ice::constMemFun(&Endpoint::toString));
out << o.str();
}
}
}