本文整理汇总了C++中ObjectAdapterPtr::addServantLocator方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectAdapterPtr::addServantLocator方法的具体用法?C++ ObjectAdapterPtr::addServantLocator怎么用?C++ ObjectAdapterPtr::addServantLocator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectAdapterPtr
的用法示例。
在下文中一共展示了ObjectAdapterPtr::addServantLocator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: communicator
int
BackendServer::run(int, char**)
{
communicator()->getProperties()->setProperty("BackendAdapter.Endpoints", "tcp -p 12010");
ObjectAdapterPtr adapter = communicator()->createObjectAdapter("BackendAdapter");
adapter->addServantLocator(new ServantLocatorI, "");
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
}
示例2: communicator
int
BackendServer::run(int argc, char* argv[])
{
string endpoints =
communicator()->getProperties()->getPropertyWithDefault("BackendAdapter.Endpoints",
"tcp -p 12010 -t 20000:ssl -p 12011 -t 20000");
communicator()->getProperties()->setProperty("BackendAdapter.Endpoints", endpoints);
ObjectAdapterPtr adapter = communicator()->createObjectAdapter("BackendAdapter");
BackendPtr backend = new BackendI;
Ice::LocatorPtr locator = new ServerLocatorI(backend, adapter);
adapter->add(locator, communicator()->stringToIdentity("locator"));
adapter->addServantLocator(new ServantLocatorI(backend), "");
adapter->activate();
communicator()->waitForShutdown();
return EXIT_SUCCESS;
}
示例3: communicator
int
SessionControlServer::run(int, char*[])
{
//
// The server requires 3 separate server endpoints. One for the test
// controller that will coordinate the tests and the required
// configurations across the client and the router, an adapter for
// the session manager for the router to communicate with and
// finally, an adapter for the dummy backend server that the client
// will ultimately attempt to make calls on. The backend uses a
// servant locator that responds to each lookup with the same
// servant, allowing us to use any reference as long as the client
// expects to use a proxy for the correct type of object.
//
communicator()->getProperties()->setProperty("TestControllerAdapter.Endpoints",
getTestEndpoint(communicator(), 2, "tcp"));
ObjectAdapterPtr controllerAdapter = communicator()->createObjectAdapter("TestControllerAdapter");
TestControllerIPtr controller = new TestControllerI(getTestEndpoint(communicator(), 1));
controllerAdapter->add(controller, Ice::stringToIdentity("testController"));
controllerAdapter->activate();
communicator()->getProperties()->setProperty("SessionControlAdapter.Endpoints", getTestEndpoint(communicator(), 0));
ObjectAdapterPtr adapter = communicator()->createObjectAdapter("SessionControlAdapter");
adapter->add(new SessionManagerI(controller), Ice::stringToIdentity("SessionManager"));
adapter->activate();
BackendPtr backend = new BackendI;
communicator()->getProperties()->setProperty("BackendAdapter.Endpoints", getTestEndpoint(communicator(), 1));
ObjectAdapterPtr backendAdapter = communicator()->createObjectAdapter("BackendAdapter");
backendAdapter->addServantLocator(new ServantLocatorI(backend), "");
backendAdapter->activate();
Ice::LocatorPtr locator = new ServerLocatorI(backend, backendAdapter);
backendAdapter->add(locator, Ice::stringToIdentity("locator"));
communicator()->waitForShutdown();
return EXIT_SUCCESS;
}