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


C++ ObjectPrx类代码示例

本文整理汇总了C++中ObjectPrx的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPrx类的具体用法?C++ ObjectPrx怎么用?C++ ObjectPrx使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了ObjectPrx类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ObjectNotExistException

ObjectPrx
IceGrid::RegistryNodeAdminRouter::getTarget(const Current& current)
{
    ObjectPrx target;

    if(!_collocNodeName.empty() && current.id.name == _collocNodeName)
    {
        // Straight to the local Admin object
        target = current.adapter->getCommunicator()->getAdmin();
    }
    else
    {
        try
        {
            target = _database->getNode(current.id.name)->getAdminProxy();
        }
        catch(const NodeUnreachableException&)
        {
        }
        catch(const NodeNotExistException&)
        {
        }
        
        if(target == 0)
        {
            throw ObjectNotExistException(__FILE__, __LINE__);
        }
    }

    return target->ice_facet(current.facet);
}
开发者ID:Jonavin,项目名称:ice,代码行数:31,代码来源:RegistryAdminRouter.cpp

示例2: sync

void
IceGrid::AdminCallbackRouter::ice_invoke_async(const AMD_Object_ice_invokePtr& cb, 
                                               const pair<const Byte*, const Byte*>& inParams,
                                               const Current& current)
{
    ConnectionPtr con;

    {
        IceUtil::Mutex::Lock sync(_mutex);
        map<string, ConnectionPtr>::iterator p = _categoryToConnection.find(current.id.category);
        if(p == _categoryToConnection.end())
        {
            throw ObjectNotExistException(__FILE__, __LINE__);
        }
        con = p->second;
    }

  
    ObjectPrx target = con->createProxy(current.id)->ice_facet(current.facet);
    
        
    //
    // Call with AMI
    //
    target->begin_ice_invoke(current.operation, current.mode, inParams, current.ctx, 
                             newCallback_Object_ice_invoke(this, 
                                                           &AdminCallbackRouter::invokeResponse, 
                                                           &AdminCallbackRouter::invokeException),
                             cb);
}
开发者ID:465060874,项目名称:ice,代码行数:30,代码来源:AdminCallbackRouter.cpp

示例3: assert

void
AsyncResult::invokeSent()
{
    assert(_callback);

    try
    {
        AsyncResultPtr self(this);
        _callback->sent(self);
    }
    catch(const std::exception& ex)
    {
        warning(ex);
    }
    catch(...)
    {
        warning();
    }

    if(_observer)
    {
        ObjectPrx proxy = getProxy();
        if(!proxy || !proxy->ice_isTwoway())
        {
            _observer.detach();
        }            
    }
}
开发者ID:Jonavin,项目名称:ice,代码行数:28,代码来源:AsyncResult.cpp

示例4: OutgoingAsyncBase

