本文整理汇总了C++中corba::Object_ptr::_set_policy_overrides方法的典型用法代码示例。如果您正苦于以下问题:C++ Object_ptr::_set_policy_overrides方法的具体用法?C++ Object_ptr::_set_policy_overrides怎么用?C++ Object_ptr::_set_policy_overrides使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类corba::Object_ptr
的用法示例。
在下文中一共展示了Object_ptr::_set_policy_overrides方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: defined
CORBA::Object_ptr
TAO_CEC_ProxyPushSupplier::apply_policy_obj (CORBA::Object_ptr pre)
{
#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0
CORBA::Object_var post = CORBA::Object::_duplicate (pre);
if (this->timeout_ > ACE_Time_Value::zero)
{
CORBA::PolicyList policy_list;
policy_list.length (1);
#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
if (this->typed_event_channel_)
{
policy_list[0] = this->typed_event_channel_->
create_roundtrip_timeout_policy (this->timeout_);
}
else
{
#endif
policy_list[0] = this->event_channel_->
create_roundtrip_timeout_policy (this->timeout_);
#if defined (TAO_HAS_TYPED_EVENT_CHANNEL)
}
#endif
post = pre->_set_policy_overrides (policy_list, CORBA::ADD_OVERRIDE);
policy_list[0]->destroy ();
policy_list.length (0);
}
return post._retn ();
#else
return CORBA::Object::_duplicate (pre);
#endif /* TAO_HAS_CORBA_MESSAGING */
}
示例2: policy_list
int
insecure_invocation_test (CORBA::ORB_ptr orb,
CORBA::Object_ptr obj)
{
// Disable protection for this insecure invocation test.
Security::QOP qop = Security::SecQOPNoProtection;
CORBA::Any no_protection;
no_protection <<= qop;
// Create the Security::QOPPolicy.
CORBA::Policy_var policy =
orb->create_policy (Security::SecQOPPolicy,
no_protection);
CORBA::PolicyList policy_list (1);
policy_list.length (1);
policy_list[0] = CORBA::Policy::_duplicate (policy.in ());
// Create an object reference that uses plain IIOP (i.e. no
// protection).
CORBA::Object_var object =
obj->_set_policy_overrides (policy_list,
CORBA::SET_OVERRIDE);
Foo::Bar_var server =
Foo::Bar::_narrow (object.in ());
if (CORBA::is_nil (server.in ()))
{
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR: Object reference <%s> is "
"nil.\n",
ior));
return 1;
}
try
{
// This invocation should result in a CORBA::NO_PERMISSION
// exception.
server->baz ();
}
catch (const CORBA::NO_PERMISSION&)
{
ACE_DEBUG ((LM_INFO,
"(%P|%t) Received CORBA::NO_PERMISSION from "
"server, as expected.\n"));
return 0;
}
ACE_ERROR ((LM_ERROR,
"(%P|%t) ERROR: CORBA::NO_PERMISSION was not thrown.\n"
"(%P|%t) ERROR: It should have been thrown.\n"));
return 1;
}
示例3: ret
CORBA::Object_ptr
ImR_Locator_i::set_timeout_policy (CORBA::Object_ptr obj, const ACE_Time_Value& to)
{
CORBA::Object_var ret (CORBA::Object::_duplicate (obj));
try
{
TimeBase::TimeT timeout;
ORBSVCS_Time::Time_Value_to_TimeT (timeout, to);
CORBA::Any tmp;
tmp <<= timeout;
CORBA::PolicyList policies (1);
policies.length (1);
policies[0] = orb_->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE,
tmp);
ret = obj->_set_policy_overrides (policies, CORBA::ADD_OVERRIDE);
policies[0]->destroy ();
if (CORBA::is_nil (ret.in ()))
{
if (debug_ > 0)
{
ORBSVCS_DEBUG ((LM_DEBUG,
ACE_TEXT ("(%P|%t) ImR: Unable to set timeout policy.\n")));
}
ret = CORBA::Object::_duplicate (obj);
}
}
catch (const CORBA::Exception& ex)
{
ex._tao_print_exception (
ACE_TEXT ("(%P|%t) ImR_Locator_i::set_timeout_policy ()"));
}
return ret._retn ();
}