本文整理汇总了C++中portableserver::POA_ptr::set_servant_manager方法的典型用法代码示例。如果您正苦于以下问题:C++ POA_ptr::set_servant_manager方法的具体用法?C++ POA_ptr::set_servant_manager怎么用?C++ POA_ptr::set_servant_manager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableserver::POA_ptr
的用法示例。
在下文中一共展示了POA_ptr::set_servant_manager方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: catch
bool
set_nil_servant_manager (PortableServer::POA_ptr poa)
{
bool succeed = false;
try
{
// Setting a nil servant manager should give an OBJ_Adapter exception with
// minor code 4
poa->set_servant_manager (PortableServer::ServantManager::_nil());
}
catch (const CORBA::OBJ_ADAPTER& ex)
{
if ((ex.minor() & 0xFFFU) == 4)
{
succeed = true;
}
}
catch (const CORBA::Exception&)
{
}
if (!succeed)
{
ACE_ERROR ((LM_ERROR,
"(%t) ERROR, set nil servant manager failed\n"));
}
return succeed;
}
示例2: servant_locator
bool
overwrite_servant_manager (PortableServer::POA_ptr poa)
{
bool succeed = false;
try
{
Servant_Locator servant_locator (poa);
// Setting a servant manager after it is already set should give
// obj_adapter with minor code 6
poa->set_servant_manager (&servant_locator);
}
catch (const CORBA::BAD_INV_ORDER& ex)
{
if ((ex.minor() & 0xFFFU) == 6)
{
succeed = true;
}
}
catch (const CORBA::Exception&)
{
}
if (!succeed)
{
ACE_ERROR ((LM_ERROR,
"(%t) ERROR, overwrite servant manager failed\n"));
}
return succeed;
}
示例3: catch
void
test_set_servant_manager (PortableServer::POA_ptr poa)
{
bool succeed = false;
try
{
// Setting the servant manager should give a wrong policy exception
// exception
poa->set_servant_manager (PortableServer::ServantManager::_nil());
}
catch (const PortableServer::POA::WrongPolicy& )
{
succeed = true;
}
catch (const CORBA::Exception&)
{
}
if (!succeed)
{
ACE_ERROR ((LM_ERROR,
"(%t) ERROR, set servant manager failed, should give an exception\n"));
}
}