本文整理汇总了C++中AdminPrx::removeApplication方法的典型用法代码示例。如果您正苦于以下问题:C++ AdminPrx::removeApplication方法的具体用法?C++ AdminPrx::removeApplication怎么用?C++ AdminPrx::removeApplication使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AdminPrx
的用法示例。
在下文中一共展示了AdminPrx::removeApplication方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test
//.........这里部分代码省略.........
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");
示例2: test
//.........这里部分代码省略.........
ServiceDescriptorPtr svc1 = icebox->services[0].descriptor;
TestIntfPrx svc1Prx = TestIntfPrx::checkedCast(communicator->stringToProxy("IceBox.Service1"));
ServiceDescriptorPtr svc2 = icebox->services[1].descriptor;
TestIntfPrx svc2Prx = TestIntfPrx::checkedCast(communicator->stringToProxy("IceBox.Service2"));
ServiceDescriptorPtr svc3 = icebox->services[2].descriptor;
TestIntfPrx svc3Prx = TestIntfPrx::checkedCast(communicator->stringToProxy("IceBox.Service3"));
addProperty(svc1, "test", "test");
test(svc1Prx->getProperty("test") == "");
updateServerRuntimeProperties(admin, "IceBox", icebox);
test(svc1Prx->getProperty("test") == "test");
test(iceBoxPid == admin->getServerPid("IceBox"));
admin->stopServer("IceBox");
admin->startServer("IceBox");
test((iceBoxPid = admin->getServerPid("IceBox")) > 0);
test(svc1Prx->getProperty("test") == "test");
test(hasProperty(getServiceDescriptor(admin, "Service1"), "test", "test"));
addProperty(svc1, "test2", "test2");
test(svc1Prx->getProperty("test2") == "");
updateServerRuntimeProperties(admin, "IceBox", icebox);
test(svc1Prx->getProperty("test2") == "test2");
test(iceBoxPid == admin->getServerPid("IceBox"));
test(hasProperty(getServiceDescriptor(admin, "Service1"), "test2", "test2"));
removeProperty(svc1, "test2");
updateServerRuntimeProperties(admin, "IceBox", icebox);
test(svc1Prx->getProperty("test2") == "");
test(iceBoxPid == admin->getServerPid("IceBox"));
test(!hasProperty(getServiceDescriptor(admin, "Service1"), "test2", "test2"));
addProperty(svc1, "test3", "test3");
test(svc1Prx->getProperty("test3") == "");
updateServerRuntimeProperties(admin, "IceBox", icebox);
test(svc1Prx->getProperty("test3") == "test3");
test(iceBoxPid == admin->getServerPid("IceBox"));
test(hasProperty(getServiceDescriptor(admin, "Service1"), "test3", "test3"));
admin->stopServer("IceBox");
test(svc1Prx->getProperty("test") == "test");
test(svc1Prx->getProperty("test2") == "");
test(svc1Prx->getProperty("test3") == "test3");
test((iceBoxPid = admin->getServerPid("IceBox")) > 0);
// Wait for the server to be active to have the guarantee that
// the property update will return once the properties are
// updated.
while(admin->getServerState("IceBox") != IceGrid::Active)
{
IceUtil::ThreadControl::sleep(IceUtil::Time::milliSeconds(100));
}
test(hasProperty(getServiceDescriptor(admin, "Service1"), "test", "test"));
test(!hasProperty(getServiceDescriptor(admin, "Service1"), "test2", ""));
test(hasProperty(getServiceDescriptor(admin, "Service1"), "test3", "test3"));
addProperty(svc2, "test22", "test22");
addProperty(svc3, "test32", "test32");
test(svc2Prx->getProperty("test22") == "");
test(svc3Prx->getProperty("test32") == "");
updateServerRuntimeProperties(admin, "IceBox", icebox);
test(svc2Prx->getProperty("test22") == "test22");
test(svc3Prx->getProperty("test32") == "test32");
test(iceBoxPid == admin->getServerPid("IceBox"));
test(hasProperty(getServiceDescriptor(admin, "Service2"), "test22", "test22"));
test(hasProperty(getServiceDescriptor(admin, "Service3"), "test32", "test32"));
removeProperty(svc2, "test22");
addProperty(svc3, "test33", "test33");
updateServerRuntimeProperties(admin, "IceBox", icebox);
test(svc2Prx->getProperty("test22") == "");
test(svc3Prx->getProperty("test33") == "test33");
test(iceBoxPid == admin->getServerPid("IceBox"));
test(!hasProperty(getServiceDescriptor(admin, "Service2"), "test22", "test22"));
test(hasProperty(getServiceDescriptor(admin, "Service3"), "test33", "test33"));
addProperty(svc2, "test24", "test24");
removeProperty(svc3, "test33");
addProperty(svc3, "test34", "test34");
updateServerRuntimeProperties(admin, "IceBox", icebox);
test(svc2Prx->getProperty("test24") == "test24");
test(svc3Prx->getProperty("test33") == "");
test(svc3Prx->getProperty("test34") == "test34");
test(iceBoxPid == admin->getServerPid("IceBox"));
test(hasProperty(getServiceDescriptor(admin, "Service2"), "test24", "test24"));
test(!hasProperty(getServiceDescriptor(admin, "Service3"), "test33", "test33"));
test(hasProperty(getServiceDescriptor(admin, "Service3"), "test34", "test34"));
cout << "ok" << endl;
admin->removeApplication("TestApp");
}
//
// TODO: Add more tests.
//
session->destroy();
}
示例3: test
//.........这里部分代码省略.........
try
{
admin->updateApplication(update);
test(true);
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
test(false);
}
info = admin->getServerInfo("Server");
test(info.descriptor);
object = ObjectDescriptor();
object.id = communicator->stringToIdentity("test");
info.descriptor->adapters[0].allocatables.push_back(object);
update = empty;
update.nodes[0].servers.push_back(info.descriptor);
try
{
admin->updateApplication(update);
test(false);
}
catch(const DeploymentException&)
{
// Object already exists
}
catch(const Ice::Exception& ex)
{
cerr << ex << endl;
test(false);
}
admin->removeApplication("TestApp");
cout << "ok" << endl;
}
{
ApplicationDescriptor testApp;
testApp.name = "TestApp";
admin->addApplication(testApp);
ApplicationUpdateDescriptor empty;
empty.name = "TestApp";
NodeUpdateDescriptor node;
node.name = "localnode";
empty.nodes.push_back(node);
ApplicationUpdateDescriptor update = empty;
cout << "testing icebox server add... " << flush;
ServiceDescriptorPtr service = new ServiceDescriptor();
service->name = "Service1";
service->entry = "TestService:create";
AdapterDescriptor adapter;
adapter.name = "${service}";
adapter.id = "${server}.${service}";
adapter.registerProcess = false;
adapter.serverLifetime = false;
addProperty(service, "${service}.Endpoints", "default");
service->adapters.push_back(adapter);
IceBoxDescriptorPtr server = new IceBoxDescriptor();
server->id = "IceBox";
示例4: 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())
{
try
{
replicaIds.erase(obj->getReplicaId());
}
catch(const Ice::LocalException& ex)
{
cerr << ex << endl;
test(false);
}
}
removeServer(admin, "Server2");
removeServer(admin, "Server1");
ReplicaGroupDescriptor replicaGroup;
replicaGroup.id = "ReplicatedAdapterFromTest1";
replicaGroup.loadBalancing = new RandomLoadBalancingPolicy();