本文整理汇总了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);
}
示例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);
}
示例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();
}
}
}
示例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)
{
}
示例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);
}
}
示例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);
}
示例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();
}
示例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()))
{
}
示例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;
}
示例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());
}
示例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);
}
示例12: PropertyDict
PropertyDict
IceInternal::ProxyFactory::proxyToProperty(const ObjectPrx& proxy, const string& prefix) const
{
if(proxy)
{
return proxy->__reference()->toProperty(prefix);
}
else
{
return PropertyDict();
}
}
示例13: write
Ice::OutputStream::write(const ObjectPrx& v)
#endif
{
if(v)
{
v->__write(*this);
}
else
{
Identity ident;
write(ident);
}
}
示例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);
}
示例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));
}