本文整理汇总了C++中AdminPrx::getAllAdapterIds方法的典型用法代码示例。如果您正苦于以下问题:C++ AdminPrx::getAllAdapterIds方法的具体用法?C++ AdminPrx::getAllAdapterIds怎么用?C++ AdminPrx::getAllAdapterIds使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminPrx
的用法示例。
在下文中一共展示了AdminPrx::getAllAdapterIds方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test
void
allTests(const Ice::CommunicatorPtr& comm)
{
IceGrid::RegistryPrx registry = IceGrid::RegistryPrx::checkedCast(
comm->stringToProxy(comm->getDefaultLocator()->ice_getIdentity().category + "/Registry"));
test(registry);
IceGrid::QueryPrx query = IceGrid::QueryPrx::checkedCast(
comm->stringToProxy(comm->getDefaultLocator()->ice_getIdentity().category + "/Query"));
test(query);
AdminSessionPrx session = registry->createAdminSession("foo", "bar");
session->ice_getConnection()->setACM(registry->getACMTimeout(), IceUtil::None, Ice::HeartbeatAlways);
AdminPrx admin = session->getAdmin();
test(admin);
cout << "testing server registration... " << flush;
Ice::StringSeq serverIds = admin->getAllServerIds();
test(find(serverIds.begin(), serverIds.end(), "Server1") != serverIds.end());
test(find(serverIds.begin(), serverIds.end(), "Server2") != serverIds.end());
test(find(serverIds.begin(), serverIds.end(), "IceBox1") != serverIds.end());
test(find(serverIds.begin(), serverIds.end(), "IceBox2") != serverIds.end());
test(find(serverIds.begin(), serverIds.end(), "SimpleServer") != serverIds.end());
test(find(serverIds.begin(), serverIds.end(), "SimpleIceBox") != serverIds.end());
cout << "ok" << endl;
cout << "testing adapter registration... " << flush;
Ice::StringSeq adapterIds = admin->getAllAdapterIds();
test(find(adapterIds.begin(), adapterIds.end(), "Server1.Server") != adapterIds.end());
test(find(adapterIds.begin(), adapterIds.end(), "Server2.Server") != adapterIds.end());
test(find(adapterIds.begin(), adapterIds.end(), "SimpleServer.Server") != adapterIds.end());
test(find(adapterIds.begin(), adapterIds.end(), "IceBox1.Service1.Service1") != adapterIds.end());
test(find(adapterIds.begin(), adapterIds.end(), "IceBox1Service2Adapter") != adapterIds.end());
test(find(adapterIds.begin(), adapterIds.end(), "IceBox2.Service1.Service1") != adapterIds.end());
test(find(adapterIds.begin(), adapterIds.end(), "IceBox2Service2Adapter") != adapterIds.end());
test(find(adapterIds.begin(), adapterIds.end(), "SimpleIceBox.SimpleService.SimpleService") != adapterIds.end());
test(find(adapterIds.begin(), adapterIds.end(), "ReplicatedAdapter") != adapterIds.end());
cout << "ok" << endl;
cout << "testing object registration... " << flush;
Ice::ObjectProxySeq objs = query->findAllObjectsByType("::Test");
test(find_if(objs.begin(), objs.end(), bind2nd(ProxyIdentityEqual(comm),"Server1")) != objs.end());
test(find_if(objs.begin(), objs.end(), bind2nd(ProxyIdentityEqual(comm),"Server2")) != objs.end());
test(find_if(objs.begin(), objs.end(), bind2nd(ProxyIdentityEqual(comm),"SimpleServer")) != objs.end());
test(find_if(objs.begin(), objs.end(), bind2nd(ProxyIdentityEqual(comm),"IceBox1-Service1")) != objs.end());
test(find_if(objs.begin(), objs.end(), bind2nd(ProxyIdentityEqual(comm),"IceBox1-Service2")) != objs.end());
test(find_if(objs.begin(), objs.end(), bind2nd(ProxyIdentityEqual(comm),"IceBox2-Service1")) != objs.end());
test(find_if(objs.begin(), objs.end(), bind2nd(ProxyIdentityEqual(comm),"IceBox2-Service2")) != objs.end());
test(find_if(objs.begin(), objs.end(), bind2nd(ProxyIdentityEqual(comm),"SimpleIceBox-SimpleService")) != objs.end());
test(find_if(objs.begin(), objs.end(), bind2nd(ProxyIdentityEqual(comm),"ReplicatedObject")) != objs.end());
{
test(identityToString(query->findObjectByType("::TestId1")->ice_getIdentity()) == "cat/name1");
test(identityToString(query->findObjectByType("::TestId2")->ice_getIdentity()) == "cat1/name1");
test(identityToString(query->findObjectByType("::TestId3")->ice_getIdentity()) == "cat1/name1-bis");
test(identityToString(query->findObjectByType("::TestId4")->ice_getIdentity()) == "c2\\/c2/n2\\/n2");
test(identityToString(query->findObjectByType("::TestId5")->ice_getIdentity()) == "n2\\/n2");
}
{
Ice::ObjectPrx obj = query->findObjectByType("::Test");
string id = identityToString(obj->ice_getIdentity());
test(id == "Server1" || id == "Server2" || id == "SimpleServer" ||
id == "IceBox1-Service1" || id == "IceBox1-Service2" ||
id == "IceBox2-Service1" || id == "IceBox2-Service2" ||
id == "SimpleIceBox-SimpleService" || "ReplicatedObject");
}
{
Ice::ObjectPrx obj = query->findObjectByTypeOnLeastLoadedNode("::Test", LoadSample5);
string id = identityToString(obj->ice_getIdentity());
test(id == "Server1" || id == "Server2" || id == "SimpleServer" ||
id == "IceBox1-Service1" || id == "IceBox1-Service2" ||
id == "IceBox2-Service1" || id == "IceBox2-Service2" ||
id == "SimpleIceBox-SimpleService" || "ReplicatedObject");
}
{
Ice::ObjectPrx obj = query->findObjectByType("::Foo");
test(!obj);
obj = query->findObjectByTypeOnLeastLoadedNode("::Foo", LoadSample15);
test(!obj);
}
Ice::Identity encoding10_oneway;
encoding10_oneway.name = "encoding10-oneway";
test(query->findObjectById(encoding10_oneway)->ice_getEncodingVersion() == Ice::Encoding_1_0);
test(query->findObjectById(encoding10_oneway)->ice_isOneway());
Ice::Identity encoding10_secure;
encoding10_secure.name = "encoding10-secure";
test(query->findObjectById(encoding10_secure)->ice_getEncodingVersion() == Ice::Encoding_1_0);
test(query->findObjectById(encoding10_secure)->ice_isSecure());
Ice::Identity oaoptions;
oaoptions.name = "oaoptions";
test(query->findObjectById(oaoptions)->ice_getEncodingVersion() == Ice::stringToEncodingVersion("1.2"));
test(query->findObjectById(oaoptions)->ice_isTwoway());
Ice::Identity comoptions;
comoptions.name = "communicatoroptions";
//.........这里部分代码省略.........