当前位置: 首页>>代码示例>>C++>>正文


C++ ObjectAdapterPtr::addServantLocator方法代码示例

本文整理汇总了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;
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:10,代码来源:Server.cpp

示例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;
}
开发者ID:updowndown,项目名称:myffff,代码行数:17,代码来源:Server.cpp

示例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;
}
开发者ID:yuanbaopapa,项目名称:ice,代码行数:38,代码来源:Server.cpp


注:本文中的ObjectAdapterPtr::addServantLocator方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。