本文整理汇总了C++中cosnaming::NamingContext_var::rebind_context方法的典型用法代码示例。如果您正苦于以下问题:C++ NamingContext_var::rebind_context方法的具体用法?C++ NamingContext_var::rebind_context怎么用?C++ NamingContext_var::rebind_context使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cosnaming::NamingContext_var
的用法示例。
在下文中一共展示了NamingContext_var::rebind_context方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OBJECT_NOT_EXIST
void
TAO_Hash_Naming_Context::rebind_context (const CosNaming::Name &n,
CosNaming::NamingContext_ptr nc)
{
// Check to make sure this object didn't have <destroy> method
// invoked on it.
if (this->destroyed_)
throw CORBA::OBJECT_NOT_EXIST ();
// Get the length of the name.
CORBA::ULong const name_len = n.length ();
// Check for invalid name.
if (name_len == 0)
throw CosNaming::NamingContext::InvalidName();
// If we received compound name, resolve it to get the context in
// which the rebinding should take place, then perform the rebinding
// on target context.
if (name_len > 1)
{
CosNaming::NamingContext_var context = this->get_context (n);
CosNaming::Name simple_name;
simple_name.length (1);
simple_name[0] = n[name_len - 1];
try
{
context->rebind_context (simple_name, nc);
}
catch (const CORBA::SystemException&)
{
throw CosNaming::NamingContext::CannotProceed(
context.in (), simple_name);
}
}
else
// If we received a simple name, we need to rebind it in this
// context.
{
ACE_WRITE_GUARD_THROW_EX (TAO_SYNCH_RW_MUTEX, ace_mon,
this->lock_,
CORBA::INTERNAL ());
int result = this->context_->rebind (n[0].id,
n[0].kind,
nc,
CosNaming::ncontext);
// Check for error conditions.
if (result == -1)
throw CORBA::INTERNAL ();
else if (result == -2)
throw CosNaming::NamingContext::NotFound(
CosNaming::NamingContext::not_context,
n);
}
}