本文整理汇总了C++中portableinterceptor::ServerRequestInfo_ptr::response_expected方法的典型用法代码示例。如果您正苦于以下问题:C++ ServerRequestInfo_ptr::response_expected方法的具体用法?C++ ServerRequestInfo_ptr::response_expected怎么用?C++ ServerRequestInfo_ptr::response_expected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableinterceptor::ServerRequestInfo_ptr
的用法示例。
在下文中一共展示了ServerRequestInfo_ptr::response_expected方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ForwardRequest
void
Server_Request_Interceptor::receive_request_service_contexts (
PortableInterceptor::ServerRequestInfo_ptr ri)
{
this->request_count_++;
CORBA::Boolean response_expected =
ri->response_expected ();
if (!response_expected) // A one-way request.
return;
// Request 1 -- non-forwarded
// Request 2 -- forwarded by client request interceptor
// Request 3 -- forwarded by this interception point
if (this->request_count_ == 3)
{
// The client request interceptor should have already forwarded
// the request to obj_[1], so we re-forward the request back to
// obj_[0].
ACE_DEBUG ((LM_DEBUG,
"SERVER (%P|%t) Request %d will be forwarded "
"to object 1\n" // "object 1" as in "obj_[0]"
"SERVER (%P|%t) via "
"receive_request_service_contexts().\n",
this->request_count_));
throw PortableInterceptor::ForwardRequest (this->obj_[0]);
}
}
示例2: INTERNAL
void
Server_Request_Interceptor::send_other (
PortableInterceptor::ServerRequestInfo_ptr ri)
{
CORBA::Boolean response_expected =
ri->response_expected ();
if (!response_expected) // A one-way request.
return;
// If we get this far then we should have received a
// LOCATION_FORWARD reply.
// This will throw an exception if a location forward has not
// occured. If an exception is thrown then something is wrong with
// the PortableInterceptor::ForwardRequest support.
CORBA::Object_var forward = ri->forward_reference ();
if (CORBA::is_nil (forward.in ()))
throw CORBA::INTERNAL ();
}
示例3: 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);
}