本文整理汇总了C++中portableinterceptor::ServerRequestInfo_ptr::server_id方法的典型用法代码示例。如果您正苦于以下问题:C++ ServerRequestInfo_ptr::server_id方法的具体用法?C++ ServerRequestInfo_ptr::server_id怎么用?C++ ServerRequestInfo_ptr::server_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableinterceptor::ServerRequestInfo_ptr
的用法示例。
在下文中一共展示了ServerRequestInfo_ptr::server_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: INTERNAL
void
ServerRequestInterceptor::receive_request (
PortableInterceptor::ServerRequestInfo_ptr ri)
{
// If no response is expected, then we're invoking the oneway
// shutdown operation. Don't bother displaying output a second
// time.
CORBA::Boolean response_expected =
ri->response_expected ();
if (!response_expected)
return;
PortableServer::POA_var poa;
try
{
poa = this->poa_current_->get_POA ();
}
catch (const PortableServer::Current::NoContext& ex)
{
ex._tao_print_exception ("ServerRequestInterceptor::receive_request");
throw CORBA::INTERNAL ();
}
PortableServer::POA_var parent_poa =
poa->the_parent ();
// Make sure there is more than one POA in the POA hierarchy since
// the servant should have been registered with a child POA, not the
// RootPOA.
ACE_ASSERT (!CORBA::is_nil (parent_poa.in ()));
PortableInterceptor::AdapterName_var name =
ri->adapter_name ();
ACE_DEBUG ((LM_INFO,
"POA Hierarchy:\n"
"==============\n"));
const CORBA::ULong len = name->length ();
// Make sure there is more than one AdapterName in the AdapterName
// sequence since the servant should have been registered with a
// child POA, not the RootPOA.
ACE_ASSERT (len > 1);
for (CORBA::ULong i = 0; i < len; ++i)
{
for (CORBA::ULong j = 0; j < i; ++j)
ACE_DEBUG ((LM_INFO, "\t"));
ACE_DEBUG ((LM_INFO,
"%C\n",
static_cast<char const*>(name[i])));
}
ACE_DEBUG ((LM_INFO,
"\n"
"==============\n"));
// Make sure the name of the RootPOA is the first in the AdapterName
// sequence.
ACE_ASSERT (ACE_OS::strcmp ("RootPOA", name[(CORBA::ULong) 0]) == 0);
CORBA::String_var orb_id = ri->orb_id ();
ACE_ASSERT (ACE_OS::strcmp (this->orb_id_.in (), orb_id.in ()) == 0);
CORBA::String_var server_id = ri->server_id ();
ACE_ASSERT (ACE_OS::strcmp (server_id.in (), "ORT_test_server") == 0);
}