当前位置: 首页>>代码示例>>C++>>正文


C++ NamingContext_var::rebind_context方法代码示例

本文整理汇总了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);
    }
}
开发者ID:binary42,项目名称:OCI,代码行数:58,代码来源:Hash_Naming_Context.cpp


注:本文中的cosnaming::NamingContext_var::rebind_context方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。