本文整理汇总了C++中portableinterceptor::ORBInitInfo_ptr::orb_id方法的典型用法代码示例。如果您正苦于以下问题:C++ ORBInitInfo_ptr::orb_id方法的具体用法?C++ ORBInitInfo_ptr::orb_id怎么用?C++ ORBInitInfo_ptr::orb_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableinterceptor::ORBInitInfo_ptr
的用法示例。
在下文中一共展示了ORBInitInfo_ptr::orb_id方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
Client_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
CORBA::String_var orb_id = info->orb_id ();
CORBA::StringSeq_var args = info->arguments ();
CORBA::String_var forward_str;
// Extract the last forward reference from the argument list.
CORBA::ULong args_len = args->length ();
for (CORBA::ULong i = 0; i < args_len; ++i)
if (ACE_OS::strcmp ("-k", args[i]) == 0
&& i < (args_len - 1))
forward_str = args[i + 1];
PortableInterceptor::ClientRequestInterceptor_ptr interceptor =
PortableInterceptor::ClientRequestInterceptor::_nil ();
// Install the client request interceptor.
ACE_NEW_THROW_EX (interceptor,
Client_Request_Interceptor (orb_id.in (),
forward_str.in ()),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::ClientRequestInterceptor_var
client_interceptor = interceptor;
info->add_client_request_interceptor (client_interceptor.in ());
}
示例2: ServerRequestInterceptor
void
ServerORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
CORBA::Object_var obj =
info->resolve_initial_references ("POACurrent");
PortableServer::Current_var poa_current =
PortableServer::Current::_narrow (obj.in ());
ACE_ASSERT (!CORBA::is_nil (poa_current.in ()));
CORBA::String_var orb_id = info->orb_id ();
// Create and register the test's ServerRequestInterceptor
PortableInterceptor::ServerRequestInterceptor_ptr tmp;
ACE_NEW_THROW_EX (tmp,
ServerRequestInterceptor (orb_id.in (),
poa_current.in ()),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::ServerRequestInterceptor_var server_interceptor = tmp;
info->add_server_request_interceptor (server_interceptor.in ());
// Create and register the test's IORInterceptor
PortableInterceptor::IORInterceptor_ptr ort_test_interceptor;
ACE_NEW_THROW_EX (ort_test_interceptor,
ORT_test_IORInterceptor,
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::IORInterceptor_var ior_interceptor =
ort_test_interceptor;
info->add_ior_interceptor (ior_interceptor.in ());
}
示例3:
void
TAO_LB_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
CORBA::Object_var obj =
info->resolve_initial_references ("LoadManager");
CosLoadBalancing::LoadManager_var lm =
CosLoadBalancing::LoadManager::_narrow (obj.in ());
CORBA::String_var orbid = info->orb_id ();
PortableInterceptor::IORInterceptor_ptr tmp;
ACE_NEW_THROW_EX (tmp,
TAO_LB_IORInterceptor (this->object_groups_,
this->repository_ids_,
this->location_.in (),
lm.in (),
orbid.in (),
this->load_alert_),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::IORInterceptor_var ior_interceptor = tmp;
info->add_ior_interceptor (ior_interceptor.in ());
// ----------------
PortableInterceptor::ServerRequestInterceptor_ptr sri;
ACE_NEW_THROW_EX (sri,
TAO_LB_ServerRequestInterceptor (this->load_alert_),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::ServerRequestInterceptor_var sr_interceptor = sri;
info->add_server_request_interceptor (sr_interceptor.in ());
}
示例4: if
void
Collocated_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
CORBA::String_var orb_id =
info->orb_id ();
if (!ACE_OS::strcmp (orb_id.in (), "client_orb"))
{
PortableInterceptor::ClientRequestInterceptor_ptr interceptor =
PortableInterceptor::ClientRequestInterceptor::_nil ();
// Install the Echo client request interceptor
ACE_NEW_THROW_EX (interceptor,
Echo_Client_Request_Interceptor (orb_id.in ()),
CORBA::NO_MEMORY ());
PortableInterceptor::ClientRequestInterceptor_var
client_interceptor = interceptor;
info->add_client_request_interceptor (client_interceptor.in ());
}
else if (!ACE_OS::strcmp (orb_id.in (), "server_orb"))
{
PortableInterceptor::ServerRequestInterceptor_ptr interceptor =
PortableInterceptor::ServerRequestInterceptor::_nil ();
// Install the Echo server request interceptor
ACE_NEW_THROW_EX (interceptor,
Echo_Server_Request_Interceptor,
CORBA::NO_MEMORY ());
PortableInterceptor::ServerRequestInterceptor_var
server_interceptor = interceptor;
info->add_server_request_interceptor (server_interceptor.in ());
}
else
{
//Throw exception?
}
}
示例5:
void
Client_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
CORBA::String_var orb_id =
info->orb_id ();
PortableInterceptor::ClientRequestInterceptor_ptr interceptor =
PortableInterceptor::ClientRequestInterceptor::_nil ();
// Install the Echo client request interceptor
ACE_NEW_THROW_EX (interceptor,
Client_Request_Interceptor (orb_id.in ()),
CORBA::NO_MEMORY ());
PortableInterceptor::ClientRequestInterceptor_var
client_interceptor = interceptor;
info->add_client_request_interceptor (client_interceptor.in ());
}
示例6: INTERNAL
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
void
TAO::Security::ORBInitializer::pre_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
// Narrow to a TAO_ORBInitInfo object to get access to the
// allocate_tss_slot_id() TAO extension.
TAO_ORBInitInfo_var tao_info =
TAO_ORBInitInfo::_narrow (info);
if (CORBA::is_nil (tao_info.in ()))
{
if (TAO_debug_level > 0)
ORBSVCS_ERROR ((LM_ERROR,
"(%P|%t) Security_ORBInitializer::pre_init:\n"
"(%P|%t) Unable to narrow "
"\"PortableInterceptor::ORBInitInfo_ptr\" to\n"
"(%P|%t) \"TAO_ORBInitInfo_ptr.\"\n"));
throw CORBA::INTERNAL ();
}
// Reserve a TSS slot in the ORB core internal TSS resources for the
// thread-specific portion of Security::Current.
size_t tss_slot = tao_info->allocate_tss_slot_id (0 /* no cleanup function */);
#if 1
#if 0 // why am I getting a BAD_OPERATION from no SSL context?!
CORBA::String_var orb_id = info->orb_id ();
// Create the SecurityLevel2::Current object.
SecurityLevel2::Current_ptr current = SecurityLevel2::Current::_nil ();
ACE_NEW_THROW_EX (current,
TAO_Security_Current (tss_slot, orb_id.in ()),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
SecurityLevel2::Current_var security_current = current;
// Register the SecurityLevel2::Current object reference with the
// ORB.
info->register_initial_reference ("SecurityCurrent",
security_current.in ());
#endif
/*
* Instantiate and register the SecurityLevel2::SecurityManager
*/
SecurityLevel2::SecurityManager_ptr manager2;
ACE_NEW_THROW_EX (manager2,
TAO::Security::SecurityManager (/*need args*/),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
SecurityLevel2::SecurityManager_var security_manager2 = manager2;
// Register the SecurityLevel2::SecurityManager object reference
// with the ORB.
info->register_initial_reference ("SecurityLevel2:SecurityManager",
security_manager2.in ());
#endif
// Rather than reserve another TSS slot in the ORB core internal TSS
// resources for the thread-specific portion of
// SecurityLevel3::SecurityCurrent object, we will re-use the slot
// allocated earlier.
// Create the SecurityLevel3::Current object.
SecurityLevel3::SecurityCurrent_ptr current3;
ACE_NEW_THROW_EX (current3,
TAO::SL3::SecurityCurrent (tss_slot,
tao_info->orb_core ()),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
SecurityLevel3::SecurityCurrent_var security_current3 = current3;
// Register the SecurityLevel2::Current object reference with the
// ORB.
info->register_initial_reference ("SecurityLevel3:SecurityCurrent",
security_current3.in ());
// Create the SecurityLevel3::CredentialsCurator object.
SecurityLevel3::CredentialsCurator_ptr curator;
ACE_NEW_THROW_EX (curator,
TAO::SL3::CredentialsCurator,
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
//.........这里部分代码省略.........
示例7: INTERNAL
void
Echo_Collocated_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
CORBA::String_var orb_id =
info->orb_id ();
// TAO-Specific way to get to the ORB Core (and thus, the ORB).
TAO_ORBInitInfo_var tao_info =
TAO_ORBInitInfo::_narrow (info);
CORBA::ORB_var orb = CORBA::ORB::_duplicate(tao_info->orb_core()->orb());
if (CORBA::is_nil(orb.in()))
{
throw CORBA::INTERNAL ();
}
PortableInterceptor::ORBInitInfo_3_1_var info_3_1 =
PortableInterceptor::ORBInitInfo_3_1::_narrow(info);
if (CORBA::is_nil(info_3_1.in()))
{
throw CORBA::INTERNAL ();
}
if (!ACE_OS::strcmp (orb_id.in (), "client_orb"))
{
PortableInterceptor::ClientRequestInterceptor_ptr interceptor =
PortableInterceptor::ClientRequestInterceptor::_nil ();
// Install the Echo client request interceptor
ACE_NEW_THROW_EX (interceptor,
Echo_Client_Request_Interceptor,
CORBA::NO_MEMORY ());
PortableInterceptor::ClientRequestInterceptor_var
client_interceptor = interceptor;
CORBA::Any client_proc_mode_as_any;
client_proc_mode_as_any <<= this->client_processing_mode_;
CORBA::PolicyList policy_list (1);
policy_list.length (1);
policy_list[0] =
orb->create_policy (PortableInterceptor::PROCESSING_MODE_POLICY_TYPE,
client_proc_mode_as_any);
info_3_1->add_client_request_interceptor_with_policy (
client_interceptor.in (),
policy_list);
policy_list[0]->destroy ();
policy_list[0] = CORBA::Policy::_nil ();
}
else if (!ACE_OS::strcmp (orb_id.in (), "server_orb"))
{
PortableInterceptor::ServerRequestInterceptor_ptr interceptor =
PortableInterceptor::ServerRequestInterceptor::_nil ();
// Install the Echo server request interceptor
ACE_NEW_THROW_EX (interceptor,
Echo_Server_Request_Interceptor,
CORBA::NO_MEMORY ());
PortableInterceptor::ServerRequestInterceptor_var
server_interceptor = interceptor;
CORBA::Any server_proc_mode_as_any;
server_proc_mode_as_any <<= this->server_processing_mode_;
CORBA::PolicyList policy_list (1);
policy_list.length (1);
policy_list[0] =
orb->create_policy (PortableInterceptor::PROCESSING_MODE_POLICY_TYPE,
server_proc_mode_as_any);
info_3_1->add_server_request_interceptor_with_policy (
server_interceptor.in (),
policy_list);
policy_list[0]->destroy ();
policy_list[0] = CORBA::Policy::_nil ();
}
else
{
}
}