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)); } }
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); }
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 }
void IceInternal::RouterInfo::getClientProxyResponse(const Ice::ObjectPrx& proxy, const GetClientEndpointsCallbackPtr& callback) { callback->setEndpoints(setClientEndpoints(proxy)); }