本文整理汇总了C++中ObjectPrx::ice_facet方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPrx::ice_facet方法的具体用法?C++ ObjectPrx::ice_facet怎么用?C++ ObjectPrx::ice_facet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectPrx
的用法示例。
在下文中一共展示了ObjectPrx::ice_facet方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ObjectNotExistException
ObjectPrx
IceGrid::RegistryReplicaAdminRouter::getTarget(const Current& current)
{
ObjectPrx target;
if(current.id.name == _name)
{
// Straight to the local Admin object
target = current.adapter->getCommunicator()->getAdmin();
}
else
{
try
{
// Forward to Admin object in remote replica
target = _database->getReplica(current.id.name)->getAdminProxy();
}
catch(const RegistryNotExistException&)
{
}
}
if(target == 0)
{
throw ObjectNotExistException(__FILE__, __LINE__);
}
return target->ice_facet(current.facet);
}
示例2: 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);
}
示例3: 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);
}
示例4: deactivateGuard
//.........这里部分代码省略.........
BackgroundSaveEvictorElementPtr element = new BackgroundSaveEvictorElement(*store);
element->status = dead;
BackgroundSaveEvictorElementPtr oldElt = store->putIfAbsent(ident, element);
if(oldElt != 0)
{
element = oldElt;
}
{
Lock sync(*this);
if(element->stale)
{
//
// Try again
//
continue;
}
fixEvictPosition(element);
IceUtil::Mutex::Lock lock(element->mutex);
switch(element->status)
{
case clean:
case created:
case modified:
{
alreadyThere = true;
break;
}
case destroyed:
{
element->status = modified;
element->rec.servant = servant;
//
// No need to push it on the modified queue, as a destroyed object
// is either already on the queue or about to be saved. When saved,
// it becomes dead.
//
break;
}
case dead:
{
element->status = created;
ObjectRecord& rec = element->rec;
rec.servant = servant;
if(store->keepStats())
{
rec.stats.creationTime = IceUtil::Time::now(IceUtil::Time::Monotonic).toMilliSeconds();
rec.stats.lastSaveTime = 0;
rec.stats.avgSaveTime = 0;
}
addToModifiedQueue(element);
break;
}
default:
{
assert(0);
break;
}
}
}
break; // for(;;)
}
if(alreadyThere)
{
AlreadyRegisteredException ex(__FILE__, __LINE__);
ex.kindOfObject = "servant";
ex.id = _communicator->identityToString(ident);
if(!facet.empty())
{
ex.id += " -f " + IceUtilInternal::escapeString(facet, "");
}
throw ex;
}
if(_trace >= 1)
{
Trace out(_communicator->getLogger(), "Freeze.Evictor");
out << "added object \"" << _communicator->identityToString(ident) << "\"";
if(!facet.empty())
{
out << " with facet \"" << facet << "\"";
}
out << " to Db \"" << _filename << "\"";
}
ObjectPrx obj = _adapter->createProxy(ident);
if(!facet.empty())
{
obj = obj->ice_facet(facet);
}
return obj;
}
示例5: if
void
Glacier2::Blobject::invoke(ObjectPrx& proxy, const AMD_Object_ice_invokePtr& amdCB,
const std::pair<const Byte*, const Byte*>& inParams, const Current& current)
{
//
// Set the correct facet on the proxy.
//
if(!current.facet.empty())
{
proxy = proxy->ice_facet(current.facet);
}
//
// Modify the proxy according to the request id. This can
// be overridden by the _fwd context.
//
if(current.requestId == 0)
{
if(_alwaysBatch && _requestQueue)
{
proxy = proxy->ice_batchOneway();
}
else
{
proxy = proxy->ice_oneway();
}
}
else if(current.requestId > 0)
{
proxy = proxy->ice_twoway();
}
//
// Modify the proxy according to the _fwd context field.
//
Context::const_iterator p = current.ctx.find("_fwd");
if(p != current.ctx.end())
{
for(unsigned int i = 0; i < p->second.length(); ++i)
{
char option = p->second[i];
switch(option)
{
case 't':
{
proxy = proxy->ice_twoway();
break;
}
case 'o':
{
if(_alwaysBatch && _requestQueue)
{
proxy = proxy->ice_batchOneway();
}
else
{
proxy = proxy->ice_oneway();
}
break;
}
case 'd':
{
if(_alwaysBatch && _requestQueue)
{
proxy = proxy->ice_batchDatagram();
}
else
{
proxy = proxy->ice_datagram();
}
break;
}
case 'O':
{
if(_requestQueue)
{
proxy = proxy->ice_batchOneway();
}
else
{
proxy = proxy->ice_oneway();
}
break;
}
case 'D':
{
if(_requestQueue)
{
proxy = proxy->ice_batchDatagram();
}
else
{
proxy = proxy->ice_datagram();
}
break;
}
//.........这里部分代码省略.........