예제 #1
0
void
IceInternal::RouterInfo::getClientProxyException(const Ice::Exception& ex, const GetClientEndpointsCallbackPtr& callback)
{
    if(dynamic_cast<const Ice::CollocationOptimizationException*>(&ex))
    {
        try
        {
            callback->setEndpoints(getClientEndpoints());
        }
        catch(const Ice::LocalException& e)
        {
            callback->setException(e);
        }
    }
    else
    {
        callback->setException(dynamic_cast<const Ice::LocalException&>(ex));
    }
}
예제 #2
0
파일: RouterInfo.cpp 프로젝트: Jonavin/ice
void
IceInternal::RouterInfo::getClientEndpoints(const GetClientEndpointsCallbackPtr& callback)
{
    vector<EndpointIPtr> clientEndpoints;
    {
        IceUtil::Mutex::Lock sync(*this);
        clientEndpoints = _clientEndpoints;
    }

    if(!clientEndpoints.empty())
    {
        callback->setEndpoints(clientEndpoints);
        return;
    }

    _router->begin_getClientProxy(newCallback_Router_getClientProxy(this, 
                                                                    &RouterInfo::getClientProxyResponse, 
                                                                    &RouterInfo::getClientProxyException),
                                  callback);
}
예제 #3
0
void
IceInternal::RouterInfo::getClientEndpoints(const GetClientEndpointsCallbackPtr& callback)
{
    vector<EndpointIPtr> clientEndpoints;
    {
        IceUtil::Mutex::Lock sync(*this);
        clientEndpoints = _clientEndpoints;
    }

    if(!clientEndpoints.empty())
    {
        callback->setEndpoints(clientEndpoints);
        return;
    }

#ifdef ICE_CPP11_MAPPING
    RouterInfoPtr self = this;
    _router->getClientProxy_async(
        [self, callback](const Ice::ObjectPrxPtr& proxy)
        {
            self->getClientProxyResponse(proxy, callback);
        },
        [self, callback](exception_ptr e)
        {
            try
            {
                rethrow_exception(e);
            }
            catch(const Ice::Exception& ex)
            {
                self->getClientProxyException(ex, callback);
            }
        });
#else
    _router->begin_getClientProxy(newCallback_Router_getClientProxy(this,
                                                                    &RouterInfo::getClientProxyResponse,
                                                                    &RouterInfo::getClientProxyException),
                                  callback);
#endif
}
예제 #4
0
파일: RouterInfo.cpp 프로젝트: Jonavin/ice
void
IceInternal::RouterInfo::getClientProxyException(const Ice::Exception& ex, 
                                                 const GetClientEndpointsCallbackPtr& callback)
{
    callback->setException(dynamic_cast<const Ice::LocalException&>(ex));
}
예제 #5
0
파일: RouterInfo.cpp 프로젝트: Jonavin/ice
void
IceInternal::RouterInfo::getClientProxyResponse(const Ice::ObjectPrx& proxy, 
                                                const GetClientEndpointsCallbackPtr& callback)
{
    callback->setEndpoints(setClientEndpoints(proxy));
}