本文整理汇总了C++中ice::CommunicatorHolder::getPluginManager方法的典型用法代码示例。如果您正苦于以下问题:C++ CommunicatorHolder::getPluginManager方法的具体用法?C++ CommunicatorHolder::getPluginManager怎么用?C++ CommunicatorHolder::getPluginManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ice::CommunicatorHolder
的用法示例。
在下文中一共展示了CommunicatorHolder::getPluginManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createTestProperties
void
Server::run(int argc, char** argv)
{
#ifdef ICE_STATIC_LIBS
Ice::registerPluginFactory("Test", createTestTransport, false);
#endif
Ice::PropertiesPtr properties = createTestProperties(argc, argv);
//
// This test kills connections, so we don't want warnings.
//
properties->setProperty("Ice.Warn.Connections", "0");
properties->setProperty("Ice.MessageSizeMax", "50000");
//
// This test relies on filling the TCP send/recv buffer, so
// we rely on a fixed value for these buffers.
//
properties->setProperty("Ice.TCP.RcvSize", "50000");
//
// Setup the test transport plug-in.
//
properties->setProperty("Ice.Plugin.Test", "TestTransport:createTestTransport");
string defaultProtocol = properties->getPropertyWithDefault("Ice.Default.Protocol", "tcp");
properties->setProperty("Ice.Default.Protocol", "test-" + defaultProtocol);
Ice::CommunicatorHolder communicator = initialize(argc, argv, properties);
communicator->getProperties()->setProperty("TestAdapter.Endpoints", getTestEndpoint(0));
communicator->getProperties()->setProperty("ControllerAdapter.Endpoints", getTestEndpoint(1, "tcp"));
communicator->getProperties()->setProperty("ControllerAdapter.ThreadPool.Size", "1");
Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter");
Ice::ObjectAdapterPtr adapter2 = communicator->createObjectAdapter("ControllerAdapter");
#ifdef ICE_CPP11_MAPPING
shared_ptr<PluginI> plugin = dynamic_pointer_cast<PluginI>(communicator->getPluginManager()->getPlugin("Test"));
#else
PluginI* plugin = dynamic_cast<PluginI*>(communicator->getPluginManager()->getPlugin("Test").get());
#endif
assert(plugin);
ConfigurationPtr configuration = plugin->getConfiguration();
BackgroundControllerIPtr backgroundController = ICE_MAKE_SHARED(BackgroundControllerI, adapter, configuration);
adapter->add(ICE_MAKE_SHARED(BackgroundI, backgroundController), Ice::stringToIdentity("background"));
adapter->add(ICE_MAKE_SHARED(LocatorI, backgroundController), Ice::stringToIdentity("locator"));
adapter->add(ICE_MAKE_SHARED(RouterI, backgroundController), Ice::stringToIdentity("router"));
adapter->activate();
adapter2->add(backgroundController, Ice::stringToIdentity("backgroundController"));
adapter2->activate();
communicator->waitForShutdown();
}