本文整理汇总了C++中portableinterceptor::ORBInitInfo_ptr::add_client_request_interceptor方法的典型用法代码示例。如果您正苦于以下问题:C++ ORBInitInfo_ptr::add_client_request_interceptor方法的具体用法?C++ ORBInitInfo_ptr::add_client_request_interceptor怎么用?C++ ORBInitInfo_ptr::add_client_request_interceptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableinterceptor::ORBInitInfo_ptr
的用法示例。
在下文中一共展示了ORBInitInfo_ptr::add_client_request_interceptor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: ClientInterceptor
void
ClientInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info
)
{
// get Codec factory
IOP::CodecFactory_var codec_factory = info->codec_factory();
// Create and register the request interceptors.
PortableInterceptor::ClientRequestInterceptor_ptr ci =
PortableInterceptor::ClientRequestInterceptor::_nil ();
try
{
ci = new ClientInterceptor (codec_factory);
}
catch(...)
{
std::cerr << "Exception occurred trying to create ClientInterceptor." << std::endl;
}
PortableInterceptor::ClientRequestInterceptor_var ci_interceptor =
ci;
info->add_client_request_interceptor (ci_interceptor.in ());
}
示例3:
void
Client_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
// Create and register the test request interceptors.
PortableInterceptor::ClientRequestInterceptor_ptr ci =
PortableInterceptor::ClientRequestInterceptor::_nil ();
ACE_NEW_THROW_EX (ci,
Client_Request_Interceptor ("CLIENT A"),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::ClientRequestInterceptor_var ci_interceptor =
ci;
info->add_client_request_interceptor (ci_interceptor.in ());
ACE_NEW_THROW_EX (ci,
Client_Request_Interceptor ("CLIENT B"),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
ci_interceptor = ci;
info->add_client_request_interceptor (ci_interceptor.in ());
ACE_NEW_THROW_EX (ci,
Client_Request_Interceptor ("CLIENT C"),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
ci_interceptor = ci;
info->add_client_request_interceptor (ci_interceptor.in ());
}
示例4: interceptor
void
Client_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
PortableInterceptor::ClientRequestInterceptor_var interceptor(
new Echo_Client_Request_Interceptor);
info->add_client_request_interceptor (interceptor.in ());
}
示例5: ClientInterceptor
void
ClientInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
{
// get Codec factory
IOP::CodecFactory_var codec_factory = info->codec_factory();
// Create and register the request interceptors.
PortableInterceptor::ClientRequestInterceptor_var ci =
new ClientInterceptor (codec_factory);
info->add_client_request_interceptor (ci.in());
}
示例6:
void
ClientORBInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
{
PortableInterceptor::ClientRequestInterceptor_ptr cri =
PortableInterceptor::ClientRequestInterceptor::_nil ();
ACE_NEW_THROW_EX (cri,
ClientRequest_Interceptor,
CORBA::NO_MEMORY ());
PortableInterceptor::ClientRequestInterceptor_var
client_interceptor = cri;
info->add_client_request_interceptor (client_interceptor.in ());
}
示例7: ClientInterceptor
void
ClientInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
{
// Find the Naming Service
CORBA::Object_var naming_obj =
info->resolve_initial_references("NameService");
CosNaming::NamingContext_var root =
CosNaming::NamingContext::_narrow(naming_obj.in());
if( CORBA::is_nil(root.in())) {
std::cerr << "Nil Naming Context reference" << std::endl;
ACE_ASSERT(false);
}
// Resolve the Messenger object
CosNaming::Name name;
name.length( 1 );
name[0].id = CORBA::string_dup( "Messenger" );
CORBA::Object_var obj = CORBA::Object::_nil();
while ( CORBA::is_nil( obj.in() ) ) {
try {
obj = root->resolve( name );
} catch (const CosNaming::NamingContext::NotFound&) {
// Sleep for a second and try again
ACE_OS::sleep(1);
}
}
Messenger_var messenger = Messenger::_narrow( obj.in() );
if( CORBA::is_nil( messenger.in() ) ) {
std::cerr << "Not a Messenger reference" << std::endl;
ACE_ASSERT(false);
}
// allocate slot
slot_ = info->allocate_slot_id();
// get PICurrent
CORBA::Object_var current_obj = info->resolve_initial_references("PICurrent");
current_ =
PortableInterceptor::Current::_narrow(current_obj.in());
// Create and register the request interceptors.
PortableInterceptor::ClientRequestInterceptor_var ci =
new ClientInterceptor(messenger, current_.in(), slot_);
info->add_client_request_interceptor (ci.in());
}
示例8:
void
TAO_LB_ClientORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
PortableInterceptor::ClientRequestInterceptor_ptr tmp;
ACE_NEW_THROW_EX (tmp,
TAO_LB_ClientRequestInterceptor,
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::ClientRequestInterceptor_var client_interceptor = tmp;
info->add_client_request_interceptor (client_interceptor.in ());
}
示例9:
void
Client_ORBInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info)
{
// Install the client request interceptor.
ACE_NEW_THROW_EX (client_interceptor_,
Client_Request_Interceptor,
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::ClientRequestInterceptor_var
client_interceptor = client_interceptor_;
info->add_client_request_interceptor (client_interceptor.in ());
}
示例10:
void
Client_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
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;
info->add_client_request_interceptor (client_interceptor.in ());
}
示例11: 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?
}
}
示例12: switch
void
Client_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
PortableInterceptor::ClientRequestInterceptor_ptr tmp =
PortableInterceptor::ClientRequestInterceptor::_nil ();
switch (this->interceptor_type_)
{
default:
case IT_NONE:
return;
case IT_NOOP:
{
// Installing the Vault interceptor
ACE_NEW_THROW_EX (tmp,
Vault_Client_Request_NOOP_Interceptor (),
CORBA::NO_MEMORY ());
break;
}
case IT_CONTEXT:
{
// Installing the Vault interceptor
ACE_NEW_THROW_EX (tmp,
Vault_Client_Request_Context_Interceptor (),
CORBA::NO_MEMORY ());
break;
}
case IT_DYNAMIC:
{
// Installing the Vault interceptor
ACE_NEW_THROW_EX (tmp,
Vault_Client_Request_Dynamic_Interceptor (),
CORBA::NO_MEMORY ());
break;
}
}
PortableInterceptor::ClientRequestInterceptor_var interceptor = tmp;
info->add_client_request_interceptor (interceptor.in ());
}
示例13:
void
TAO_FT_ClientORBInitializer::register_client_request_interceptors (
PortableInterceptor::ORBInitInfo_ptr info)
{
TAO::FT_ClientRequest_Interceptor* ftcri = 0;
ACE_NEW_THROW_EX (ftcri,
TAO::FT_ClientRequest_Interceptor,
CORBA::NO_MEMORY ());
PortableInterceptor::ClientRequestInterceptor_var
client_interceptor = ftcri;
TAO_ORBInitInfo* real_info = dynamic_cast<TAO_ORBInitInfo*> (info);
if (real_info)
{
ftcri->ft_send_extended_sc (real_info->orb_core ()->ft_send_extended_sc ());
}
info->add_client_request_interceptor (client_interceptor.in ());
}
示例14:
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
void
TAO_RTScheduler_ORB_Initializer::pre_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
//
// Register all of the RT related services.
//
// Create the RT_Current.
// Narrow to a TAO_ORBInitInfo object to get access to the
// orb_core() TAO extension.
if (TAO_debug_level > 0)
TAOLIB_DEBUG ((LM_DEBUG,
"In pre_init\n"));
TAO_ORBInitInfo_var tao_info = TAO_ORBInitInfo::_narrow (info);
if (CORBA::is_nil (tao_info.in ()))
{
if (TAO_debug_level > 0)
TAOLIB_ERROR ((LM_ERROR,
"(%P|%t) Security_ORBInitializer::pre_init:\n"
"(%P|%t) Unable to narrow "
"\"PortableInterceptor::ORBInitInfo_ptr\" to\n"
"(%P|%t) \"TAO_ORBInitInfo *.\"\n"));
throw ::CORBA::INTERNAL ();
}
TAO_RTScheduler_Current *tmp_current = 0;
ACE_NEW_THROW_EX (tmp_current,
TAO_RTScheduler_Current,
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
this->current_ = tmp_current;
this->current_->init (tao_info->orb_core ());
CORBA::Object_var current_obj =
RTScheduling::Current::_narrow (this->current_.in ());
info->register_initial_reference ("RTScheduler_Current", current_obj.in ());
Client_Interceptor *client_interceptor = 0;
ACE_NEW_THROW_EX (client_interceptor,
Client_Interceptor,
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::ClientRequestInterceptor_var safe_client =
client_interceptor;
info->add_client_request_interceptor (client_interceptor);
Server_Interceptor *server_interceptor = 0;
ACE_NEW_THROW_EX (server_interceptor,
Server_Interceptor (this->current_.in ()),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::ServerRequestInterceptor_var safe_server =
server_interceptor;
info->add_server_request_interceptor (server_interceptor);
// Set the RTScheduler_Manager
TAO_RTScheduler_Manager *manager = 0;
ACE_NEW_THROW_EX (manager,
TAO_RTScheduler_Manager (tao_info->orb_core ()),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
TAO_RTScheduler_Manager_var safe_manager = manager;
info->register_initial_reference ("RTSchedulerManager", manager);
}
示例15:
void
FTRT_ClientORB_Initializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
info->add_client_request_interceptor (client_interceptor_.in());
}