本文整理汇总了C++中ice::ObjectAdapterPtr::createIndirectProxy方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectAdapterPtr::createIndirectProxy方法的具体用法?C++ ObjectAdapterPtr::createIndirectProxy怎么用?C++ ObjectAdapterPtr::createIndirectProxy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::ObjectAdapterPtr
的用法示例。
在下文中一共展示了ObjectAdapterPtr::createIndirectProxy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: e
//.........这里部分代码省略.........
Ice::Identity id;
id.category = instanceName;
id.name = os.str();
nodes[nodeid] = NodePrx::uncheckedCast((*p)->ice_adapterId(adapterid)->ice_identity(id));
}
}
if(nodes.size() < 3)
{
Ice::Error error(communicator->getLogger());
error << "Replication requires at least 3 Nodes";
throw IceBox::FailureException(__FILE__, __LINE__, "Replication requires at least 3 Nodes");
}
try
{
// If the node thread pool size is not set then initialize
// to the number of nodes + 1 and disable thread pool size
// warnings.
if(properties->getProperty(name + ".Node.ThreadPool.Size").empty())
{
ostringstream os;
os << nodes.size() + 1;
properties->setProperty(name + ".Node.ThreadPool.Size", os.str());
properties->setProperty(name + ".Node.ThreadPool.SizeWarn", "0");
}
if(properties->getProperty(name + ".Node.MessageSizeMax").empty())
{
properties->setProperty(name + ".Node.MessageSizeMax", "0"); // No limit on data exchanged internally
}
Ice::ObjectAdapterPtr nodeAdapter = communicator->createObjectAdapter(name + ".Node");
_instance = new Instance(instanceName, name, communicator, publishAdapter, topicAdapter,
nodeAdapter, nodes[id]);
_instance->observers()->setMajority(static_cast<unsigned int>(nodes.size())/2);
// Trace replication information.
TraceLevelsPtr traceLevels = _instance->traceLevels();
if(traceLevels->election > 0)
{
Ice::Trace out(traceLevels->logger, traceLevels->electionCat);
out << "I am node " << id << "\n";
for(map<int, NodePrx>::const_iterator p = nodes.begin(); p != nodes.end(); ++p)
{
out << "\tnode: " << p->first << " proxy: " << p->second->ice_toString() << "\n";
}
}
if(topicManagerAdapterId.empty())
{
// We're not using an IceGrid deployment. Here we need
// a proxy which is used to create proxies to the
// replicas later.
_managerProxy = TopicManagerPrx::uncheckedCast(topicAdapter->createProxy(topicManagerId));
}
else
{
// If we're using IceGrid deployment we need to create
// indirect proxies.
_managerProxy = TopicManagerPrx::uncheckedCast(topicAdapter->createIndirectProxy(topicManagerId));
}
_manager = new TopicManagerImpl(_instance);
topicAdapter->add(_manager->getServant(), topicManagerId);
ostringstream os; // The node object identity.
os << "node" << id;
Ice::Identity nodeid;
nodeid.category = instanceName;
nodeid.name = os.str();
NodeIPtr node = new NodeI(_instance, _manager, _managerProxy, id, nodes);
_instance->setNode(node);
nodeAdapter->add(node, nodeid);
nodeAdapter->activate();
node->start();
}
catch(const Ice::Exception& ex)
{
_instance = 0;
LoggerOutputBase s;
s << "exception while starting IceStorm service " << name << ":\n";
s << ex;
IceBox::FailureException e(__FILE__, __LINE__);
e.reason = s.str();
throw e;
}
}
topicAdapter->add(new FinderI(TopicManagerPrx::uncheckedCast(topicAdapter->createProxy(topicManagerId))),
communicator->stringToIdentity("IceStorm/Finder"));
topicAdapter->activate();
publishAdapter->activate();
}