ProxyOutgoingAsyncBase::ProxyOutgoingAsyncBase(const ObjectPrx& prx,
                                               const string& operation,
                                               const CallbackBasePtr& delegate,
                                               const LocalObjectPtr& cookie) :
    OutgoingAsyncBase(prx->ice_getCommunicator(), prx->__reference()->getInstance(), operation, delegate, cookie),
    _proxy(prx),
    _mode(Normal),
    _cnt(0),
    _sent(false)
{
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:11,代码来源:OutgoingAsync.cpp

示例5:

void
IceInternal::ProxyFactory::proxyToStream(const ObjectPrx& proxy, BasicStream* s) const
{
    if(proxy)
    {
        s->write(proxy->__reference()->getIdentity());
        proxy->__reference()->streamWrite(s);
    }
    else
    {
        Identity ident;
        s->write(ident);
    }
}
开发者ID:2008hatake,项目名称:zeroc-ice,代码行数:14,代码来源:ProxyFactory.cpp

示例6: getTarget

void
IceGrid::AdminRouter::ice_invoke_async(const AMD_Object_ice_invokePtr& cb, 
                                       const pair<const Byte*, const Byte*>& inParams,
                                       const Current& current)
{
    ObjectPrx target = getTarget(current);
    assert(target != 0);

    //
    // Call with AMI
    //
    Callback_Object_ice_invokePtr amiCb = 
        newCallback_Object_ice_invoke(new CallbackI(cb), &CallbackI::response, &CallbackI::exception);

    target->begin_ice_invoke(current.operation, current.mode, inParams, current.ctx, amiCb);
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:16,代码来源:AdminRouter.cpp

示例7: run

    virtual
    void run()
    {
        CommunicatorPtr communicator = initialize(initData);
        ObjectPrx routerBase = communicator->stringToProxy(
            "Glacier2/router:" + TestHelper::getTestEndpoint(communicator->getProperties(), 50));
        _router = Glacier2::RouterPrx::checkedCast(routerBase);
        communicator->setDefaultRouter(_router);

        ostringstream os;
        os << "userid-" << _id;
        Glacier2::SessionPrx session = _router->createSession(os.str(), "abc123");
        communicator->getProperties()->setProperty("Ice.PrintAdapterReady", "");
        ObjectAdapterPtr adapter = communicator->createObjectAdapterWithRouter("CallbackReceiverAdapter", _router);
        adapter->activate();

        string category = _router->getCategoryForClient();
        _callbackReceiver = new CallbackReceiverI;
        Identity ident;
        ident.name = "callbackReceiver";
        ident.category = category;
        CallbackReceiverPrx receiver = CallbackReceiverPrx::uncheckedCast(adapter->add(_callbackReceiver, ident));

        ObjectPrx base = communicator->stringToProxy(
            "c1/callback:" + TestHelper::getTestEndpoint(communicator->getProperties()));
        base = base->ice_oneway();
        CallbackPrx callback = CallbackPrx::uncheckedCast(base);

        {
            Lock sync(*this);
            _initialized = true;
            notifyAll();
        }
        {
            Lock sync(*this);
            while(!_notified)
            {
                wait();
            }
        }

        //
        // Stress the router until the connection is closed.
        //
        stress(callback, receiver);
        communicator->destroy();
    }
开发者ID:zeroc-ice,项目名称:ice-debian-packaging,代码行数:47,代码来源:Client.cpp

示例8: ProxyOutgoingAsyncBase

OutgoingAsync::OutgoingAsync(const ObjectPrx& prx, 
                             const string& operation, 
                             const CallbackBasePtr& delegate,
                             const LocalObjectPtr& cookie) :
    ProxyOutgoingAsyncBase(prx, operation, delegate, cookie),
    _encoding(getCompatibleEncoding(prx->__reference()->getEncoding()))
{
}
开发者ID:pedia,项目名称:zeroc-ice,代码行数:8,代码来源:OutgoingAsync.cpp

示例9: sync

vector<EndpointIPtr>
IceInternal::RouterInfo::setServerEndpoints(const Ice::ObjectPrx& /*serverProxy*/)
{
    IceUtil::Mutex::Lock sync(*this);
    if(_serverEndpoints.empty()) // Lazy initialization.
    {
        ObjectPrx serverProxy = _router->getServerProxy();
        if(!serverProxy)
        {
            throw NoEndpointException(__FILE__, __LINE__);
        }

        serverProxy = serverProxy->ice_router(0); // The server proxy cannot be routed.

        _serverEndpoints = serverProxy->__reference()->getEndpoints();
    }
    return _serverEndpoints;
}
开发者ID:Jonavin,项目名称:ice,代码行数:18,代码来源:RouterInfo.cpp

示例10: findFacet

ObjectPtr
Ice::ObjectAdapterI::findByProxy(const ObjectPrx& proxy) const
{
    IceUtil::Monitor<IceUtil::RecMutex>::Lock sync(*this);

    checkForDeactivation();

    ReferencePtr ref = proxy->__reference();
    return findFacet(ref->getIdentity(), ref->getFacet());
}
开发者ID:2008hatake,项目名称:zeroc-ice,代码行数:10,代码来源:ObjectAdapterI.cpp

示例11: out

void
IceGrid::RegistryNodeAdminRouter::ice_invoke_async(const AMD_Object_ice_invokePtr& cb,
                                                   const std::pair<const Ice::Byte*, const Ice::Byte*>& inParams,
                                                   const Current& current)
{
    ObjectPrx target;

    if(!_collocNodeName.empty() && current.id.name == _collocNodeName)
    {
        // Straight to the local Admin object
        target = current.adapter->getCommunicator()->getAdmin();
    }
    else
    {
        try
        {
            target = _database->getNode(current.id.name)->getAdminProxy();
        }
        catch(const NodeUnreachableException&)
        {
        }
        catch(const NodeNotExistException&)
        {
        }

        if(target == 0)
        {
            if(_traceLevels->admin > 0)
            {
                Ice::Trace out(_traceLevels->logger, _traceLevels->adminCat);
                out << "could not find Admin proxy for node `" << current.id.name << "'";
            }

            throw ObjectNotExistException(__FILE__, __LINE__);
        }
    }

    target = target->ice_facet(current.facet);

    invokeOnTarget(target, cb, inParams, current);
}
开发者ID:yuanbaopapa,项目名称:ice,代码行数:41,代码来源:RegistryAdminRouter.cpp

示例12: PropertyDict

PropertyDict
IceInternal::ProxyFactory::proxyToProperty(const ObjectPrx& proxy, const string& prefix) const
{
    if(proxy)
    {
        return proxy->__reference()->toProperty(prefix);
    }
    else
    {
        return PropertyDict();
    }
}
开发者ID:2008hatake,项目名称:zeroc-ice,代码行数:12,代码来源:ProxyFactory.cpp

示例13: write

Ice::OutputStream::write(const ObjectPrx& v)
#endif
{
    if(v)
    {
        v->__write(*this);
    }
    else
    {
        Identity ident;
        write(ident);
    }
}
开发者ID:chenbk85,项目名称:ice,代码行数:13,代码来源:OutputStream.cpp

示例14: ObjectNotExistException

void
IceGrid::RegistryServerAdminRouter::ice_invoke_async(const AMD_Object_ice_invokePtr& cb,
                                                     const std::pair<const Ice::Byte*, const Ice::Byte*>& inParams,
                                                     const Current& current)
{
    ObjectPrx target = 0;

    try
    {
        ServerEntryPtr server = _database->getServer(current.id.name);
        try
        {
            target = server->getAdminProxy();
        }
        catch(const SynchronizationException&)
        {
            server->addSyncCallback(new SynchronizationCallbackI(this, cb, inParams, current));
            return; // Wait for the server synchronization to complete and retry.
        }
    }
    catch(const ServerNotExistException&)
    {
    }
    catch(const NodeUnreachableException&)
    {
    }
    catch(const DeploymentException&)
    {
    }

    if(target == 0)
    {
        throw ObjectNotExistException(__FILE__, __LINE__);
    }

    target = target->ice_facet(current.facet);

    invokeOnTarget(target, cb, inParams, current);
}
开发者ID:yuanbaopapa,项目名称:ice,代码行数:39,代码来源:RegistryAdminRouter.cpp

示例15: assert

void
IceInternal::RouterInfo::addProxy(const ObjectPrx& proxy)
{
    assert(proxy); // Must not be called for null proxies.

    {
        IceUtil::Mutex::Lock sync(*this);
        if(_identities.find(proxy->ice_getIdentity()) != _identities.end())
        {
            //
            // Only add the proxy to the router if it's not already in our local map.
            //
            return;
        }
    }

    ObjectProxySeq proxies;
    proxies.push_back(proxy);
    addAndEvictProxies(proxy, _router->addProxies(proxies));
}
开发者ID:Jonavin,项目名称:ice,代码行数:20,代码来源:RouterInfo.cpp


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