本文整理汇总了C++中portableinterceptor::ClientRequestInfo_ptr::received_exception方法的典型用法代码示例。如果您正苦于以下问题:C++ ClientRequestInfo_ptr::received_exception方法的具体用法?C++ ClientRequestInfo_ptr::received_exception怎么用?C++ ClientRequestInfo_ptr::received_exception使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableinterceptor::ClientRequestInfo_ptr
的用法示例。
在下文中一共展示了ClientRequestInfo_ptr::received_exception方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ForwardRequest
void
Client_Request_Interceptor::receive_exception (
PortableInterceptor::ClientRequestInfo_ptr ri)
{
++this->exception_count_;
ACE_DEBUG ((LM_DEBUG, "received exception %d\n",
this->exception_count_));
if (CORBA::is_nil (this->orb_.in ()))
{
int argc = 0;
ACE_TCHAR **argv = 0;
this->orb_ = CORBA::ORB_init (argc, argv, this->orb_id_.in ());
}
if (this->exception_count_ == 1)
{
ACE_DEBUG ((LM_DEBUG, "forwarding client to the second server\n"));
CORBA::Object_var first_forward =
this->orb_->string_to_object (this->first_forward_str_.in ());
// Notice that this is not a permanent forward.
throw PortableInterceptor::ForwardRequest (first_forward.in ());
}
else if (this->exception_count_ == 2)
{
ACE_DEBUG ((LM_DEBUG, "forwarding client to the third server\n"));
CORBA::Object_var second_forward =
this->orb_->string_to_object (this->second_forward_str_.in ());
// Notice that this is not a permanent forward.
throw PortableInterceptor::ForwardRequest (second_forward.in ());
}
else if (this->exception_count_ == 3)
{
CORBA::Any_var ex = ri->received_exception ();
CORBA::TypeCode_var tc;
const char * id = 0;
tc = ex->type ();
id = tc->id ();
if (ACE_OS_String::strcmp (id,
"IDL:omg.org/CORBA/TRANSIENT:1.0") == 0)
throw ::CORBA::TRANSIENT (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO);
}
}