本文整理汇总了C++中portableinterceptor::ORBInitInfo_ptr::add_ior_interceptor方法的典型用法代码示例。如果您正苦于以下问题:C++ ORBInitInfo_ptr::add_ior_interceptor方法的具体用法?C++ ORBInitInfo_ptr::add_ior_interceptor怎么用?C++ ORBInitInfo_ptr::add_ior_interceptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类portableinterceptor::ORBInitInfo_ptr
的用法示例。
在下文中一共展示了ORBInitInfo_ptr::add_ior_interceptor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void
FOO_IORInterceptor_ORBInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
IOP::CodecFactory_var codec_factory =
info->codec_factory ();
// Set up a structure that contains information necessary to
// create a GIOP 1.2 CDR encapsulation Codec.
IOP::Encoding encoding;
encoding.format = IOP::ENCODING_CDR_ENCAPS;
encoding.major_version = 1;
encoding.minor_version = 2;
// Obtain the CDR encapsulation Codec.
IOP::Codec_var codec =
codec_factory->create_codec (encoding);
PortableInterceptor::IORInterceptor_ptr foo;
ACE_NEW_THROW_EX (foo,
FOO_IORInterceptor (codec.in ()),
CORBA::NO_MEMORY (
CORBA::SystemException::_tao_minor_code (
TAO::VMCID,
ENOMEM),
CORBA::COMPLETED_NO));
PortableInterceptor::IORInterceptor_var ior_interceptor =
foo;
info->add_ior_interceptor (ior_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: ServerInterceptor
void
ServerInitializer::post_init (
PortableInterceptor::ORBInitInfo_ptr info)
{
// get reference to the codec_factory
IOP::CodecFactory_var codec_factory = info->codec_factory();
// Create and register the request interceptors.
PortableInterceptor::ServerRequestInterceptor_var si =
new ServerInterceptor (codec_factory);
info->add_server_request_interceptor (si.in());
// add IOR Interceptor
PortableInterceptor::IORInterceptor_var iori = new ServerIORInterceptor;
info->add_ior_interceptor (iori.in());
}
示例4:
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 ());
}