本文整理汇总了C++中AdminPrx::getApplicationInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ AdminPrx::getApplicationInfo方法的具体用法?C++ AdminPrx::getApplicationInfo怎么用?C++ AdminPrx::getApplicationInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminPrx
的用法示例。
在下文中一共展示了AdminPrx::getApplicationInfo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test
//.........这里部分代码省略.........
testApp.nodes["node1"] = node;
try
{
admin->addApplication(testApp);
}
catch(const DeploymentException& ex)
{
cerr << ex.reason << endl;
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
test(false);
}
ApplicationUpdateDescriptor update;
update.name = "TestApp";
NodeUpdateDescriptor nodeUpdate;
nodeUpdate.name = "node2";
nodeUpdate.variables["nodename"] = "node2";
update.nodes.push_back(nodeUpdate);
try
{
admin->updateApplication(update);
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
test(false);
}
testApp = admin->getApplicationInfo("TestApp").descriptor;
test(testApp.nodes.size() == 2);
test(testApp.nodes["node1"].variables["nodename"] == "node1");
test(testApp.nodes["node2"].variables["nodename"] == "node2");
cout << "ok" << endl;
cout << "testing node update... " << flush;
nodeUpdate.name = "node2";
nodeUpdate.variables["nodename"] = "node2updated";
update.nodes.back() = nodeUpdate;
try
{
admin->updateApplication(update);
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
test(false);
}
testApp = admin->getApplicationInfo("TestApp").descriptor;
test(testApp.nodes.size() == 2);
test(testApp.nodes["node1"].variables["nodename"] == "node1");
test(testApp.nodes["node2"].variables["nodename"] == "node2updated");
cout << "ok" << endl;
cout << "testing node remove... " << flush;
update.nodes.clear();
update.removeNodes.push_back("node1");
try
示例2: test
//.........这里部分代码省略.........
test(test->getApplicationFile("dir2/file4") == "dummy-file4");
try
{
admin->patchApplication("Test", true);
}
catch(const PatchException& ex)
{
copy(ex.reasons.begin(), ex.reasons.end(), ostream_iterator<string>(cerr, "\n"));
test(false);
}
test = TestIntfPrx::uncheckedCast(communicator->stringToProxy("server-dir1"));
test(test->getServerFile("rootfile") == "");
test(test->getServerFile("dir1/file1") == "");
test(test->getServerFile("dir1/file2") == "dummy-file2-updated!");
test(test->getServerFile("dir2/file3") == "");
test(test->getServerFile("dir2/file4") == "");
test(test->getApplicationFile("rootfile") == "");
test(test->getApplicationFile("dir1/file1") == "");
test(test->getApplicationFile("dir1/file2") == "");
test(test->getApplicationFile("dir2/file3") == "dummy-file3");
test(test->getApplicationFile("dir2/file4") == "dummy-file4");
admin->stopServer("Test.IcePatch2");
admin->stopServer("IcePatch2-Direct");
}
cout << "ok" << endl;
cout << "testing application distrib configuration... " << flush;
try
{
ApplicationDescriptor app = admin->getApplicationInfo("Test").descriptor;
admin->removeApplication("Test");
app.variables["icepatch.directory"] = "${test.dir}/data/original";
test(app.nodes["localnode"].servers[2]->id == "server-dir1");
app.nodes["localnode"].servers[2]->applicationDistrib = false;
admin->addApplication(app);
admin->startServer("Test.IcePatch2");
try
{
admin->patchServer("server-dir1", true);
}
catch(const PatchException& ex)
{
copy(ex.reasons.begin(), ex.reasons.end(), ostream_iterator<string>(cerr, "\n"));
test(false);
}
TestIntfPrx test = TestIntfPrx::uncheckedCast(communicator->stringToProxy("server-dir1"));
test(test->getServerFile("rootfile") == "");
test(test->getServerFile("dir1/file1") == "dummy-file1");
test(test->getServerFile("dir1/file2") == "dummy-file2");
test(test->getServerFile("dir2/file3") == "");
test(test->getApplicationFile("rootfile") == "");
test(test->getApplicationFile("dir1/file1") == "");
test(test->getApplicationFile("dir1/file2") == "");
test(test->getApplicationFile("dir2/file3") == "");
admin->removeApplication("Test");
示例3: test
//.........这里部分代码省略.........
params["id"] = "Server1";
instantiateServer(admin, "Server", "inactivenode", params);
obj = TestIntfPrx::uncheckedCast(comm->stringToProxy("Random"));
test(svcReplicaIds.find(obj->getReplicaId()) != svcReplicaIds.end());
removeServer(admin, "IceBox1");
removeServer(admin, "Server1");
};
cout << "ok" << endl;
cout << "testing replica group from different applications... " << flush;
{
map<string, string> params;
params["replicaGroup"] = "Random";
params["id"] = "Server1";
instantiateServer(admin, "Server", "localnode", params);
ApplicationUpdateDescriptor update;
update.name = "Test";
update.removeReplicaGroups.push_back("Random");
try
{
admin->updateApplication(update);
test(false);
}
catch(const DeploymentException&)
{
// The Random replica goup is used by Server1!
}
//
// Add an application Test1 without replica groups and a
// server that uses the Random replica group.
//
ApplicationInfo app = admin->getApplicationInfo("Test");
app.descriptor.name = "Test1";
app.descriptor.replicaGroups.clear();
app.descriptor.nodes.clear();
try
{
admin->addApplication(app.descriptor);
}
catch(const DeploymentException& ex)
{
cerr << ex << endl;
test(false);
}
params["id"] = "Server2";
instantiateServer(admin, "Server", "localnode", params, "Test1");
try
{
admin->removeApplication("Test");
test(false);
}
catch(const DeploymentException&)
{
// Test has a replica group referenced by the Test1 application.
}
TestIntfPrx obj = TestIntfPrx::uncheckedCast(comm->stringToProxy("Random"));
obj = TestIntfPrx::uncheckedCast(obj->ice_locatorCacheTimeout(0));
obj = TestIntfPrx::uncheckedCast(obj->ice_connectionCached(false));
set<string> replicaIds;
replicaIds.insert("Server1.ReplicatedAdapter");
replicaIds.insert("Server2.ReplicatedAdapter");
while(!replicaIds.empty())